@instructure/quiz-core 20.36.1-rc.9 → 20.37.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/resources/quizEntry/QuizEntryEdit/Header/index.js +40 -22
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +1 -29
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +1 -5
- package/es/common/components/layout/Page/styles.js +1 -10
- package/es/common/components/resources/quiz/instructions/styles.js +3 -4
- package/es/common/components/resources/quiz/instructions/theme.js +1 -2
- package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +5 -6
- package/es/common/records/Stimulus.js +2 -1
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +39 -21
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +1 -29
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +1 -5
- package/lib/common/components/layout/Page/styles.js +1 -10
- package/lib/common/components/resources/quiz/instructions/styles.js +3 -4
- package/lib/common/components/resources/quiz/instructions/theme.js +1 -2
- package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +5 -6
- package/lib/common/records/Stimulus.js +2 -1
- package/package.json +30 -31
|
@@ -10,6 +10,7 @@ import { Component } from 'react';
|
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
12
12
|
import partial from 'lodash/partial';
|
|
13
|
+
import { Text } from '@instructure/ui-text';
|
|
13
14
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
14
15
|
import { CondensedButton } from '@instructure/ui-buttons';
|
|
15
16
|
import { jsx, Global } from '@instructure/emotion';
|
|
@@ -20,9 +21,10 @@ import { convertFITBtoRich } from "../../../../../../common/util/fitbCopyHelper.
|
|
|
20
21
|
import PositionBox from "../../../../../../common/components/resources/positionBox/PositionBox.js";
|
|
21
22
|
import Item from "../../../../../../common/records/Item.js";
|
|
22
23
|
import ActionButtons from "../../../ActionButtons/index.js";
|
|
23
|
-
import { DELETED_QUIZ_ENTRY, API_INPUT_VALIDATION_ERROR, BUILD_TRAY_OPEN, TextInput, withStyleOverrides } from '@instructure/quiz-common';
|
|
24
|
+
import { DELETED_QUIZ_ENTRY, API_INPUT_VALIDATION_ERROR, BUILD_TRAY_OPEN, Flex, TextInput, withStyleOverrides } from '@instructure/quiz-common';
|
|
24
25
|
import generateStyle from "./styles.js";
|
|
25
26
|
import generateComponentTheme from "./theme.js";
|
|
27
|
+
import { View } from '@instructure/ui-view';
|
|
26
28
|
var _ref2 = jsx(IconBankLine, null);
|
|
27
29
|
var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_QuizEntryHeader = /*#__PURE__*/function (_Component) {
|
|
28
30
|
_inherits(QuizEntryHeader, _Component);
|
|
@@ -181,16 +183,19 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
181
183
|
}, {
|
|
182
184
|
key: "renderName",
|
|
183
185
|
value: function renderName() {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
var isBank = this.props.quizEntry.isBank && this.props.newActiveBank;
|
|
187
|
+
var dataAutomation = 'sdk-quiz-entry-interaction-type';
|
|
188
|
+
if (!isBank) {
|
|
189
|
+
return jsx(Text, {
|
|
186
190
|
size: "small",
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
"data-automation": "sdk-quiz-entry-interaction-type"
|
|
191
|
+
weight: "normal",
|
|
192
|
+
"data-automation": dataAutomation
|
|
190
193
|
}, this.props.name);
|
|
191
194
|
}
|
|
192
|
-
return jsx(
|
|
193
|
-
|
|
195
|
+
return jsx(CondensedButton, {
|
|
196
|
+
size: "small",
|
|
197
|
+
margin: "0 0 0 x-small",
|
|
198
|
+
onClick: this.handleBankClick,
|
|
194
199
|
"data-automation": "sdk-quiz-entry-interaction-type"
|
|
195
200
|
}, this.props.name);
|
|
196
201
|
}
|
|
@@ -210,20 +215,22 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
210
215
|
questionNumber: displayPosition,
|
|
211
216
|
interactionType: entry.getInteractionType().name
|
|
212
217
|
});
|
|
213
|
-
return jsx(
|
|
214
|
-
css: this.props.styles.titleHolder
|
|
215
|
-
}, jsx("span", {
|
|
216
|
-
css: this.props.styles.titleInput
|
|
217
|
-
}, jsx(TextInput, {
|
|
218
|
+
return jsx(TextInput, {
|
|
218
219
|
ref: this.storeTitleRef,
|
|
219
|
-
renderLabel: jsx(
|
|
220
|
+
renderLabel: jsx(Flex, {
|
|
221
|
+
direction: "column",
|
|
222
|
+
gap: "small"
|
|
223
|
+
}, jsx(Flex.Item, {
|
|
224
|
+
"aria-hidden": true
|
|
225
|
+
}, this.renderName()), jsx(Flex.Item, {
|
|
226
|
+
"aria-hidden": true
|
|
227
|
+
}, t('Question Title')), jsx(ScreenReaderContent, null, titleLabelText)),
|
|
220
228
|
type: "text",
|
|
221
|
-
placeholder: t('Question Title'),
|
|
222
229
|
onChange: this.handleTitleChange,
|
|
223
230
|
value: workingEntry.title || '',
|
|
224
231
|
interaction: disabled ? 'disabled' : 'enabled',
|
|
225
232
|
"data-automation": "sdk-question-title-textinput"
|
|
226
|
-
})
|
|
233
|
+
});
|
|
227
234
|
}
|
|
228
235
|
}, {
|
|
229
236
|
key: "renderLeftHeader",
|
|
@@ -232,14 +239,16 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
232
239
|
position: this.props.displayPosition
|
|
233
240
|
});
|
|
234
241
|
var position = this.props.disabledForRegrade ? this.props.displayPosition : this.props.quizEntry.positionToDisplay(this.props.displayPosition);
|
|
235
|
-
return jsx(
|
|
242
|
+
return jsx(Flex, {
|
|
236
243
|
className: "leftHeader",
|
|
237
|
-
|
|
244
|
+
direction: "row",
|
|
245
|
+
justifyItems: "center",
|
|
246
|
+
"data-automation": "sdk-quiz-entry-left-header"
|
|
238
247
|
}, jsx(PositionBox, {
|
|
239
248
|
position: position,
|
|
240
249
|
headingText: positionText,
|
|
241
250
|
"data-automation": "sdk-quiz-entry-positionbox"
|
|
242
|
-
}), this.renderBankedContent(),
|
|
251
|
+
}), this.renderBankedContent(), jsx("div", {
|
|
243
252
|
css: this.props.styles.dividingLine
|
|
244
253
|
}), this.renderTitleHolder());
|
|
245
254
|
}
|
|
@@ -259,12 +268,21 @@ var QuizEntryHeader = (_dec = withStyleOverrides(generateStyle, generateComponen
|
|
|
259
268
|
shouldDisableDeleteButton: this.props.disabledForRegrade,
|
|
260
269
|
shouldRenderEdit: false
|
|
261
270
|
};
|
|
262
|
-
return jsx(
|
|
271
|
+
return jsx(View, {
|
|
272
|
+
as: "div",
|
|
263
273
|
className: "header",
|
|
264
|
-
|
|
274
|
+
background: "secondary",
|
|
275
|
+
padding: "small"
|
|
265
276
|
}, jsx(Global, {
|
|
266
277
|
styles: this.props.styles.globalStyles
|
|
267
|
-
}),
|
|
278
|
+
}), jsx(Flex, {
|
|
279
|
+
className: "header",
|
|
280
|
+
direction: "row",
|
|
281
|
+
gap: "small"
|
|
282
|
+
}, jsx(Flex.Item, {
|
|
283
|
+
shouldShrink: false,
|
|
284
|
+
shouldGrow: true
|
|
285
|
+
}, this.renderLeftHeader()), jsx(Flex.Item, null, jsx(ActionButtons, actionButtonProps))));
|
|
268
286
|
}
|
|
269
287
|
}]);
|
|
270
288
|
QuizEntryHeader.displayName = "QuizEntryHeader";
|
|
@@ -8,39 +8,11 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
8
8
|
},
|
|
9
9
|
header: {
|
|
10
10
|
backgroundColor: componentTheme.headerBackgroundColor,
|
|
11
|
-
color: componentTheme.headerColor
|
|
12
|
-
padding: componentTheme.headerPadding,
|
|
13
|
-
display: 'flex',
|
|
14
|
-
justifyContent: 'space-between',
|
|
15
|
-
verticalAlign: 'middle',
|
|
16
|
-
alignItems: 'center'
|
|
17
|
-
},
|
|
18
|
-
leftHeader: {
|
|
19
|
-
flex: '8 0 0',
|
|
20
|
-
display: 'inline-flex',
|
|
21
|
-
flexWrap: 'nowrap',
|
|
22
|
-
alignItems: 'center',
|
|
23
|
-
/* fix for ie11 */
|
|
24
|
-
width: '100%'
|
|
25
|
-
},
|
|
26
|
-
interactionType: {
|
|
27
|
-
fontSize: componentTheme.interactionTypeFontSize,
|
|
28
|
-
marginLeft: componentTheme.interactionTypeLeftMargin,
|
|
29
|
-
marginRight: componentTheme.interactionTypeRightMargin
|
|
11
|
+
color: componentTheme.headerColor
|
|
30
12
|
},
|
|
31
13
|
dividingLine: {
|
|
32
14
|
width: '0',
|
|
33
15
|
borderLeft: componentTheme.dividingLineLeftBorder
|
|
34
|
-
},
|
|
35
|
-
titleHolder: {
|
|
36
|
-
display: 'flex',
|
|
37
|
-
flex: '1 1 auto'
|
|
38
|
-
},
|
|
39
|
-
titleInput: {
|
|
40
|
-
flex: '1 1 auto',
|
|
41
|
-
fontSize: componentTheme.titleInputFontSize,
|
|
42
|
-
whiteSpace: 'nowrap',
|
|
43
|
-
textOverflow: 'ellipsis'
|
|
44
16
|
}
|
|
45
17
|
};
|
|
46
18
|
};
|
|
@@ -5,11 +5,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
5
5
|
return {
|
|
6
6
|
headerBackgroundColor: colors.porcelain,
|
|
7
7
|
headerColor: colors.oxford,
|
|
8
|
-
headerPadding: "".concat(spacing.xSmall, " ").concat(spacing.small)
|
|
9
|
-
interactionTypeFontSize: typography.fontSizeSmall,
|
|
10
|
-
interactionTypeLeftMargin: spacing.xSmall,
|
|
11
|
-
interactionTypeRightMargin: spacing.xSmall,
|
|
12
|
-
titleInputFontSize: typography.fontSizeMedium
|
|
8
|
+
headerPadding: "".concat(spacing.xSmall, " ").concat(spacing.small)
|
|
13
9
|
};
|
|
14
10
|
};
|
|
15
11
|
export default generateComponentTheme;
|
|
@@ -17,16 +17,7 @@ var generateStyle = function generateStyle(componentTheme, props) {
|
|
|
17
17
|
overflowY: 'auto'
|
|
18
18
|
}), {}, {
|
|
19
19
|
transition: componentTheme.contentTransition,
|
|
20
|
-
width: '100%'
|
|
21
|
-
'.user_content p': {
|
|
22
|
-
margin: "".concat(componentTheme.userContentMargin, " 0"),
|
|
23
|
-
'&:first-of-type': {
|
|
24
|
-
marginTop: componentTheme.userContentZeroMargin
|
|
25
|
-
},
|
|
26
|
-
'&:last-child': {
|
|
27
|
-
marginBottom: componentTheme.userContentZeroMargin
|
|
28
|
-
}
|
|
29
|
-
}
|
|
20
|
+
width: '100%'
|
|
30
21
|
})
|
|
31
22
|
};
|
|
32
23
|
};
|
|
@@ -4,8 +4,7 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
4
4
|
position: 'relative',
|
|
5
5
|
width: '100%',
|
|
6
6
|
boxSizing: 'border-box',
|
|
7
|
-
|
|
8
|
-
paddingRight: componentTheme.wrapperPadding,
|
|
7
|
+
padding: "0 ".concat(componentTheme.wrapperPadding, " ").concat(componentTheme.wrapperPadding),
|
|
9
8
|
'&::after': {
|
|
10
9
|
clear: 'both',
|
|
11
10
|
content: '""',
|
|
@@ -14,10 +13,10 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
14
13
|
'.user_content p': {
|
|
15
14
|
margin: "".concat(componentTheme.userContentMargin, " 0"),
|
|
16
15
|
'&:first-of-type': {
|
|
17
|
-
|
|
16
|
+
margin: "0 0 ".concat(componentTheme.userContentMargin)
|
|
18
17
|
},
|
|
19
18
|
'&:last-child': {
|
|
20
|
-
|
|
19
|
+
margin: "".concat(componentTheme.userContentMargin, " 0 0")
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
22
|
},
|
|
@@ -4,8 +4,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
4
4
|
return {
|
|
5
5
|
wrapperPadding: spacing.large,
|
|
6
6
|
textFontSize: typography.fontSizeMedium,
|
|
7
|
-
userContentMargin: spacing.mediumSmall
|
|
8
|
-
userContentZeroMargin: 0
|
|
7
|
+
userContentMargin: spacing.mediumSmall
|
|
9
8
|
};
|
|
10
9
|
};
|
|
11
10
|
export default generateComponentTheme;
|
|
@@ -8,14 +8,13 @@ import { Component } from 'react';
|
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
10
10
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
11
|
-
import { FormField } from '@instructure/ui-form-field';
|
|
12
11
|
import { jsx } from '@instructure/emotion';
|
|
13
12
|
import { Heading } from '@instructure/ui-heading';
|
|
14
13
|
import { RichContentInput, RCE_SINGLE_LINE_HEIGHT } from '@instructure/quiz-rce';
|
|
15
14
|
import { toErrors } from "../../../../util/instUIMessages.js";
|
|
16
15
|
import { IconUpdownLine } from '@instructure/ui-icons';
|
|
17
16
|
import { ToggleDetails } from '@instructure/ui-toggle-details';
|
|
18
|
-
import { SimpleSelect, TextInput, TOP, withStyleOverrides, FormFieldGroup } from '@instructure/quiz-common';
|
|
17
|
+
import { SimpleSelect, TextInput, TOP, withStyleOverrides, FormFieldGroup, FormField } from '@instructure/quiz-common';
|
|
19
18
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
20
19
|
import generateStyle from "./styles.js";
|
|
21
20
|
import generateComponentTheme from "./theme.js";
|
|
@@ -110,6 +109,7 @@ export var StimulusEditInfo = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
110
109
|
}, jsx(TextInput, {
|
|
111
110
|
messages: this.inputErrors('title'),
|
|
112
111
|
renderLabel: t('Title'),
|
|
112
|
+
isRequired: true,
|
|
113
113
|
type: "text",
|
|
114
114
|
ref: this.props.setTitleRef,
|
|
115
115
|
onChange: this.onTextInputChange('title'),
|
|
@@ -126,13 +126,12 @@ export var StimulusEditInfo = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
126
126
|
})), jsx("div", {
|
|
127
127
|
css: this.props.styles.section
|
|
128
128
|
}, jsx(FormField, {
|
|
129
|
-
id: stimulusBodyId
|
|
130
|
-
label: t('Content')
|
|
129
|
+
id: stimulusBodyId
|
|
131
130
|
}, jsx(RichContentInput, {
|
|
132
131
|
actsAsInput: true,
|
|
133
|
-
label:
|
|
132
|
+
label: t('Content'),
|
|
133
|
+
isRequired: true,
|
|
134
134
|
messages: this.inputErrors('body'),
|
|
135
|
-
placeholder: t('Add Stimulus Content...'),
|
|
136
135
|
textareaId: textAreaId,
|
|
137
136
|
defaultContent: stimulus.get('body'),
|
|
138
137
|
onKeyUp: this.onBodyChange,
|
|
@@ -15,6 +15,7 @@ var _react = require("react");
|
|
|
15
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
16
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
17
17
|
var _partial = _interopRequireDefault(require("lodash/partial"));
|
|
18
|
+
var _uiText = require("@instructure/ui-text");
|
|
18
19
|
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
19
20
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
20
21
|
var _emotion = require("@instructure/emotion");
|
|
@@ -28,6 +29,7 @@ var _index = _interopRequireDefault(require("../../../ActionButtons/index.js"));
|
|
|
28
29
|
var _quizCommon = require("@instructure/quiz-common");
|
|
29
30
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
30
31
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
32
|
+
var _uiView = require("@instructure/ui-view");
|
|
31
33
|
var _dec, _class, _QuizEntryHeader;
|
|
32
34
|
/** @jsx jsx */
|
|
33
35
|
var _ref2 = (0, _emotion.jsx)(_uiIcons.IconBankLine, null);
|
|
@@ -188,16 +190,19 @@ var QuizEntryHeader = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defaul
|
|
|
188
190
|
}, {
|
|
189
191
|
key: "renderName",
|
|
190
192
|
value: function renderName() {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
+
var isBank = this.props.quizEntry.isBank && this.props.newActiveBank;
|
|
194
|
+
var dataAutomation = 'sdk-quiz-entry-interaction-type';
|
|
195
|
+
if (!isBank) {
|
|
196
|
+
return (0, _emotion.jsx)(_uiText.Text, {
|
|
193
197
|
size: "small",
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
"data-automation": "sdk-quiz-entry-interaction-type"
|
|
198
|
+
weight: "normal",
|
|
199
|
+
"data-automation": dataAutomation
|
|
197
200
|
}, this.props.name);
|
|
198
201
|
}
|
|
199
|
-
return (0, _emotion.jsx)(
|
|
200
|
-
|
|
202
|
+
return (0, _emotion.jsx)(_uiButtons.CondensedButton, {
|
|
203
|
+
size: "small",
|
|
204
|
+
margin: "0 0 0 x-small",
|
|
205
|
+
onClick: this.handleBankClick,
|
|
201
206
|
"data-automation": "sdk-quiz-entry-interaction-type"
|
|
202
207
|
}, this.props.name);
|
|
203
208
|
}
|
|
@@ -217,20 +222,22 @@ var QuizEntryHeader = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defaul
|
|
|
217
222
|
questionNumber: displayPosition,
|
|
218
223
|
interactionType: entry.getInteractionType().name
|
|
219
224
|
});
|
|
220
|
-
return (0, _emotion.jsx)(
|
|
221
|
-
css: this.props.styles.titleHolder
|
|
222
|
-
}, (0, _emotion.jsx)("span", {
|
|
223
|
-
css: this.props.styles.titleInput
|
|
224
|
-
}, (0, _emotion.jsx)(_quizCommon.TextInput, {
|
|
225
|
+
return (0, _emotion.jsx)(_quizCommon.TextInput, {
|
|
225
226
|
ref: this.storeTitleRef,
|
|
226
|
-
renderLabel: (0, _emotion.jsx)(
|
|
227
|
+
renderLabel: (0, _emotion.jsx)(_quizCommon.Flex, {
|
|
228
|
+
direction: "column",
|
|
229
|
+
gap: "small"
|
|
230
|
+
}, (0, _emotion.jsx)(_quizCommon.Flex.Item, {
|
|
231
|
+
"aria-hidden": true
|
|
232
|
+
}, this.renderName()), (0, _emotion.jsx)(_quizCommon.Flex.Item, {
|
|
233
|
+
"aria-hidden": true
|
|
234
|
+
}, (0, _formatMessage.default)('Question Title')), (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, titleLabelText)),
|
|
227
235
|
type: "text",
|
|
228
|
-
placeholder: (0, _formatMessage.default)('Question Title'),
|
|
229
236
|
onChange: this.handleTitleChange,
|
|
230
237
|
value: workingEntry.title || '',
|
|
231
238
|
interaction: disabled ? 'disabled' : 'enabled',
|
|
232
239
|
"data-automation": "sdk-question-title-textinput"
|
|
233
|
-
})
|
|
240
|
+
});
|
|
234
241
|
}
|
|
235
242
|
}, {
|
|
236
243
|
key: "renderLeftHeader",
|
|
@@ -239,14 +246,16 @@ var QuizEntryHeader = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defaul
|
|
|
239
246
|
position: this.props.displayPosition
|
|
240
247
|
});
|
|
241
248
|
var position = this.props.disabledForRegrade ? this.props.displayPosition : this.props.quizEntry.positionToDisplay(this.props.displayPosition);
|
|
242
|
-
return (0, _emotion.jsx)(
|
|
249
|
+
return (0, _emotion.jsx)(_quizCommon.Flex, {
|
|
243
250
|
className: "leftHeader",
|
|
244
|
-
|
|
251
|
+
direction: "row",
|
|
252
|
+
justifyItems: "center",
|
|
253
|
+
"data-automation": "sdk-quiz-entry-left-header"
|
|
245
254
|
}, (0, _emotion.jsx)(_PositionBox.default, {
|
|
246
255
|
position: position,
|
|
247
256
|
headingText: positionText,
|
|
248
257
|
"data-automation": "sdk-quiz-entry-positionbox"
|
|
249
|
-
}), this.renderBankedContent(),
|
|
258
|
+
}), this.renderBankedContent(), (0, _emotion.jsx)("div", {
|
|
250
259
|
css: this.props.styles.dividingLine
|
|
251
260
|
}), this.renderTitleHolder());
|
|
252
261
|
}
|
|
@@ -266,12 +275,21 @@ var QuizEntryHeader = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defaul
|
|
|
266
275
|
shouldDisableDeleteButton: this.props.disabledForRegrade,
|
|
267
276
|
shouldRenderEdit: false
|
|
268
277
|
};
|
|
269
|
-
return (0, _emotion.jsx)(
|
|
278
|
+
return (0, _emotion.jsx)(_uiView.View, {
|
|
279
|
+
as: "div",
|
|
270
280
|
className: "header",
|
|
271
|
-
|
|
281
|
+
background: "secondary",
|
|
282
|
+
padding: "small"
|
|
272
283
|
}, (0, _emotion.jsx)(_emotion.Global, {
|
|
273
284
|
styles: this.props.styles.globalStyles
|
|
274
|
-
}),
|
|
285
|
+
}), (0, _emotion.jsx)(_quizCommon.Flex, {
|
|
286
|
+
className: "header",
|
|
287
|
+
direction: "row",
|
|
288
|
+
gap: "small"
|
|
289
|
+
}, (0, _emotion.jsx)(_quizCommon.Flex.Item, {
|
|
290
|
+
shouldShrink: false,
|
|
291
|
+
shouldGrow: true
|
|
292
|
+
}, this.renderLeftHeader()), (0, _emotion.jsx)(_quizCommon.Flex.Item, null, (0, _emotion.jsx)(_index.default, actionButtonProps))));
|
|
275
293
|
}
|
|
276
294
|
}]);
|
|
277
295
|
QuizEntryHeader.displayName = "QuizEntryHeader";
|
|
@@ -14,39 +14,11 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
14
14
|
},
|
|
15
15
|
header: {
|
|
16
16
|
backgroundColor: componentTheme.headerBackgroundColor,
|
|
17
|
-
color: componentTheme.headerColor
|
|
18
|
-
padding: componentTheme.headerPadding,
|
|
19
|
-
display: 'flex',
|
|
20
|
-
justifyContent: 'space-between',
|
|
21
|
-
verticalAlign: 'middle',
|
|
22
|
-
alignItems: 'center'
|
|
23
|
-
},
|
|
24
|
-
leftHeader: {
|
|
25
|
-
flex: '8 0 0',
|
|
26
|
-
display: 'inline-flex',
|
|
27
|
-
flexWrap: 'nowrap',
|
|
28
|
-
alignItems: 'center',
|
|
29
|
-
/* fix for ie11 */
|
|
30
|
-
width: '100%'
|
|
31
|
-
},
|
|
32
|
-
interactionType: {
|
|
33
|
-
fontSize: componentTheme.interactionTypeFontSize,
|
|
34
|
-
marginLeft: componentTheme.interactionTypeLeftMargin,
|
|
35
|
-
marginRight: componentTheme.interactionTypeRightMargin
|
|
17
|
+
color: componentTheme.headerColor
|
|
36
18
|
},
|
|
37
19
|
dividingLine: {
|
|
38
20
|
width: '0',
|
|
39
21
|
borderLeft: componentTheme.dividingLineLeftBorder
|
|
40
|
-
},
|
|
41
|
-
titleHolder: {
|
|
42
|
-
display: 'flex',
|
|
43
|
-
flex: '1 1 auto'
|
|
44
|
-
},
|
|
45
|
-
titleInput: {
|
|
46
|
-
flex: '1 1 auto',
|
|
47
|
-
fontSize: componentTheme.titleInputFontSize,
|
|
48
|
-
whiteSpace: 'nowrap',
|
|
49
|
-
textOverflow: 'ellipsis'
|
|
50
22
|
}
|
|
51
23
|
};
|
|
52
24
|
};
|
|
@@ -11,11 +11,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
11
11
|
return {
|
|
12
12
|
headerBackgroundColor: colors.porcelain,
|
|
13
13
|
headerColor: colors.oxford,
|
|
14
|
-
headerPadding: "".concat(spacing.xSmall, " ").concat(spacing.small)
|
|
15
|
-
interactionTypeFontSize: typography.fontSizeSmall,
|
|
16
|
-
interactionTypeLeftMargin: spacing.xSmall,
|
|
17
|
-
interactionTypeRightMargin: spacing.xSmall,
|
|
18
|
-
titleInputFontSize: typography.fontSizeMedium
|
|
14
|
+
headerPadding: "".concat(spacing.xSmall, " ").concat(spacing.small)
|
|
19
15
|
};
|
|
20
16
|
};
|
|
21
17
|
var _default = generateComponentTheme;
|
|
@@ -24,16 +24,7 @@ var generateStyle = function generateStyle(componentTheme, props) {
|
|
|
24
24
|
overflowY: 'auto'
|
|
25
25
|
}), {}, {
|
|
26
26
|
transition: componentTheme.contentTransition,
|
|
27
|
-
width: '100%'
|
|
28
|
-
'.user_content p': {
|
|
29
|
-
margin: "".concat(componentTheme.userContentMargin, " 0"),
|
|
30
|
-
'&:first-of-type': {
|
|
31
|
-
marginTop: componentTheme.userContentZeroMargin
|
|
32
|
-
},
|
|
33
|
-
'&:last-child': {
|
|
34
|
-
marginBottom: componentTheme.userContentZeroMargin
|
|
35
|
-
}
|
|
36
|
-
}
|
|
27
|
+
width: '100%'
|
|
37
28
|
})
|
|
38
29
|
};
|
|
39
30
|
};
|
|
@@ -10,8 +10,7 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
10
10
|
position: 'relative',
|
|
11
11
|
width: '100%',
|
|
12
12
|
boxSizing: 'border-box',
|
|
13
|
-
|
|
14
|
-
paddingRight: componentTheme.wrapperPadding,
|
|
13
|
+
padding: "0 ".concat(componentTheme.wrapperPadding, " ").concat(componentTheme.wrapperPadding),
|
|
15
14
|
'&::after': {
|
|
16
15
|
clear: 'both',
|
|
17
16
|
content: '""',
|
|
@@ -20,10 +19,10 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
20
19
|
'.user_content p': {
|
|
21
20
|
margin: "".concat(componentTheme.userContentMargin, " 0"),
|
|
22
21
|
'&:first-of-type': {
|
|
23
|
-
|
|
22
|
+
margin: "0 0 ".concat(componentTheme.userContentMargin)
|
|
24
23
|
},
|
|
25
24
|
'&:last-child': {
|
|
26
|
-
|
|
25
|
+
margin: "".concat(componentTheme.userContentMargin, " 0 0")
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
},
|
|
@@ -10,8 +10,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
10
10
|
return {
|
|
11
11
|
wrapperPadding: spacing.large,
|
|
12
12
|
textFontSize: typography.fontSizeMedium,
|
|
13
|
-
userContentMargin: spacing.mediumSmall
|
|
14
|
-
userContentZeroMargin: 0
|
|
13
|
+
userContentMargin: spacing.mediumSmall
|
|
15
14
|
};
|
|
16
15
|
};
|
|
17
16
|
var _default = generateComponentTheme;
|
|
@@ -13,7 +13,6 @@ var _react = require("react");
|
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
15
15
|
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
16
|
-
var _uiFormField = require("@instructure/ui-form-field");
|
|
17
16
|
var _emotion = require("@instructure/emotion");
|
|
18
17
|
var _uiHeading = require("@instructure/ui-heading");
|
|
19
18
|
var _quizRce = require("@instructure/quiz-rce");
|
|
@@ -117,6 +116,7 @@ var StimulusEditInfo = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defau
|
|
|
117
116
|
}, (0, _emotion.jsx)(_quizCommon.TextInput, {
|
|
118
117
|
messages: this.inputErrors('title'),
|
|
119
118
|
renderLabel: (0, _formatMessage.default)('Title'),
|
|
119
|
+
isRequired: true,
|
|
120
120
|
type: "text",
|
|
121
121
|
ref: this.props.setTitleRef,
|
|
122
122
|
onChange: this.onTextInputChange('title'),
|
|
@@ -132,14 +132,13 @@ var StimulusEditInfo = (_dec = (0, _quizCommon.withStyleOverrides)(_styles.defau
|
|
|
132
132
|
"data-automation": "sdk-stimulus-instructions-input"
|
|
133
133
|
})), (0, _emotion.jsx)("div", {
|
|
134
134
|
css: this.props.styles.section
|
|
135
|
-
}, (0, _emotion.jsx)(
|
|
136
|
-
id: stimulusBodyId
|
|
137
|
-
label: (0, _formatMessage.default)('Content')
|
|
135
|
+
}, (0, _emotion.jsx)(_quizCommon.FormField, {
|
|
136
|
+
id: stimulusBodyId
|
|
138
137
|
}, (0, _emotion.jsx)(_quizRce.RichContentInput, {
|
|
139
138
|
actsAsInput: true,
|
|
140
|
-
label:
|
|
139
|
+
label: (0, _formatMessage.default)('Content'),
|
|
140
|
+
isRequired: true,
|
|
141
141
|
messages: this.inputErrors('body'),
|
|
142
|
-
placeholder: (0, _formatMessage.default)('Add Stimulus Content...'),
|
|
143
142
|
textareaId: textAreaId,
|
|
144
143
|
defaultContent: stimulus.get('body'),
|
|
145
144
|
onKeyUp: this.onBodyChange,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.37.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -10,27 +10,6 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://gerrit.instructure.com/quizzes-ui.git"
|
|
12
12
|
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"clean": "ui-build --clean",
|
|
15
|
-
"build": "build-if-changed",
|
|
16
|
-
"build:all": "ui-build --modules es,cjs",
|
|
17
|
-
"build:watch": "ui-build --watch",
|
|
18
|
-
"extract": "extract-translations",
|
|
19
|
-
"lint": "ui-test --lint",
|
|
20
|
-
"lint:fix": "ui-test --lint --fix",
|
|
21
|
-
"eslint:fix": "eslint --fix .",
|
|
22
|
-
"prelint": "pnpm build",
|
|
23
|
-
"pretest": "pnpm build",
|
|
24
|
-
"test": "pnpm test:karma",
|
|
25
|
-
"test:karma": "ui-test",
|
|
26
|
-
"test:watch": "ui-test --watch",
|
|
27
|
-
"snyk:monitor": "snyk monitor",
|
|
28
|
-
"postbuild": "cp src/banks/components/noResults.svg lib/banks/components/; cp src/banks/components/noResults.svg es/banks/components/; pnpm postbuild:errorImage",
|
|
29
|
-
"postbuild:all": "pnpm postbuild",
|
|
30
|
-
"postbuild:errorImage": "cp src/reporting/components/resources/NewQuizAndItemAnalysis/downForRepair.svg es/reporting/components/resources/NewQuizAndItemAnalysis/; cp src/reporting/components/resources/NewQuizAndItemAnalysis/downForRepair.svg lib/reporting/components/resources/NewQuizAndItemAnalysis/",
|
|
31
|
-
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
32
|
-
"typecheck": "tsc --noEmit"
|
|
33
|
-
},
|
|
34
13
|
"keywords": [
|
|
35
14
|
"react",
|
|
36
15
|
"react-component",
|
|
@@ -46,11 +25,11 @@
|
|
|
46
25
|
"@instructure/emotion": "^8.56.3",
|
|
47
26
|
"@instructure/grading-utils": "^1.0.0",
|
|
48
27
|
"@instructure/outcomes-ui": "^3.2.2",
|
|
49
|
-
"@instructure/quiz-common": "^20.
|
|
50
|
-
"@instructure/quiz-i18n": "^20.
|
|
51
|
-
"@instructure/quiz-interactions": "^20.
|
|
52
|
-
"@instructure/quiz-number-input": "^20.
|
|
53
|
-
"@instructure/quiz-rce": "^20.
|
|
28
|
+
"@instructure/quiz-common": "^20.37.1",
|
|
29
|
+
"@instructure/quiz-i18n": "^20.37.1",
|
|
30
|
+
"@instructure/quiz-interactions": "^20.37.1",
|
|
31
|
+
"@instructure/quiz-number-input": "^20.37.1",
|
|
32
|
+
"@instructure/quiz-rce": "^20.37.1",
|
|
54
33
|
"@instructure/ui-a11y-content": "^8.56.3",
|
|
55
34
|
"@instructure/ui-alerts": "^8.56.3",
|
|
56
35
|
"@instructure/ui-avatar": "^8.56.3",
|
|
@@ -114,7 +93,7 @@
|
|
|
114
93
|
"file-saver": "~2.0.5",
|
|
115
94
|
"humps": "^2.0.0",
|
|
116
95
|
"immutable": "^3.8.1",
|
|
117
|
-
"instructure-validations": "^20.
|
|
96
|
+
"instructure-validations": "^20.37.1",
|
|
118
97
|
"ipaddr.js": "^1.5.4",
|
|
119
98
|
"isomorphic-fetch": "^2.2.0",
|
|
120
99
|
"isuuid": "^0.1.0",
|
|
@@ -164,7 +143,7 @@
|
|
|
164
143
|
"jquery": "^2.2.3",
|
|
165
144
|
"karma-junit-reporter": "^2.0.1",
|
|
166
145
|
"most-subject": "^5.3.0",
|
|
167
|
-
"quiz-presets": "^20.
|
|
146
|
+
"quiz-presets": "^20.37.1",
|
|
168
147
|
"react": "^16.8.6",
|
|
169
148
|
"react-addons-test-utils": "^15.6.2",
|
|
170
149
|
"react-dom": "^16.8.6",
|
|
@@ -180,5 +159,25 @@
|
|
|
180
159
|
"publishConfig": {
|
|
181
160
|
"access": "public"
|
|
182
161
|
},
|
|
183
|
-
"
|
|
184
|
-
|
|
162
|
+
"scripts": {
|
|
163
|
+
"clean": "ui-build --clean",
|
|
164
|
+
"build": "build-if-changed",
|
|
165
|
+
"build:all": "ui-build --modules es,cjs",
|
|
166
|
+
"build:watch": "ui-build --watch",
|
|
167
|
+
"extract": "extract-translations",
|
|
168
|
+
"lint": "ui-test --lint",
|
|
169
|
+
"lint:fix": "ui-test --lint --fix",
|
|
170
|
+
"eslint:fix": "eslint --fix .",
|
|
171
|
+
"prelint": "pnpm build",
|
|
172
|
+
"pretest": "pnpm build",
|
|
173
|
+
"test": "pnpm test:karma",
|
|
174
|
+
"test:karma": "ui-test",
|
|
175
|
+
"test:watch": "ui-test --watch",
|
|
176
|
+
"snyk:monitor": "snyk monitor",
|
|
177
|
+
"postbuild": "cp src/banks/components/noResults.svg lib/banks/components/; cp src/banks/components/noResults.svg es/banks/components/; pnpm postbuild:errorImage",
|
|
178
|
+
"postbuild:all": "pnpm postbuild",
|
|
179
|
+
"postbuild:errorImage": "cp src/reporting/components/resources/NewQuizAndItemAnalysis/downForRepair.svg es/reporting/components/resources/NewQuizAndItemAnalysis/; cp src/reporting/components/resources/NewQuizAndItemAnalysis/downForRepair.svg lib/reporting/components/resources/NewQuizAndItemAnalysis/",
|
|
180
|
+
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
181
|
+
"typecheck": "tsc --noEmit"
|
|
182
|
+
}
|
|
183
|
+
}
|