@instructure/quiz-core 20.9.0 → 20.9.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/building/components/layout/Sidebar/SidebarItem/presenter.js +16 -22
- package/es/building/components/layout/Sidebar/SidebarItem/styles.js +11 -0
- package/es/building/components/layout/Sidebar/SidebarItem/theme.js +4 -2
- package/es/building/components/layout/Sidebar/Stimulus/presenter.js +17 -23
- package/es/building/components/layout/Sidebar/Stimulus/styles.js +11 -0
- package/es/building/components/layout/Sidebar/Stimulus/theme.js +4 -2
- package/es/building/components/layout/Sidebar/presenter.js +42 -38
- package/es/building/components/layout/Sidebar/styles.js +28 -0
- package/es/building/components/layout/Sidebar/theme.js +4 -2
- package/es/building/components/layout/header/BuildingButtons/presenter.js +33 -39
- package/es/building/components/layout/header/BuildingButtons/styles.js +21 -0
- package/es/building/components/layout/header/BuildingButtons/theme.js +4 -2
- package/es/building/components/resources/ActionButtons/presenter.js +29 -27
- package/es/building/components/resources/ActionButtons/styles.js +33 -0
- package/es/building/components/resources/ActionButtons/theme.js +4 -2
- package/es/building/components/resources/AddToBankOptions/index.js +11 -15
- package/es/building/components/resources/AddToBankOptions/styles.js +11 -0
- package/es/building/components/resources/AddToBankOptions/theme.js +4 -2
- package/es/building/components/resources/DeleteStimulusModal/presenter.js +38 -44
- package/es/building/components/resources/DeleteStimulusModal/styles.js +22 -0
- package/es/building/components/resources/DeleteStimulusModal/theme.js +4 -2
- package/es/building/components/resources/ItemFeedbackModal/presenter.js +23 -28
- package/es/building/components/resources/ItemFeedbackModal/styles.js +14 -0
- package/es/building/components/resources/ItemFeedbackModal/theme.js +4 -2
- package/es/common/components/layout/sidebar/PositionSummary/index.js +17 -25
- package/es/common/components/layout/sidebar/PositionSummary/styles.js +28 -0
- package/es/common/components/layout/sidebar/PositionSummary/theme.js +4 -2
- package/es/common/components/layout/sidebar/Sidebar/index.js +88 -94
- package/es/common/components/layout/sidebar/Sidebar/styles.js +117 -0
- package/es/common/components/layout/sidebar/Sidebar/theme.js +4 -8
- package/es/common/components/layout/sidebar/SidebarItem/presenter.js +52 -52
- package/es/common/components/layout/sidebar/SidebarItem/styles.js +59 -0
- package/es/common/components/layout/sidebar/SidebarItem/theme.js +4 -2
- package/es/common/components/layout/sidebar/Stimulus/presenter.js +39 -36
- package/es/common/components/layout/sidebar/Stimulus/styles.js +33 -0
- package/es/common/components/layout/sidebar/Stimulus/theme.js +4 -2
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/index.js +40 -30
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/styles.js +41 -0
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/theme.js +4 -2
- package/lib/building/components/layout/Sidebar/SidebarItem/presenter.js +15 -23
- package/lib/building/components/layout/Sidebar/SidebarItem/styles.js +19 -0
- package/lib/building/components/layout/Sidebar/SidebarItem/theme.js +6 -3
- package/lib/building/components/layout/Sidebar/Stimulus/presenter.js +16 -24
- package/lib/building/components/layout/Sidebar/Stimulus/styles.js +19 -0
- package/lib/building/components/layout/Sidebar/Stimulus/theme.js +6 -3
- package/lib/building/components/layout/Sidebar/presenter.js +40 -41
- package/lib/building/components/layout/Sidebar/styles.js +38 -0
- package/lib/building/components/layout/Sidebar/theme.js +6 -3
- package/lib/building/components/layout/header/BuildingButtons/presenter.js +32 -40
- package/lib/building/components/layout/header/BuildingButtons/styles.js +29 -0
- package/lib/building/components/layout/header/BuildingButtons/theme.js +6 -3
- package/lib/building/components/resources/ActionButtons/presenter.js +28 -30
- package/lib/building/components/resources/ActionButtons/styles.js +44 -0
- package/lib/building/components/resources/ActionButtons/theme.js +6 -3
- package/lib/building/components/resources/AddToBankOptions/index.js +10 -16
- package/lib/building/components/resources/AddToBankOptions/styles.js +19 -0
- package/lib/building/components/resources/AddToBankOptions/theme.js +6 -3
- package/lib/building/components/resources/DeleteStimulusModal/presenter.js +37 -46
- package/lib/building/components/resources/DeleteStimulusModal/styles.js +30 -0
- package/lib/building/components/resources/DeleteStimulusModal/theme.js +6 -3
- package/lib/building/components/resources/ItemFeedbackModal/presenter.js +19 -27
- package/lib/building/components/resources/ItemFeedbackModal/styles.js +22 -0
- package/lib/building/components/resources/ItemFeedbackModal/theme.js +6 -3
- package/lib/common/components/layout/sidebar/PositionSummary/index.js +16 -26
- package/lib/common/components/layout/sidebar/PositionSummary/styles.js +36 -0
- package/lib/common/components/layout/sidebar/PositionSummary/theme.js +6 -3
- package/lib/common/components/layout/sidebar/Sidebar/index.js +85 -97
- package/lib/common/components/layout/sidebar/Sidebar/styles.js +128 -0
- package/lib/common/components/layout/sidebar/Sidebar/theme.js +5 -9
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +51 -55
- package/lib/common/components/layout/sidebar/SidebarItem/styles.js +69 -0
- package/lib/common/components/layout/sidebar/SidebarItem/theme.js +6 -3
- package/lib/common/components/layout/sidebar/Stimulus/presenter.js +38 -37
- package/lib/common/components/layout/sidebar/Stimulus/styles.js +41 -0
- package/lib/common/components/layout/sidebar/Stimulus/theme.js +6 -3
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/index.js +40 -33
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/styles.js +51 -0
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/theme.js +6 -3
- package/package.json +10 -10
|
@@ -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,29 +5,21 @@ 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
11
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
12
|
-
import classnames from 'classnames';
|
|
13
12
|
import { IconButton } from '@instructure/ui-buttons';
|
|
14
13
|
import { IconEditLine, IconTrashLine, IconDuplicateLine } from '@instructure/ui-icons';
|
|
15
|
-
import {
|
|
14
|
+
import { withStyle, jsx, Global } from '@instructure/emotion';
|
|
16
15
|
import DragHandle from "../../../../common/components/shared/drag_and_drop/DragHandle/index.js";
|
|
17
16
|
import makeScrollable from "../../../../common/components/shared/functionality/makeScrollable.js";
|
|
18
17
|
import noop from "../../../../common/util/noop.js";
|
|
19
18
|
import { EDIT, REMOVE, COPY } from '@instructure/quiz-common';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
template: function template(theme) {
|
|
23
|
-
return "\n\n.gEXZO_exDh{color:".concat(theme.buttonsColor || 'inherit', ";display:inline-flex;flex:0 0 auto;font-size:1.1rem;padding:0 ").concat(theme.buttonsPadding || 'inherit', ";text-align:right;z-index:").concat(theme.buttonsZIndex || 'inherit', "}\n\n[dir=ltr] .gEXZO_exDh,[dir=rtl] .gEXZO_exDh{text-align:right}\n\n.gEXZO_fwKS.gEXZO_bBLs,body.tox-fullscreen .gEXZO_exDh{display:none}\n\n@media print{.gEXZO_exDh{display:none}}");
|
|
24
|
-
},
|
|
25
|
-
'buttons': 'gEXZO_exDh',
|
|
26
|
-
'edit': 'gEXZO_fwKS',
|
|
27
|
-
'hide': 'gEXZO_bBLs'
|
|
28
|
-
};
|
|
29
|
-
import theme from "./theme.js";
|
|
19
|
+
import generateStyle from "./styles.js";
|
|
20
|
+
import generateComponentTheme from "./theme.js";
|
|
30
21
|
var ScrollTargetButton = makeScrollable(IconButton);
|
|
31
|
-
export var ActionButtons = (_dec =
|
|
22
|
+
export var ActionButtons = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
32
23
|
_inherits(ActionButtons, _Component);
|
|
33
24
|
|
|
34
25
|
var _super = _createSuper(ActionButtons);
|
|
@@ -73,6 +64,11 @@ export var ActionButtons = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
73
64
|
value: function shouldFocusOnMount() {
|
|
74
65
|
return this.props.shouldFocusOnMount && !this.props.editingAddContentPopover;
|
|
75
66
|
}
|
|
67
|
+
}, {
|
|
68
|
+
key: "componentDidUpdate",
|
|
69
|
+
value: function componentDidUpdate() {
|
|
70
|
+
this.props.makeStyles();
|
|
71
|
+
}
|
|
76
72
|
}, {
|
|
77
73
|
key: "componentDidMount",
|
|
78
74
|
value: function componentDidMount() {
|
|
@@ -84,20 +80,24 @@ export var ActionButtons = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
84
80
|
_this2.editButton && _this2.editButton.getWrappedInstance().setFocus();
|
|
85
81
|
}, 50);
|
|
86
82
|
}
|
|
83
|
+
|
|
84
|
+
this.props.makeStyles();
|
|
87
85
|
}
|
|
88
86
|
}, {
|
|
89
87
|
key: "render",
|
|
90
88
|
value: function render() {
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
89
|
+
var hideClass = !this.props.shouldRenderEdit ? 'hide' : '';
|
|
90
|
+
return jsx("div", {
|
|
91
|
+
className: "buttons",
|
|
95
92
|
tabIndex: "-1",
|
|
96
93
|
onFocus: this.onButtonFocus,
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
},
|
|
94
|
+
css: this.props.styles.buttons
|
|
95
|
+
}, jsx(Global, {
|
|
96
|
+
styles: this.props.styles.globalStyles
|
|
97
|
+
}), jsx("div", {
|
|
98
|
+
className: hideClass,
|
|
99
|
+
css: this.props.styles.edit
|
|
100
|
+
}, jsx(ScrollTargetButton, {
|
|
101
101
|
as: "div",
|
|
102
102
|
onClick: this.switchOnEditing,
|
|
103
103
|
scrollKey: this.props.scrollKey,
|
|
@@ -109,7 +109,7 @@ export var ActionButtons = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
109
109
|
shouldFocusOnMount: this.shouldFocusOnMount(),
|
|
110
110
|
screenReaderLabel: this.props.quizEntry.generateScreenReaderText(this.props.displayPosition, EDIT),
|
|
111
111
|
ref: this.setEditRef
|
|
112
|
-
})), this.props.questionCopyEnabled && this.props.onCopy &&
|
|
112
|
+
})), this.props.questionCopyEnabled && this.props.onCopy && jsx(IconButton, {
|
|
113
113
|
as: "div",
|
|
114
114
|
onClick: this.props.onCopy,
|
|
115
115
|
disabled: this.props.shouldDisableCopy,
|
|
@@ -119,12 +119,12 @@ export var ActionButtons = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
119
119
|
size: "small",
|
|
120
120
|
"data-automation": "sdk-copy-question-button",
|
|
121
121
|
screenReaderLabel: this.props.quizEntry.generateScreenReaderText(this.props.displayPosition, COPY)
|
|
122
|
-
}), this.connectDragSource(
|
|
122
|
+
}), this.connectDragSource(jsx("div", null, jsx(DragHandle, {
|
|
123
123
|
displayPosition: this.props.displayPosition,
|
|
124
124
|
quizEntry: this.props.quizEntry,
|
|
125
125
|
quizEntries: this.props.quizEntries,
|
|
126
126
|
disabled: this.props.shouldDisableDragHandle
|
|
127
|
-
}))), this.props.shouldRenderDelete &&
|
|
127
|
+
}))), this.props.shouldRenderDelete && jsx(IconButton, {
|
|
128
128
|
as: "div",
|
|
129
129
|
onClick: this.props.onDelete,
|
|
130
130
|
disabled: this.props.shouldDisableDeleteButton,
|
|
@@ -156,7 +156,9 @@ export var ActionButtons = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
156
156
|
shouldRenderEdit: PropTypes.bool,
|
|
157
157
|
shouldRenderDelete: PropTypes.bool,
|
|
158
158
|
switchOnEditing: PropTypes.func,
|
|
159
|
-
shouldFocusOnMount: PropTypes.bool
|
|
159
|
+
shouldFocusOnMount: PropTypes.bool,
|
|
160
|
+
styles: PropTypes.object,
|
|
161
|
+
makeStyles: PropTypes.func
|
|
160
162
|
}, _class2.defaultProps = {
|
|
161
163
|
onCopy: null,
|
|
162
164
|
scrollKey: void 0,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
|
|
4
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
5
|
+
var mq = '@media print';
|
|
6
|
+
return {
|
|
7
|
+
buttons: _defineProperty({
|
|
8
|
+
flex: '0 0 auto',
|
|
9
|
+
display: 'inline-flex',
|
|
10
|
+
textAlign: 'right',
|
|
11
|
+
zIndex: componentTheme.buttonsZIndex,
|
|
12
|
+
color: componentTheme.buttonsColor,
|
|
13
|
+
fontSize: '1.1rem',
|
|
14
|
+
padding: "0 ".concat(componentTheme.buttonsPadding)
|
|
15
|
+
}, mq, {
|
|
16
|
+
display: 'none'
|
|
17
|
+
}),
|
|
18
|
+
|
|
19
|
+
/* Hide buttons when the RCE editor is in fullscreen mode */
|
|
20
|
+
edit: _objectSpread({
|
|
21
|
+
display: 'inline'
|
|
22
|
+
}, !props.shouldRenderEdit && {
|
|
23
|
+
display: 'none'
|
|
24
|
+
}),
|
|
25
|
+
globalStyles: {
|
|
26
|
+
'body.tox-fullscreen .buttons': {
|
|
27
|
+
display: 'none'
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
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
|
return {
|
|
@@ -6,4 +6,6 @@ export default function generator(_ref) {
|
|
|
6
6
|
buttonsColor: colors.oxford,
|
|
7
7
|
buttonsPadding: spacing.xSmall
|
|
8
8
|
};
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default generateComponentTheme;
|
|
@@ -5,22 +5,17 @@ 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 { View } from '@instructure/ui-view';
|
|
11
12
|
import { CondensedButton } from '@instructure/ui-buttons';
|
|
12
|
-
import {
|
|
13
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
13
14
|
import { ADD_TO_BANK_MODAL } from '@instructure/quiz-common';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
template: function template(theme) {
|
|
17
|
-
return "\n\n.bsvMb_dNGs{background-color:".concat(theme.addToBankBackgroundColor || 'inherit', ";border:1px dashed ").concat(theme.addToBankBorderColor || 'inherit', ";text-align:center}\n\n[dir=ltr] .bsvMb_dNGs,[dir=rtl] .bsvMb_dNGs{text-align:center}");
|
|
18
|
-
},
|
|
19
|
-
'addToBank': 'bsvMb_dNGs'
|
|
20
|
-
};
|
|
21
|
-
import theme from "./theme.js";
|
|
15
|
+
import generateStyle from "./styles.js";
|
|
16
|
+
import generateComponentTheme from "./theme.js";
|
|
22
17
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
23
|
-
export var AddToBankOptions = (_dec =
|
|
18
|
+
export var AddToBankOptions = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
24
19
|
_inherits(AddToBankOptions, _Component);
|
|
25
20
|
|
|
26
21
|
var _super = _createSuper(AddToBankOptions);
|
|
@@ -65,10 +60,10 @@ export var AddToBankOptions = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
65
60
|
_createClass(AddToBankOptions, [{
|
|
66
61
|
key: "render",
|
|
67
62
|
value: function render() {
|
|
68
|
-
return
|
|
63
|
+
return jsx("div", null, jsx(View, {
|
|
69
64
|
as: "div",
|
|
70
|
-
|
|
71
|
-
},
|
|
65
|
+
css: this.props.styles.addToBank
|
|
66
|
+
}, jsx(CondensedButton, {
|
|
72
67
|
color: "primary",
|
|
73
68
|
ref: this.storeAddToBankLinkRef,
|
|
74
69
|
onClick: this.openAddToBankModal,
|
|
@@ -87,6 +82,7 @@ export var AddToBankOptions = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
87
82
|
isValid: PropTypes.bool.isRequired,
|
|
88
83
|
openModal: PropTypes.func.isRequired,
|
|
89
84
|
screenreaderNotification: PropTypes.func.isRequired,
|
|
90
|
-
showError: PropTypes.func.isRequired
|
|
85
|
+
showError: PropTypes.func.isRequired,
|
|
86
|
+
styles: PropTypes.object
|
|
91
87
|
}, _temp)) || _class);
|
|
92
88
|
export default AddToBankOptions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
addToBank: {
|
|
4
|
+
backgroundColor: componentTheme.addToBankBackgroundColor,
|
|
5
|
+
border: "1px dashed ".concat(componentTheme.addToBankBorderColor),
|
|
6
|
+
textAlign: 'center'
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default generateStyle;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
colors = _ref.colors;
|
|
4
4
|
return {
|
|
5
5
|
addToBankBackgroundColor: colors.porcelain,
|
|
6
6
|
addToBankBorderColor: colors.oxford
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default generateComponentTheme;
|
|
@@ -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 ImmutablePropTypes from 'react-immutable-proptypes';
|
|
11
12
|
import partial from 'lodash/partial';
|
|
@@ -15,27 +16,18 @@ import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
|
15
16
|
import { Checkbox } from '@instructure/ui-checkbox';
|
|
16
17
|
import { RadioInputGroup, RadioInput } from '@instructure/ui-radio-input';
|
|
17
18
|
import { Heading } from '@instructure/ui-heading';
|
|
18
|
-
import {
|
|
19
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
19
20
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
20
21
|
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
21
22
|
import { Modal, ModalHeader, ModalBody, ModalFooter, DELETE_STIMULUS_MODAL_SELECTED_CHILDREN, DELETE_STIMULUS_MODAL_DELETION_MODE, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
template: function template(theme) {
|
|
25
|
-
return "\n\n.cbBqk_UaUO{padding:".concat(theme.checkboxWrapperPadding || 'inherit', " 0}\n\n.cbBqk_eoFP{margin-left:auto;width:95%}\n\n.cbBqk_fJZN{font-size:").concat(theme.stimulusTitleFontSize || 'inherit', ";padding-bottom:").concat(theme.stimulusTitleBottomPadding || 'inherit', "}\n\n.cbBqk_fuUc{padding-bottom:").concat(theme.radioSpaceBottomPadding || 'inherit', "}");
|
|
26
|
-
},
|
|
27
|
-
'checkboxWrapper': 'cbBqk_UaUO',
|
|
28
|
-
'checkboxesWrapper': 'cbBqk_eoFP',
|
|
29
|
-
'stimulusTitle': 'cbBqk_fJZN',
|
|
30
|
-
'radioSpace': 'cbBqk_fuUc'
|
|
31
|
-
};
|
|
32
|
-
import theme from "./theme.js";
|
|
23
|
+
import generateStyle from "./styles.js";
|
|
24
|
+
import generateComponentTheme from "./theme.js";
|
|
33
25
|
|
|
34
|
-
var _ref =
|
|
26
|
+
var _ref = jsx(PresentationContent, null, jsx("hr", null));
|
|
35
27
|
|
|
36
|
-
var _ref2 =
|
|
28
|
+
var _ref2 = jsx(PresentationContent, null, jsx("hr", null));
|
|
37
29
|
|
|
38
|
-
export var DeleteStimulusModal = (_dec =
|
|
30
|
+
export var DeleteStimulusModal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
39
31
|
_inherits(DeleteStimulusModal, _Component);
|
|
40
32
|
|
|
41
33
|
var _super = _createSuper(DeleteStimulusModal);
|
|
@@ -112,10 +104,10 @@ export var DeleteStimulusModal = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
112
104
|
});
|
|
113
105
|
}
|
|
114
106
|
|
|
115
|
-
return
|
|
107
|
+
return jsx("div", {
|
|
116
108
|
key: childEntry.id,
|
|
117
|
-
|
|
118
|
-
},
|
|
109
|
+
css: _this.props.styles.checkboxWrapper
|
|
110
|
+
}, jsx(Checkbox, {
|
|
119
111
|
checked: isChecked,
|
|
120
112
|
label: extractTextFromHtml(itemBody),
|
|
121
113
|
onChange: _this.toggleChildSelected(childEntry),
|
|
@@ -124,9 +116,9 @@ export var DeleteStimulusModal = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
124
116
|
}));
|
|
125
117
|
});
|
|
126
118
|
|
|
127
|
-
return
|
|
119
|
+
return jsx("div", {
|
|
128
120
|
key: "checkboxes",
|
|
129
|
-
|
|
121
|
+
css: _this.props.styles.checkboxesWrapper
|
|
130
122
|
}, _ref, checkboxes, _ref2);
|
|
131
123
|
};
|
|
132
124
|
|
|
@@ -176,7 +168,7 @@ export var DeleteStimulusModal = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
176
168
|
}, {
|
|
177
169
|
key: "cancelButton",
|
|
178
170
|
value: function cancelButton() {
|
|
179
|
-
return
|
|
171
|
+
return jsx(Button, {
|
|
180
172
|
onClick: this.closeAction,
|
|
181
173
|
margin: XSMALL_SIDE_MARGIN
|
|
182
174
|
}, t('Keep Stimulus'));
|
|
@@ -188,7 +180,7 @@ export var DeleteStimulusModal = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
188
180
|
deletionMode = _this$props3.deletionMode,
|
|
189
181
|
childEntries = _this$props3.childEntries;
|
|
190
182
|
var disabled = !deletionMode && childEntries.size > 0;
|
|
191
|
-
return
|
|
183
|
+
return jsx(Button, {
|
|
192
184
|
disabled: disabled,
|
|
193
185
|
color: "primary",
|
|
194
186
|
onClick: this.handleSubmit,
|
|
@@ -203,64 +195,65 @@ export var DeleteStimulusModal = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
203
195
|
return;
|
|
204
196
|
}
|
|
205
197
|
|
|
206
|
-
return
|
|
198
|
+
return jsx(RadioInput, {
|
|
207
199
|
key: "chooseWhich",
|
|
208
200
|
value: "chooseWhich",
|
|
209
|
-
label:
|
|
210
|
-
|
|
201
|
+
label: jsx("div", {
|
|
202
|
+
css: this.props.styles.radioSpace
|
|
211
203
|
}, t('Remove stimulus and choose which questions to remove.'), this.renderCheckboxes())
|
|
212
204
|
});
|
|
213
205
|
}
|
|
214
206
|
}, {
|
|
215
207
|
key: "renderMainMenu",
|
|
216
208
|
value: function renderMainMenu() {
|
|
217
|
-
return
|
|
209
|
+
return jsx(RadioInputGroup, {
|
|
218
210
|
name: "deletionMode",
|
|
219
211
|
defaultValue: this.props.deletionMode,
|
|
220
212
|
onChange: this.setDeletionMode,
|
|
221
|
-
description:
|
|
222
|
-
},
|
|
213
|
+
description: jsx(ScreenReaderContent, null, t('Stimulus Removal Mode'))
|
|
214
|
+
}, jsx(RadioInput, {
|
|
223
215
|
key: "deleteAll",
|
|
224
216
|
value: "deleteAll",
|
|
225
|
-
label:
|
|
226
|
-
|
|
217
|
+
label: jsx("div", {
|
|
218
|
+
css: this.props.styles.radioSpace
|
|
227
219
|
}, t('Remove stimulus and all attached questions.'))
|
|
228
|
-
}), this.renderChooseWhich(),
|
|
220
|
+
}), this.renderChooseWhich(), jsx(RadioInput, {
|
|
229
221
|
key: "deleteNone",
|
|
230
222
|
value: "deleteNone",
|
|
231
|
-
label:
|
|
232
|
-
|
|
223
|
+
label: jsx("div", {
|
|
224
|
+
css: this.props.styles.radioSpace
|
|
233
225
|
}, t('Remove stimulus only. Questions will be released into assessment.'))
|
|
234
226
|
}));
|
|
235
227
|
}
|
|
236
228
|
}, {
|
|
237
229
|
key: "renderContent",
|
|
238
230
|
value: function renderContent() {
|
|
239
|
-
var content = this.props.childEntries.size === 0 ?
|
|
231
|
+
var content = this.props.childEntries.size === 0 ? jsx("span", null, t('Are you sure you want to remove this stimulus?')) : this.renderMainMenu();
|
|
240
232
|
var stimulusTitle = this.props.stimulusEntry && this.props.stimulusEntry.getEntry().title;
|
|
241
|
-
return
|
|
242
|
-
className:
|
|
243
|
-
|
|
244
|
-
|
|
233
|
+
return jsx("div", {
|
|
234
|
+
className: "deleteStimulusModal",
|
|
235
|
+
css: this.props.styles.deleteStimulusModal
|
|
236
|
+
}, jsx("div", {
|
|
237
|
+
css: this.props.styles.deleteStimulusModal.stimulusTitle
|
|
245
238
|
}, stimulusTitle), content);
|
|
246
239
|
}
|
|
247
240
|
}, {
|
|
248
241
|
key: "render",
|
|
249
242
|
value: function render() {
|
|
250
|
-
return
|
|
243
|
+
return jsx(Modal, {
|
|
251
244
|
open: this.props.modalOpen,
|
|
252
245
|
onDismiss: this.closeAction,
|
|
253
246
|
size: "small",
|
|
254
247
|
label: t('Confirm Stimulus Removal')
|
|
255
|
-
},
|
|
248
|
+
}, jsx(ModalHeader, null, jsx(Heading, {
|
|
256
249
|
level: "reset",
|
|
257
250
|
as: "h2"
|
|
258
|
-
}, t('Confirm Stimulus Removal')),
|
|
251
|
+
}, t('Confirm Stimulus Removal')), jsx(CloseButton, {
|
|
259
252
|
onClick: this.closeAction,
|
|
260
253
|
placement: "end",
|
|
261
254
|
offset: "medium",
|
|
262
255
|
screenReaderLabel: t('Close')
|
|
263
|
-
})),
|
|
256
|
+
})), jsx(ModalBody, null, this.renderContent()), jsx(ModalFooter, null, this.cancelButton(), this.doneButton()));
|
|
264
257
|
}
|
|
265
258
|
}]);
|
|
266
259
|
|
|
@@ -276,7 +269,8 @@ export var DeleteStimulusModal = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
276
269
|
setUi: PropTypes.func.isRequired,
|
|
277
270
|
withConfirm: PropTypes.func.isRequired,
|
|
278
271
|
stimulusEntry: ImmutablePropTypes.record,
|
|
279
|
-
quizId: PropTypes.string
|
|
272
|
+
quizId: PropTypes.string,
|
|
273
|
+
styles: PropTypes.object
|
|
280
274
|
}, _class2.defaultProps = {
|
|
281
275
|
selectedChildren: Set.of(),
|
|
282
276
|
deletionMode: '',
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
checkboxWrapper: {
|
|
4
|
+
padding: "".concat(componentTheme.checkboxWrapperPadding, " 0")
|
|
5
|
+
},
|
|
6
|
+
checkboxesWrapper: {
|
|
7
|
+
width: '95%',
|
|
8
|
+
marginLeft: 'auto'
|
|
9
|
+
},
|
|
10
|
+
deleteStimulusModal: {
|
|
11
|
+
stimulusTitle: {
|
|
12
|
+
paddingBottom: componentTheme.stimulusTitleBottomPadding,
|
|
13
|
+
fontSize: componentTheme.stimulusTitleFontSize
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
radioSpace: {
|
|
17
|
+
paddingBottom: componentTheme.radioSpaceBottomPadding
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
typography = _ref.typography;
|
|
4
4
|
return {
|
|
@@ -7,4 +7,6 @@ export default function generator(_ref) {
|
|
|
7
7
|
stimulusTitleFontSize: typography.fontSizeLarge,
|
|
8
8
|
radioSpaceBottomPadding: spacing.xSmall
|
|
9
9
|
};
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default generateComponentTheme;
|
|
@@ -5,28 +5,22 @@ 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 { Button, CloseButton } from '@instructure/ui-buttons';
|
|
12
13
|
import { Heading } from '@instructure/ui-heading';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
14
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
15
|
+
import { RichContentRendererEmotion, RichContentInput, RCE_THREE_LINES_HEIGHT } from '@instructure/quiz-rce';
|
|
15
16
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
16
17
|
import { Modal, ModalHeader, ModalBody, ModalFooter, ITEM_FEEDBACK_MODAL_FEEDBACK, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'feedbackLabel': 'esPWW_eCKf'
|
|
24
|
-
};
|
|
25
|
-
import theme from "./theme.js";
|
|
26
|
-
|
|
27
|
-
var _ref = /*#__PURE__*/React.createElement("br", null);
|
|
28
|
-
|
|
29
|
-
export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
18
|
+
import generateStyle from "./styles.js";
|
|
19
|
+
import generateComponentTheme from "./theme.js";
|
|
20
|
+
|
|
21
|
+
var _ref = jsx("br", null);
|
|
22
|
+
|
|
23
|
+
export var ItemFeedbackModal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
30
24
|
_inherits(ItemFeedbackModal, _Component);
|
|
31
25
|
|
|
32
26
|
var _super = _createSuper(ItemFeedbackModal);
|
|
@@ -72,7 +66,7 @@ export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
72
66
|
_createClass(ItemFeedbackModal, [{
|
|
73
67
|
key: "cancelButton",
|
|
74
68
|
value: function cancelButton() {
|
|
75
|
-
return
|
|
69
|
+
return jsx(Button, {
|
|
76
70
|
onClick: this.closeAction,
|
|
77
71
|
margin: XSMALL_SIDE_MARGIN
|
|
78
72
|
}, t('Cancel'));
|
|
@@ -80,7 +74,7 @@ export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
80
74
|
}, {
|
|
81
75
|
key: "doneButton",
|
|
82
76
|
value: function doneButton() {
|
|
83
|
-
return
|
|
77
|
+
return jsx(Button, {
|
|
84
78
|
color: "primary",
|
|
85
79
|
onClick: this.continueAction,
|
|
86
80
|
margin: XSMALL_SIDE_MARGIN
|
|
@@ -89,10 +83,10 @@ export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
89
83
|
}, {
|
|
90
84
|
key: "renderRichContentInput",
|
|
91
85
|
value: function renderRichContentInput(key, label) {
|
|
92
|
-
return
|
|
93
|
-
|
|
86
|
+
return jsx("div", null, _ref, jsx("label", {
|
|
87
|
+
css: this.props.styles.feedbackLabel,
|
|
94
88
|
htmlFor: key
|
|
95
|
-
}, label),
|
|
89
|
+
}, label), jsx(RichContentInput, {
|
|
96
90
|
label: "",
|
|
97
91
|
textareaId: key,
|
|
98
92
|
defaultContent: this.props.feedback.get(key),
|
|
@@ -103,15 +97,15 @@ export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
103
97
|
}, {
|
|
104
98
|
key: "renderContent",
|
|
105
99
|
value: function renderContent() {
|
|
106
|
-
return
|
|
107
|
-
customStyles: styles.itemStem,
|
|
100
|
+
return jsx("div", null, jsx(RichContentRendererEmotion, {
|
|
101
|
+
customStyles: this.props.styles.itemStem,
|
|
108
102
|
content: this.props.item.itemBody
|
|
109
103
|
}), this.renderRichContentInput('correct', t('For a correct answer')), this.renderRichContentInput('incorrect', t('For an incorrect answer')), this.renderRichContentInput('neutral', t('Provide general feedback (regardless of answer)')));
|
|
110
104
|
}
|
|
111
105
|
}, {
|
|
112
106
|
key: "render",
|
|
113
107
|
value: function render() {
|
|
114
|
-
return
|
|
108
|
+
return jsx("div", null, jsx(Modal, {
|
|
115
109
|
open: this.props.modalOpen || this.props.importModalOpen,
|
|
116
110
|
onClose: this.closeAction,
|
|
117
111
|
size: "large",
|
|
@@ -119,15 +113,15 @@ export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
119
113
|
shouldCloseOnDocumentClick: false // must be false to allow interacting with RCE modals (such as embed media)
|
|
120
114
|
,
|
|
121
115
|
shouldReturnFocus: false
|
|
122
|
-
},
|
|
116
|
+
}, jsx(ModalHeader, null, jsx(Heading, {
|
|
123
117
|
level: "reset",
|
|
124
118
|
as: "h2"
|
|
125
|
-
}, t('Student Feedback')),
|
|
119
|
+
}, t('Student Feedback')), jsx(CloseButton, {
|
|
126
120
|
onClick: this.closeAction,
|
|
127
121
|
placement: "end",
|
|
128
122
|
offset: "medium",
|
|
129
123
|
screenReaderLabel: t('Close')
|
|
130
|
-
})),
|
|
124
|
+
})), jsx(ModalBody, null, this.renderContent()), jsx(ModalFooter, null, this.cancelButton(), this.doneButton())));
|
|
131
125
|
}
|
|
132
126
|
}]);
|
|
133
127
|
|
|
@@ -141,7 +135,8 @@ export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
141
135
|
item: ImmutablePropTypes.record.isRequired,
|
|
142
136
|
modalOpen: PropTypes.bool.isRequired,
|
|
143
137
|
setUi: PropTypes.func.isRequired,
|
|
144
|
-
modalTrigger: PropTypes.instanceOf(Component)
|
|
138
|
+
modalTrigger: PropTypes.instanceOf(Component),
|
|
139
|
+
styles: PropTypes.object
|
|
145
140
|
}, _class2.defaultProps = {
|
|
146
141
|
modalTrigger: null
|
|
147
142
|
}, _temp)) || _class);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
itemStem: {
|
|
4
|
+
whiteSpace: 'nowrap',
|
|
5
|
+
overflow: 'hidden',
|
|
6
|
+
textOverflow: 'ellipsis'
|
|
7
|
+
},
|
|
8
|
+
feedbackLabel: {
|
|
9
|
+
fontSize: componentTheme.feedbackLabelFontSize
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default generateStyle;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var typography = _ref.typography;
|
|
3
3
|
return {
|
|
4
4
|
feedbackLabelFontSize: typography.fontSizeSmall
|
|
5
5
|
};
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default generateComponentTheme;
|