@instructure/quiz-core 20.10.1-rc.5 → 20.10.1-rc.7
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/banks/components/Banks/index.js +3 -1
- package/es/banks/components/Banks/presenter.js +30 -8
- package/es/common/components/ImportModal/presenter.js +29 -33
- package/es/common/components/ImportModal/styles.js +9 -0
- package/es/common/components/ImportModal/theme.js +4 -2
- package/es/common/components/SDKApp/index.js +13 -17
- package/es/common/components/SDKApp/styles.js +9 -0
- package/es/common/components/resources/stimulus/StimulusShow/index.js +26 -32
- package/es/common/components/resources/stimulus/StimulusShow/styles.js +33 -0
- package/es/common/components/resources/stimulus/StimulusShow/theme.js +4 -2
- package/lib/banks/components/Banks/index.js +3 -1
- package/lib/banks/components/Banks/presenter.js +30 -8
- package/lib/common/components/ImportModal/presenter.js +28 -34
- package/lib/common/components/ImportModal/styles.js +17 -0
- package/lib/common/components/ImportModal/theme.js +6 -3
- package/lib/common/components/SDKApp/index.js +11 -20
- package/lib/common/components/SDKApp/styles.js +17 -0
- package/lib/common/components/resources/stimulus/StimulusShow/index.js +26 -36
- package/lib/common/components/resources/stimulus/StimulusShow/styles.js +41 -0
- package/lib/common/components/resources/stimulus/StimulusShow/theme.js +6 -3
- package/package.json +9 -9
- package/es/common/components/SDKApp/theme.js +0 -3
- package/lib/common/components/SDKApp/theme.js +0 -10
|
@@ -16,6 +16,7 @@ function mapStateToProps(state, props) {
|
|
|
16
16
|
var sortOrder = pageData.get('sortOrder', 'ascending');
|
|
17
17
|
var searchTerms = pageData.get('searchTerms', null);
|
|
18
18
|
var searchSelection = pageData.get('searchSelection', []);
|
|
19
|
+
var rootAccountUuid = state.getIn(['outcomes', 'contextUuid']);
|
|
19
20
|
return {
|
|
20
21
|
itemBankSearchTableEnabled: featureOn('item_bank_search_table'),
|
|
21
22
|
improvedBankSharingEnabled: featureOn('improved_bank_sharing'),
|
|
@@ -26,7 +27,8 @@ function mapStateToProps(state, props) {
|
|
|
26
27
|
sortBy: sortBy,
|
|
27
28
|
sortOrder: sortOrder,
|
|
28
29
|
searchTerms: searchTerms,
|
|
29
|
-
searchSelection: searchSelection
|
|
30
|
+
searchSelection: searchSelection,
|
|
31
|
+
rootAccountUuid: rootAccountUuid
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -55,6 +55,10 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
55
55
|
|
|
56
56
|
_this = _super.apply(this, arguments);
|
|
57
57
|
|
|
58
|
+
_this.hideAccountSearch = function () {
|
|
59
|
+
return _this.props.scopeType === 'account' && _this.props.scope.type === 'account' && _this.props.scope.launch_context_uuid && _this.props.rootAccountUuid && _this.props.scope.launch_context_uuid !== _this.props.rootAccountUuid;
|
|
60
|
+
};
|
|
61
|
+
|
|
58
62
|
_this.onCreateBank = function () {
|
|
59
63
|
_this.props.createBank({
|
|
60
64
|
language: _this.context.locale
|
|
@@ -94,7 +98,9 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
94
98
|
params['search'] = _this.props.searchTerms;
|
|
95
99
|
}
|
|
96
100
|
|
|
97
|
-
if (_this.props.
|
|
101
|
+
if (_this.props.subAccountBankSharingEnabled && _this.hideAccountSearch()) {
|
|
102
|
+
params['account_uuids'] = [_this.props.scope.launch_context_uuid];
|
|
103
|
+
} else if (_this.props.searchSelection.length > 0) {
|
|
98
104
|
params['account_uuids'] = _this.props.searchSelection.map(function (account) {
|
|
99
105
|
return account.uuid;
|
|
100
106
|
});
|
|
@@ -125,6 +131,12 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
125
131
|
_this.props.merge(BANKS_BANK_FILTERS, {
|
|
126
132
|
scopeType: scopeType
|
|
127
133
|
});
|
|
134
|
+
|
|
135
|
+
if (scopeType === 'account') {
|
|
136
|
+
_this.setState({
|
|
137
|
+
hiddenAccountSearch: true
|
|
138
|
+
});
|
|
139
|
+
}
|
|
128
140
|
};
|
|
129
141
|
|
|
130
142
|
_this.getSortingOrderIcon = function () {
|
|
@@ -211,7 +223,11 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
211
223
|
if (_this.props.scopeType === 'course') {
|
|
212
224
|
message = t("Your filter is set to \"Courses\" which will narrow what you can search for.\n Try adjusting the filter to \"Institution\" or \"All My Banks\"");
|
|
213
225
|
} else if (_this.props.scopeType === 'account') {
|
|
214
|
-
|
|
226
|
+
if (_this.props.subAccountBankSharingEnabled && _this.hideAccountSearch()) {
|
|
227
|
+
message = t("Your filter is set to \"This Account\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
|
|
228
|
+
} else {
|
|
229
|
+
message = t("Your filter is set to \"Institution\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
|
|
230
|
+
}
|
|
215
231
|
}
|
|
216
232
|
|
|
217
233
|
return jsx(Billboard, {
|
|
@@ -242,7 +258,9 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
242
258
|
if (prevProps.sortBy !== this.props.sortBy || prevProps.sortOrder !== this.props.sortOrder || prevProps.searchTerms !== this.props.searchTerms || prevProps.scopeType !== this.props.scopeType || !isEqual(prevProps.searchSelection, this.props.searchSelection)) {
|
|
243
259
|
this.props.clear(BANKS_BANK_PAGINATION);
|
|
244
260
|
}
|
|
245
|
-
}
|
|
261
|
+
} // When the launch is from a subaccount, we want to silently add the subaccount to the account search
|
|
262
|
+
// if the user is on the "This Account" filter
|
|
263
|
+
|
|
246
264
|
}, {
|
|
247
265
|
key: "renderFilters",
|
|
248
266
|
value: function renderFilters() {
|
|
@@ -251,7 +269,7 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
251
269
|
translation: this.props.newItemBankFilterNamesEnabled ? t('All Banks') : t('All My Banks')
|
|
252
270
|
}, {
|
|
253
271
|
slug: 'account',
|
|
254
|
-
translation: t('Institution Banks')
|
|
272
|
+
translation: this.props.subAccountBankSharingEnabled && this.hideAccountSearch() ? t('This Account') : t('Institution Banks')
|
|
255
273
|
}, {
|
|
256
274
|
slug: 'courses',
|
|
257
275
|
translation: this.props.newItemBankFilterNamesEnabled ? t('Banks Shared to Course') : t('All My Course Banks')
|
|
@@ -314,7 +332,7 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
314
332
|
onChange: this.handleSearchInputChange,
|
|
315
333
|
placeholder: t('Search Banks'),
|
|
316
334
|
"data-automation": "sdk-search-bank-textinput"
|
|
317
|
-
})), this.props.subAccountBankSharingEnabled && jsx(Grid.Col, {
|
|
335
|
+
})), this.props.subAccountBankSharingEnabled && !this.hideAccountSearch() && jsx(Grid.Col, {
|
|
318
336
|
width: 4
|
|
319
337
|
}, jsx(AsyncSearch, {
|
|
320
338
|
getShareableSubaccounts: this.props.getShareableSubaccounts,
|
|
@@ -488,7 +506,9 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
488
506
|
scope: PropTypes.shape({
|
|
489
507
|
type: PropTypes.string,
|
|
490
508
|
uuid: PropTypes.string,
|
|
491
|
-
title: PropTypes.string
|
|
509
|
+
title: PropTypes.string,
|
|
510
|
+
launch_context_uuid: PropTypes.string,
|
|
511
|
+
root_account_name: PropTypes.string
|
|
492
512
|
}).isRequired,
|
|
493
513
|
scopeType: PropTypes.string,
|
|
494
514
|
searchTerms: PropTypes.string,
|
|
@@ -506,7 +526,8 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
506
526
|
subAccountBankSharingEnabled: PropTypes.bool,
|
|
507
527
|
iceTopNavBarEnabled: PropTypes.bool,
|
|
508
528
|
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
509
|
-
styles: PropTypes.object
|
|
529
|
+
styles: PropTypes.object,
|
|
530
|
+
rootAccountUuid: PropTypes.string
|
|
510
531
|
}, _class2.defaultProps = {
|
|
511
532
|
closeTray: null,
|
|
512
533
|
currentUser: null,
|
|
@@ -533,7 +554,8 @@ export var Banks = (_dec = withStyle(generateStyle, generateComponentTheme), _de
|
|
|
533
554
|
usedByCourseEnabled: false,
|
|
534
555
|
itemBankSearchTableEnabled: false,
|
|
535
556
|
subAccountBankSharingEnabled: false,
|
|
536
|
-
iceTopNavBarEnabled: false
|
|
557
|
+
iceTopNavBarEnabled: false,
|
|
558
|
+
rootAccountUuid: null
|
|
537
559
|
}, _class2.contextTypes = {
|
|
538
560
|
locale: PropTypes.string
|
|
539
561
|
}, _temp)) || _class);
|
|
@@ -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 { Alert } from '@instructure/ui-alerts';
|
|
@@ -16,19 +17,13 @@ import { Heading } from '@instructure/ui-heading';
|
|
|
16
17
|
import { Tabs } from '@instructure/ui-tabs';
|
|
17
18
|
import { ToggleDetails } from '@instructure/ui-toggle-details';
|
|
18
19
|
import { TextInput } from '@instructure/ui-text-input';
|
|
19
|
-
import {
|
|
20
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
20
21
|
import { ImportantModal, ModalHeader, ModalBody, ModalFooter, FILE_UPLOAD_SELECT, FILE_UPLOAD_IMPORTING, FILE_UPLOAD_SUCCESS, FILE_UPLOAD_FAILURE, FILE_UPLOAD_ERROR, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
template: function template(theme) {
|
|
24
|
-
return "\n\n.ceoks_bOkE{margin-top:".concat(theme.altTextMargin || 'inherit', "}");
|
|
25
|
-
},
|
|
26
|
-
'altTextWrapper': 'ceoks_bOkE'
|
|
27
|
-
};
|
|
28
|
-
import theme from "./theme.js";
|
|
22
|
+
import generateStyle from "./styles.js";
|
|
23
|
+
import generateComponentTheme from "./theme.js";
|
|
29
24
|
import ImportFileSelector from "./ImportFileSelector/index.js";
|
|
30
25
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
31
|
-
export var ImportModal = (_dec =
|
|
26
|
+
export var ImportModal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
32
27
|
_inherits(ImportModal, _Component);
|
|
33
28
|
|
|
34
29
|
var _super = _createSuper(ImportModal);
|
|
@@ -168,7 +163,7 @@ export var ImportModal = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
168
163
|
}, {
|
|
169
164
|
key: "cancelButton",
|
|
170
165
|
value: function cancelButton() {
|
|
171
|
-
return
|
|
166
|
+
return jsx(Button, {
|
|
172
167
|
disabled: this.disableCancelButton(),
|
|
173
168
|
onClick: this.cancelAction,
|
|
174
169
|
margin: XSMALL_SIDE_MARGIN,
|
|
@@ -206,7 +201,7 @@ export var ImportModal = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
206
201
|
}, {
|
|
207
202
|
key: "continueButton",
|
|
208
203
|
value: function continueButton() {
|
|
209
|
-
return
|
|
204
|
+
return jsx(Button, {
|
|
210
205
|
onClick: this.continueAction,
|
|
211
206
|
color: "primary",
|
|
212
207
|
disabled: this.disableContinueButton(),
|
|
@@ -218,7 +213,7 @@ export var ImportModal = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
218
213
|
}, {
|
|
219
214
|
key: "renderErroredContent",
|
|
220
215
|
value: function renderErroredContent() {
|
|
221
|
-
return
|
|
216
|
+
return jsx(Alert, {
|
|
222
217
|
variant: "error",
|
|
223
218
|
ref: this.setRef('errorAlert')
|
|
224
219
|
}, this.uploadStatusMessage());
|
|
@@ -226,41 +221,41 @@ export var ImportModal = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
226
221
|
}, {
|
|
227
222
|
key: "renderSelectingContent",
|
|
228
223
|
value: function renderSelectingContent(fileType) {
|
|
229
|
-
return
|
|
224
|
+
return jsx("div", null, jsx("div", null, this.props.importMessage), jsx(ImportFileSelector, {
|
|
230
225
|
files: this.props.files,
|
|
231
226
|
ref: this.setRef('fileSelector'),
|
|
232
227
|
receiveFile: this.handleFile,
|
|
233
228
|
acceptAttribute: fileType,
|
|
234
229
|
"data-automation": "sdk-import-file-selector"
|
|
235
|
-
}), fileType === 'image/*' &&
|
|
236
|
-
|
|
237
|
-
},
|
|
230
|
+
}), fileType === 'image/*' && jsx("div", {
|
|
231
|
+
css: this.props.styles.altTextWrapper
|
|
232
|
+
}, jsx(TextInput, {
|
|
238
233
|
ref: this.setRef('altTextInput'),
|
|
239
234
|
onChange: this.onAltTextChange,
|
|
240
235
|
value: this.props.altText,
|
|
241
|
-
renderLabel:
|
|
236
|
+
renderLabel: jsx("div", null, t('alt text (optional)')),
|
|
242
237
|
type: "text"
|
|
243
238
|
})));
|
|
244
239
|
}
|
|
245
240
|
}, {
|
|
246
241
|
key: "renderFailureContent",
|
|
247
242
|
value: function renderFailureContent() {
|
|
248
|
-
return
|
|
243
|
+
return jsx("div", null, jsx(Alert, {
|
|
249
244
|
variant: "error",
|
|
250
245
|
ref: this.setRef('failureAlert'),
|
|
251
246
|
"data-automation": "sdk-import-error-alert"
|
|
252
|
-
},
|
|
253
|
-
summary:
|
|
247
|
+
}, jsx("div", null, this.uploadStatusMessage(), jsx(ToggleDetails, {
|
|
248
|
+
summary: jsx(Text, {
|
|
254
249
|
size: "small"
|
|
255
250
|
}, t('Error Details'))
|
|
256
|
-
},
|
|
251
|
+
}, jsx(Text, {
|
|
257
252
|
size: "small"
|
|
258
253
|
}, this.props.failureMessage)))));
|
|
259
254
|
}
|
|
260
255
|
}, {
|
|
261
256
|
key: "renderSuccessContent",
|
|
262
257
|
value: function renderSuccessContent() {
|
|
263
|
-
return
|
|
258
|
+
return jsx(Alert, {
|
|
264
259
|
variant: "success",
|
|
265
260
|
ref: this.setRef('successAlert'),
|
|
266
261
|
"data-automation": "sdk-import-success-alert"
|
|
@@ -269,7 +264,7 @@ export var ImportModal = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
269
264
|
}, {
|
|
270
265
|
key: "renderImportingContent",
|
|
271
266
|
value: function renderImportingContent() {
|
|
272
|
-
return
|
|
267
|
+
return jsx(ProgressBar, {
|
|
273
268
|
screenReaderLabel: t('Import process completion'),
|
|
274
269
|
valueNow: this.props.progressValue,
|
|
275
270
|
ref: this.setRef('progressBar')
|
|
@@ -329,13 +324,13 @@ export var ImportModal = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
329
324
|
}
|
|
330
325
|
|
|
331
326
|
var selectedIndex = this.state.selectedTabIndex;
|
|
332
|
-
return
|
|
327
|
+
return jsx(Tabs, {
|
|
333
328
|
onRequestTabChange: this.handleTabChange,
|
|
334
329
|
variant: "secondary"
|
|
335
330
|
}, this.props.acceptFileType.map(function (_ref2, index) {
|
|
336
331
|
var fileType = _ref2.fileType,
|
|
337
332
|
title = _ref2.title;
|
|
338
|
-
return
|
|
333
|
+
return jsx(Tabs.Panel, {
|
|
339
334
|
key: title,
|
|
340
335
|
renderTitle: title,
|
|
341
336
|
disabled: _this3.props.files.size > 0 && index !== selectedIndex,
|
|
@@ -346,7 +341,7 @@ export var ImportModal = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
346
341
|
}, {
|
|
347
342
|
key: "render",
|
|
348
343
|
value: function render() {
|
|
349
|
-
return
|
|
344
|
+
return jsx(ImportantModal, {
|
|
350
345
|
open: this.props.modalOpen,
|
|
351
346
|
size: "small",
|
|
352
347
|
onClose: this.props.onClose,
|
|
@@ -354,15 +349,15 @@ export var ImportModal = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
354
349
|
label: t('Import Content'),
|
|
355
350
|
ref: this.setRef('modal'),
|
|
356
351
|
"data-automation": "sdk-import-content-modal"
|
|
357
|
-
},
|
|
352
|
+
}, jsx(ModalHeader, null, jsx(Heading, {
|
|
358
353
|
level: "reset",
|
|
359
354
|
as: "h2"
|
|
360
|
-
}, t('Import Content')),
|
|
355
|
+
}, t('Import Content')), jsx(CloseButton, {
|
|
361
356
|
onClick: this.cancelAction,
|
|
362
357
|
placement: "end",
|
|
363
358
|
offset: "medium",
|
|
364
359
|
screenReaderLabel: t('Close')
|
|
365
|
-
})),
|
|
360
|
+
})), jsx(ModalBody, null, this.renderContent()), jsx(ModalFooter, null, this.cancelButton(), this.continueButton()));
|
|
366
361
|
}
|
|
367
362
|
}]);
|
|
368
363
|
|
|
@@ -401,8 +396,9 @@ export var ImportModal = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
401
396
|
// passed in by connect
|
|
402
397
|
setUploadStatus: PropTypes.func.isRequired,
|
|
403
398
|
// passed in by connect
|
|
404
|
-
uploadStatus: PropTypes.oneOf([FILE_UPLOAD_SELECT, FILE_UPLOAD_IMPORTING, FILE_UPLOAD_SUCCESS, FILE_UPLOAD_FAILURE, FILE_UPLOAD_ERROR]).isRequired
|
|
405
|
-
|
|
399
|
+
uploadStatus: PropTypes.oneOf([FILE_UPLOAD_SELECT, FILE_UPLOAD_IMPORTING, FILE_UPLOAD_SUCCESS, FILE_UPLOAD_FAILURE, FILE_UPLOAD_ERROR]).isRequired,
|
|
400
|
+
// passed in by connect,
|
|
401
|
+
styles: PropTypes.object
|
|
406
402
|
}, _class2.defaultProps = {
|
|
407
403
|
closeOverride: null,
|
|
408
404
|
disableConfirm: false,
|
|
@@ -5,14 +5,16 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
|
|
8
10
|
/* eslint "import/no-webpack-loader-syntax": "warn" */
|
|
9
11
|
|
|
10
12
|
/* eslint "import/no-unresolved": "warn" */
|
|
11
|
-
import
|
|
13
|
+
import { Component } from 'react';
|
|
12
14
|
import PropTypes from 'prop-types';
|
|
13
15
|
import HTML5Backend from 'react-dnd-html5-backend';
|
|
14
16
|
import { DragDropContext } from 'react-dnd';
|
|
15
|
-
import {
|
|
17
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
16
18
|
import { ApplyLocale } from '@instructure/ui-i18n';
|
|
17
19
|
import { Provider } from "../../react-redux.js";
|
|
18
20
|
import store from "../../../reduxStore.js";
|
|
@@ -24,23 +26,16 @@ import { setContextUuid, setOutcomesEndpoint, setOutcomesToken } from "../../act
|
|
|
24
26
|
import { addFeatures, removeFeatures } from "../../actions/features.js";
|
|
25
27
|
import { setGradeByQuestionEnabled } from "../../actions/grading.js";
|
|
26
28
|
import { renderAlerts } from "../../util/renderAlerts.js";
|
|
27
|
-
|
|
28
|
-
componentId: 'fzweS',
|
|
29
|
-
template: function template(theme) {
|
|
30
|
-
return "\n\n.fzweS_dXHX{height:100%}";
|
|
31
|
-
},
|
|
32
|
-
'sdk': 'fzweS_dXHX'
|
|
33
|
-
};
|
|
34
|
-
import theme from "./theme.js";
|
|
29
|
+
import generateStyle from "./styles.js";
|
|
35
30
|
import CustomPropTypes from "../../../common/util/CustomPropTypes.js";
|
|
36
31
|
import ConfirmationModal from "../ConfirmationModal/index.js";
|
|
37
32
|
import setupFormatMessage from '@instructure/quiz-i18n/es/util/setupFormatMessage';
|
|
38
33
|
import RceConfigProvider from "../RceConfigProvider/index.js";
|
|
39
34
|
import { ApiFeatureFlagInitializer } from "../ApiFeatureFlagInitializer/index.js";
|
|
40
35
|
|
|
41
|
-
var _ref =
|
|
36
|
+
var _ref = jsx(ConfirmationModal, null);
|
|
42
37
|
|
|
43
|
-
export var SDKApp = (_dec =
|
|
38
|
+
export var SDKApp = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
44
39
|
_inherits(SDKApp, _Component);
|
|
45
40
|
|
|
46
41
|
var _super = _createSuper(SDKApp);
|
|
@@ -151,13 +146,13 @@ export var SDKApp = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
151
146
|
var store = this.store,
|
|
152
147
|
props = this.props,
|
|
153
148
|
context = this.context;
|
|
154
|
-
return
|
|
149
|
+
return jsx(Provider, {
|
|
155
150
|
store: store
|
|
156
|
-
},
|
|
151
|
+
}, jsx(ApiFeatureFlagInitializer, null, jsx(RceConfigProvider, this.props.rceConfig, jsx(ApplyLocale, {
|
|
157
152
|
locale: getLocale(props, context),
|
|
158
153
|
timezone: props.timeZone
|
|
159
|
-
},
|
|
160
|
-
|
|
154
|
+
}, jsx("div", {
|
|
155
|
+
css: this.props.styles.sdk,
|
|
161
156
|
"data-automation": "sdk-app"
|
|
162
157
|
}, _ref, typeof props.children === 'function' ? props.children({
|
|
163
158
|
addAlert: this.addAlert
|
|
@@ -195,7 +190,8 @@ export var SDKApp = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
195
190
|
message: PropTypes.string
|
|
196
191
|
})),
|
|
197
192
|
userToken: PropTypes.string.isRequired,
|
|
198
|
-
disableAlertLiveRegion: PropTypes.bool
|
|
193
|
+
disableAlertLiveRegion: PropTypes.bool,
|
|
194
|
+
styles: PropTypes.object
|
|
199
195
|
}, _class2.contextTypes = {
|
|
200
196
|
locale: PropTypes.string
|
|
201
197
|
}, _class2.defaultProps = {
|
|
@@ -5,32 +5,24 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
|
|
8
10
|
/* eslint "jsx-a11y/click-events-have-key-events": "warn" */
|
|
9
|
-
import
|
|
11
|
+
import { Component } from 'react';
|
|
10
12
|
import PropTypes from 'prop-types';
|
|
11
13
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
12
14
|
import { IconBankLine } from '@instructure/ui-icons';
|
|
13
|
-
import {
|
|
15
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
14
16
|
import StimulusShowInfo from "../StimulusShowInfo/index.js";
|
|
15
|
-
import Overlay from "../../../../../common/components/shared/overlay/Overlay.js";
|
|
16
17
|
import ActionButtons from "../../../../../building/components/resources/ActionButtons/index.js";
|
|
17
18
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return "\n\n.ceqOh_dRGY{padding-bottom:".concat(theme.stimulusPadding || 'inherit', ";padding-top:").concat(theme.stimulusPadding || 'inherit', "}\n\n.ceqOh_fsuY{align-items:center;display:flex;height:1rem;justify-content:space-between;padding-left:").concat(theme.headerPadding || 'inherit', ";padding-right:").concat(theme.headerPadding || 'inherit', "}\n\n.ceqOh_cKlw{display:flex;overflow:hidden}\n\n.ceqOh_ffXB{color:").concat(theme.stimulusLabelColor || 'inherit', ";font-size:").concat(theme.stimulusLabelFontSize || 'inherit', ";margin:0 ").concat(theme.stimulusLabelMargin || 'inherit', ";overflow:hidden;text-overflow:ellipsis}\n\n.ceqOh_dMwa{height:100%;padding:").concat(theme.stimulusContentPaddingTop || 'inherit', " ").concat(theme.stimulusContentPaddingLeftRight || 'inherit', " ").concat(theme.stimulusContentPaddingBottom || 'inherit', "}");
|
|
22
|
-
},
|
|
23
|
-
'stimulus': 'ceqOh_dRGY',
|
|
24
|
-
'header': 'ceqOh_fsuY',
|
|
25
|
-
'leftHeader': 'ceqOh_cKlw',
|
|
26
|
-
'stimulusLabel': 'ceqOh_ffXB',
|
|
27
|
-
'stimulusContent': 'ceqOh_dMwa'
|
|
28
|
-
};
|
|
29
|
-
import theme from "./theme.js";
|
|
19
|
+
import generateStyle from "./styles.js";
|
|
20
|
+
import generateComponentTheme from "./theme.js";
|
|
21
|
+
import OverlayEmotion from "../../../shared/overlayEmotion/index.js";
|
|
30
22
|
|
|
31
|
-
var _ref =
|
|
23
|
+
var _ref = jsx(IconBankLine, null);
|
|
32
24
|
|
|
33
|
-
export var StimulusShow = (_dec =
|
|
25
|
+
export var StimulusShow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
34
26
|
_inherits(StimulusShow, _Component);
|
|
35
27
|
|
|
36
28
|
var _super = _createSuper(StimulusShow);
|
|
@@ -63,20 +55,20 @@ export var StimulusShow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
63
55
|
}, {
|
|
64
56
|
key: "render",
|
|
65
57
|
value: function render() {
|
|
66
|
-
return
|
|
58
|
+
return jsx(OverlayEmotion, {
|
|
67
59
|
onClick: this.switchOnEditing,
|
|
68
|
-
|
|
60
|
+
wrapperStyles: this.props.styles.stimulusWrapper,
|
|
69
61
|
tabIndex: "-1",
|
|
70
62
|
hideOverlay: this.props.isQuizContentLocked
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
}, this.renderBankIcon(),
|
|
78
|
-
|
|
79
|
-
}, t('Stimulus'))),
|
|
63
|
+
}, jsx("div", {
|
|
64
|
+
css: this.props.styles.stimulus
|
|
65
|
+
}, jsx("div", {
|
|
66
|
+
css: this.props.styles.header
|
|
67
|
+
}, jsx("div", {
|
|
68
|
+
css: this.props.styles.leftHeader
|
|
69
|
+
}, this.renderBankIcon(), jsx("div", {
|
|
70
|
+
css: this.props.styles.stimulusLabel
|
|
71
|
+
}, t('Stimulus'))), jsx(ActionButtons, {
|
|
80
72
|
connectDragSource: this.props.connectDragSource,
|
|
81
73
|
displayPosition: this.props.displayPosition,
|
|
82
74
|
onDelete: this.props.openDeleteStimulusModal,
|
|
@@ -89,11 +81,12 @@ export var StimulusShow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
89
81
|
shouldDisableCopy: this.props.isQuizContentLocked,
|
|
90
82
|
shouldRenderEdit: !this.props.isQuizContentLocked,
|
|
91
83
|
shouldRenderDelete: !this.props.isQuizContentLocked
|
|
92
|
-
})),
|
|
84
|
+
})), jsx("div", {
|
|
93
85
|
role: "presentation",
|
|
94
86
|
onClick: this.props.isQuizContentLocked ? null : this.switchOnEditing,
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
css: this.props.styles.stimulusContent,
|
|
88
|
+
"data-testid": "stimulus-content"
|
|
89
|
+
}, jsx(StimulusShowInfo, {
|
|
97
90
|
stimulus: this.props.stimulus
|
|
98
91
|
}))));
|
|
99
92
|
}
|
|
@@ -113,7 +106,8 @@ export var StimulusShow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
113
106
|
shouldDisableDragHandle: PropTypes.bool,
|
|
114
107
|
stimulus: ImmutablePropTypes.record.isRequired,
|
|
115
108
|
switchOnEditing: PropTypes.func.isRequired,
|
|
116
|
-
shouldFocusOnMount: PropTypes.bool.isRequired
|
|
109
|
+
shouldFocusOnMount: PropTypes.bool.isRequired,
|
|
110
|
+
styles: PropTypes.object
|
|
117
111
|
}, _class2.defaultProps = {
|
|
118
112
|
isBankedContent: false,
|
|
119
113
|
isQuizContentLocked: false,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
stimulus: {
|
|
4
|
+
paddingTop: componentTheme.stimulusPadding,
|
|
5
|
+
paddingBottom: componentTheme.stimulusPadding
|
|
6
|
+
},
|
|
7
|
+
header: {
|
|
8
|
+
height: '1rem',
|
|
9
|
+
paddingLeft: componentTheme.headerPadding,
|
|
10
|
+
paddingRight: componentTheme.headerPadding,
|
|
11
|
+
display: 'flex',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
justifyContent: 'space-between'
|
|
14
|
+
},
|
|
15
|
+
leftHeader: {
|
|
16
|
+
display: 'flex',
|
|
17
|
+
overflow: 'hidden'
|
|
18
|
+
},
|
|
19
|
+
stimulusLabel: {
|
|
20
|
+
color: componentTheme.stimulusLabelColor,
|
|
21
|
+
fontSize: componentTheme.stimulusLabelFontSize,
|
|
22
|
+
margin: "0 ".concat(componentTheme.stimulusLabelMargin),
|
|
23
|
+
overflow: 'hidden',
|
|
24
|
+
textOverflow: 'ellipsis'
|
|
25
|
+
},
|
|
26
|
+
stimulusContent: {
|
|
27
|
+
height: '10%0',
|
|
28
|
+
padding: "".concat(componentTheme.stimulusContentPaddingTop, " ").concat(componentTheme.stimulusContentPaddingLeftRight, " ").concat(componentTheme.stimulusContentPaddingBottom)
|
|
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
|
typography = _ref.typography,
|
|
4
4
|
colors = _ref.colors;
|
|
@@ -12,4 +12,6 @@ export default function generator(_ref) {
|
|
|
12
12
|
stimulusContentPaddingBottom: spacing.small,
|
|
13
13
|
stimulusContentPaddingLeftRight: spacing.small
|
|
14
14
|
};
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default generateComponentTheme;
|
|
@@ -34,6 +34,7 @@ function mapStateToProps(state, props) {
|
|
|
34
34
|
var sortOrder = pageData.get('sortOrder', 'ascending');
|
|
35
35
|
var searchTerms = pageData.get('searchTerms', null);
|
|
36
36
|
var searchSelection = pageData.get('searchSelection', []);
|
|
37
|
+
var rootAccountUuid = state.getIn(['outcomes', 'contextUuid']);
|
|
37
38
|
return {
|
|
38
39
|
itemBankSearchTableEnabled: (0, _featureCheck.featureOn)('item_bank_search_table'),
|
|
39
40
|
improvedBankSharingEnabled: (0, _featureCheck.featureOn)('improved_bank_sharing'),
|
|
@@ -44,7 +45,8 @@ function mapStateToProps(state, props) {
|
|
|
44
45
|
sortBy: sortBy,
|
|
45
46
|
sortOrder: sortOrder,
|
|
46
47
|
searchTerms: searchTerms,
|
|
47
|
-
searchSelection: searchSelection
|
|
48
|
+
searchSelection: searchSelection,
|
|
49
|
+
rootAccountUuid: rootAccountUuid
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
52
|
|
|
@@ -95,6 +95,10 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
95
95
|
(0, _classCallCheck2.default)(this, Banks);
|
|
96
96
|
_this = _super.apply(this, arguments);
|
|
97
97
|
|
|
98
|
+
_this.hideAccountSearch = function () {
|
|
99
|
+
return _this.props.scopeType === 'account' && _this.props.scope.type === 'account' && _this.props.scope.launch_context_uuid && _this.props.rootAccountUuid && _this.props.scope.launch_context_uuid !== _this.props.rootAccountUuid;
|
|
100
|
+
};
|
|
101
|
+
|
|
98
102
|
_this.onCreateBank = function () {
|
|
99
103
|
_this.props.createBank({
|
|
100
104
|
language: _this.context.locale
|
|
@@ -134,7 +138,9 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
134
138
|
params['search'] = _this.props.searchTerms;
|
|
135
139
|
}
|
|
136
140
|
|
|
137
|
-
if (_this.props.
|
|
141
|
+
if (_this.props.subAccountBankSharingEnabled && _this.hideAccountSearch()) {
|
|
142
|
+
params['account_uuids'] = [_this.props.scope.launch_context_uuid];
|
|
143
|
+
} else if (_this.props.searchSelection.length > 0) {
|
|
138
144
|
params['account_uuids'] = _this.props.searchSelection.map(function (account) {
|
|
139
145
|
return account.uuid;
|
|
140
146
|
});
|
|
@@ -165,6 +171,12 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
165
171
|
_this.props.merge(_quizCommon.BANKS_BANK_FILTERS, {
|
|
166
172
|
scopeType: scopeType
|
|
167
173
|
});
|
|
174
|
+
|
|
175
|
+
if (scopeType === 'account') {
|
|
176
|
+
_this.setState({
|
|
177
|
+
hiddenAccountSearch: true
|
|
178
|
+
});
|
|
179
|
+
}
|
|
168
180
|
};
|
|
169
181
|
|
|
170
182
|
_this.getSortingOrderIcon = function () {
|
|
@@ -251,7 +263,11 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
251
263
|
if (_this.props.scopeType === 'course') {
|
|
252
264
|
message = (0, _formatMessage.default)("Your filter is set to \"Courses\" which will narrow what you can search for.\n Try adjusting the filter to \"Institution\" or \"All My Banks\"");
|
|
253
265
|
} else if (_this.props.scopeType === 'account') {
|
|
254
|
-
|
|
266
|
+
if (_this.props.subAccountBankSharingEnabled && _this.hideAccountSearch()) {
|
|
267
|
+
message = (0, _formatMessage.default)("Your filter is set to \"This Account\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
|
|
268
|
+
} else {
|
|
269
|
+
message = (0, _formatMessage.default)("Your filter is set to \"Institution\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
|
|
270
|
+
}
|
|
255
271
|
}
|
|
256
272
|
|
|
257
273
|
return (0, _emotion.jsx)(_uiBillboard.Billboard, {
|
|
@@ -282,7 +298,9 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
282
298
|
if (prevProps.sortBy !== this.props.sortBy || prevProps.sortOrder !== this.props.sortOrder || prevProps.searchTerms !== this.props.searchTerms || prevProps.scopeType !== this.props.scopeType || !(0, _isEqual.default)(prevProps.searchSelection, this.props.searchSelection)) {
|
|
283
299
|
this.props.clear(_quizCommon.BANKS_BANK_PAGINATION);
|
|
284
300
|
}
|
|
285
|
-
}
|
|
301
|
+
} // When the launch is from a subaccount, we want to silently add the subaccount to the account search
|
|
302
|
+
// if the user is on the "This Account" filter
|
|
303
|
+
|
|
286
304
|
}, {
|
|
287
305
|
key: "renderFilters",
|
|
288
306
|
value: function renderFilters() {
|
|
@@ -291,7 +309,7 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
291
309
|
translation: this.props.newItemBankFilterNamesEnabled ? (0, _formatMessage.default)('All Banks') : (0, _formatMessage.default)('All My Banks')
|
|
292
310
|
}, {
|
|
293
311
|
slug: 'account',
|
|
294
|
-
translation: (0, _formatMessage.default)('Institution Banks')
|
|
312
|
+
translation: this.props.subAccountBankSharingEnabled && this.hideAccountSearch() ? (0, _formatMessage.default)('This Account') : (0, _formatMessage.default)('Institution Banks')
|
|
295
313
|
}, {
|
|
296
314
|
slug: 'courses',
|
|
297
315
|
translation: this.props.newItemBankFilterNamesEnabled ? (0, _formatMessage.default)('Banks Shared to Course') : (0, _formatMessage.default)('All My Course Banks')
|
|
@@ -354,7 +372,7 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
354
372
|
onChange: this.handleSearchInputChange,
|
|
355
373
|
placeholder: (0, _formatMessage.default)('Search Banks'),
|
|
356
374
|
"data-automation": "sdk-search-bank-textinput"
|
|
357
|
-
})), this.props.subAccountBankSharingEnabled && (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
375
|
+
})), this.props.subAccountBankSharingEnabled && !this.hideAccountSearch() && (0, _emotion.jsx)(_uiGrid.Grid.Col, {
|
|
358
376
|
width: 4
|
|
359
377
|
}, (0, _emotion.jsx)(_index7.default, {
|
|
360
378
|
getShareableSubaccounts: this.props.getShareableSubaccounts,
|
|
@@ -527,7 +545,9 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
527
545
|
scope: _propTypes.default.shape({
|
|
528
546
|
type: _propTypes.default.string,
|
|
529
547
|
uuid: _propTypes.default.string,
|
|
530
|
-
title: _propTypes.default.string
|
|
548
|
+
title: _propTypes.default.string,
|
|
549
|
+
launch_context_uuid: _propTypes.default.string,
|
|
550
|
+
root_account_name: _propTypes.default.string
|
|
531
551
|
}).isRequired,
|
|
532
552
|
scopeType: _propTypes.default.string,
|
|
533
553
|
searchTerms: _propTypes.default.string,
|
|
@@ -545,7 +565,8 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
545
565
|
subAccountBankSharingEnabled: _propTypes.default.bool,
|
|
546
566
|
iceTopNavBarEnabled: _propTypes.default.bool,
|
|
547
567
|
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
548
|
-
styles: _propTypes.default.object
|
|
568
|
+
styles: _propTypes.default.object,
|
|
569
|
+
rootAccountUuid: _propTypes.default.string
|
|
549
570
|
}, _class2.defaultProps = {
|
|
550
571
|
closeTray: null,
|
|
551
572
|
currentUser: null,
|
|
@@ -572,7 +593,8 @@ var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
572
593
|
usedByCourseEnabled: false,
|
|
573
594
|
itemBankSearchTableEnabled: false,
|
|
574
595
|
subAccountBankSharingEnabled: false,
|
|
575
|
-
iceTopNavBarEnabled: false
|
|
596
|
+
iceTopNavBarEnabled: false,
|
|
597
|
+
rootAccountUuid: null
|
|
576
598
|
}, _class2.contextTypes = {
|
|
577
599
|
locale: _propTypes.default.string
|
|
578
600
|
}, _temp)) || _class);
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -17,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
@@ -39,10 +37,12 @@ var _uiToggleDetails = require("@instructure/ui-toggle-details");
|
|
|
39
37
|
|
|
40
38
|
var _uiTextInput = require("@instructure/ui-text-input");
|
|
41
39
|
|
|
42
|
-
var
|
|
40
|
+
var _emotion = require("@instructure/emotion");
|
|
43
41
|
|
|
44
42
|
var _quizCommon = require("@instructure/quiz-common");
|
|
45
43
|
|
|
44
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
45
|
+
|
|
46
46
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
47
47
|
|
|
48
48
|
var _index = _interopRequireDefault(require("./ImportFileSelector/index.js"));
|
|
@@ -51,14 +51,7 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
|
|
|
51
51
|
|
|
52
52
|
var _dec, _class, _class2, _temp;
|
|
53
53
|
|
|
54
|
-
var
|
|
55
|
-
componentId: 'ceoks',
|
|
56
|
-
template: function template(theme) {
|
|
57
|
-
return "\n\n.ceoks_bOkE{margin-top:".concat(theme.altTextMargin || 'inherit', "}");
|
|
58
|
-
},
|
|
59
|
-
'altTextWrapper': 'ceoks_bOkE'
|
|
60
|
-
};
|
|
61
|
-
var ImportModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
54
|
+
var ImportModal = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
62
55
|
(0, _inherits2.default)(ImportModal, _Component);
|
|
63
56
|
|
|
64
57
|
var _super = (0, _createSuper2.default)(ImportModal);
|
|
@@ -198,7 +191,7 @@ var ImportModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
198
191
|
}, {
|
|
199
192
|
key: "cancelButton",
|
|
200
193
|
value: function cancelButton() {
|
|
201
|
-
return
|
|
194
|
+
return (0, _emotion.jsx)(_uiButtons.Button, {
|
|
202
195
|
disabled: this.disableCancelButton(),
|
|
203
196
|
onClick: this.cancelAction,
|
|
204
197
|
margin: _quizCommon.XSMALL_SIDE_MARGIN,
|
|
@@ -236,7 +229,7 @@ var ImportModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
236
229
|
}, {
|
|
237
230
|
key: "continueButton",
|
|
238
231
|
value: function continueButton() {
|
|
239
|
-
return
|
|
232
|
+
return (0, _emotion.jsx)(_uiButtons.Button, {
|
|
240
233
|
onClick: this.continueAction,
|
|
241
234
|
color: "primary",
|
|
242
235
|
disabled: this.disableContinueButton(),
|
|
@@ -248,7 +241,7 @@ var ImportModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
248
241
|
}, {
|
|
249
242
|
key: "renderErroredContent",
|
|
250
243
|
value: function renderErroredContent() {
|
|
251
|
-
return
|
|
244
|
+
return (0, _emotion.jsx)(_uiAlerts.Alert, {
|
|
252
245
|
variant: "error",
|
|
253
246
|
ref: this.setRef('errorAlert')
|
|
254
247
|
}, this.uploadStatusMessage());
|
|
@@ -256,41 +249,41 @@ var ImportModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
256
249
|
}, {
|
|
257
250
|
key: "renderSelectingContent",
|
|
258
251
|
value: function renderSelectingContent(fileType) {
|
|
259
|
-
return
|
|
252
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", null, this.props.importMessage), (0, _emotion.jsx)(_index.default, {
|
|
260
253
|
files: this.props.files,
|
|
261
254
|
ref: this.setRef('fileSelector'),
|
|
262
255
|
receiveFile: this.handleFile,
|
|
263
256
|
acceptAttribute: fileType,
|
|
264
257
|
"data-automation": "sdk-import-file-selector"
|
|
265
|
-
}), fileType === 'image/*' &&
|
|
266
|
-
|
|
267
|
-
},
|
|
258
|
+
}), fileType === 'image/*' && (0, _emotion.jsx)("div", {
|
|
259
|
+
css: this.props.styles.altTextWrapper
|
|
260
|
+
}, (0, _emotion.jsx)(_uiTextInput.TextInput, {
|
|
268
261
|
ref: this.setRef('altTextInput'),
|
|
269
262
|
onChange: this.onAltTextChange,
|
|
270
263
|
value: this.props.altText,
|
|
271
|
-
renderLabel:
|
|
264
|
+
renderLabel: (0, _emotion.jsx)("div", null, (0, _formatMessage.default)('alt text (optional)')),
|
|
272
265
|
type: "text"
|
|
273
266
|
})));
|
|
274
267
|
}
|
|
275
268
|
}, {
|
|
276
269
|
key: "renderFailureContent",
|
|
277
270
|
value: function renderFailureContent() {
|
|
278
|
-
return
|
|
271
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)(_uiAlerts.Alert, {
|
|
279
272
|
variant: "error",
|
|
280
273
|
ref: this.setRef('failureAlert'),
|
|
281
274
|
"data-automation": "sdk-import-error-alert"
|
|
282
|
-
},
|
|
283
|
-
summary:
|
|
275
|
+
}, (0, _emotion.jsx)("div", null, this.uploadStatusMessage(), (0, _emotion.jsx)(_uiToggleDetails.ToggleDetails, {
|
|
276
|
+
summary: (0, _emotion.jsx)(_uiText.Text, {
|
|
284
277
|
size: "small"
|
|
285
278
|
}, (0, _formatMessage.default)('Error Details'))
|
|
286
|
-
},
|
|
279
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
287
280
|
size: "small"
|
|
288
281
|
}, this.props.failureMessage)))));
|
|
289
282
|
}
|
|
290
283
|
}, {
|
|
291
284
|
key: "renderSuccessContent",
|
|
292
285
|
value: function renderSuccessContent() {
|
|
293
|
-
return
|
|
286
|
+
return (0, _emotion.jsx)(_uiAlerts.Alert, {
|
|
294
287
|
variant: "success",
|
|
295
288
|
ref: this.setRef('successAlert'),
|
|
296
289
|
"data-automation": "sdk-import-success-alert"
|
|
@@ -299,7 +292,7 @@ var ImportModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
299
292
|
}, {
|
|
300
293
|
key: "renderImportingContent",
|
|
301
294
|
value: function renderImportingContent() {
|
|
302
|
-
return
|
|
295
|
+
return (0, _emotion.jsx)(_uiProgress.ProgressBar, {
|
|
303
296
|
screenReaderLabel: (0, _formatMessage.default)('Import process completion'),
|
|
304
297
|
valueNow: this.props.progressValue,
|
|
305
298
|
ref: this.setRef('progressBar')
|
|
@@ -359,13 +352,13 @@ var ImportModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
359
352
|
}
|
|
360
353
|
|
|
361
354
|
var selectedIndex = this.state.selectedTabIndex;
|
|
362
|
-
return
|
|
355
|
+
return (0, _emotion.jsx)(_uiTabs.Tabs, {
|
|
363
356
|
onRequestTabChange: this.handleTabChange,
|
|
364
357
|
variant: "secondary"
|
|
365
358
|
}, this.props.acceptFileType.map(function (_ref2, index) {
|
|
366
359
|
var fileType = _ref2.fileType,
|
|
367
360
|
title = _ref2.title;
|
|
368
|
-
return
|
|
361
|
+
return (0, _emotion.jsx)(_uiTabs.Tabs.Panel, {
|
|
369
362
|
key: title,
|
|
370
363
|
renderTitle: title,
|
|
371
364
|
disabled: _this3.props.files.size > 0 && index !== selectedIndex,
|
|
@@ -376,7 +369,7 @@ var ImportModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
376
369
|
}, {
|
|
377
370
|
key: "render",
|
|
378
371
|
value: function render() {
|
|
379
|
-
return
|
|
372
|
+
return (0, _emotion.jsx)(_quizCommon.ImportantModal, {
|
|
380
373
|
open: this.props.modalOpen,
|
|
381
374
|
size: "small",
|
|
382
375
|
onClose: this.props.onClose,
|
|
@@ -384,15 +377,15 @@ var ImportModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
384
377
|
label: (0, _formatMessage.default)('Import Content'),
|
|
385
378
|
ref: this.setRef('modal'),
|
|
386
379
|
"data-automation": "sdk-import-content-modal"
|
|
387
|
-
},
|
|
380
|
+
}, (0, _emotion.jsx)(_quizCommon.ModalHeader, null, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
388
381
|
level: "reset",
|
|
389
382
|
as: "h2"
|
|
390
|
-
}, (0, _formatMessage.default)('Import Content')),
|
|
383
|
+
}, (0, _formatMessage.default)('Import Content')), (0, _emotion.jsx)(_uiButtons.CloseButton, {
|
|
391
384
|
onClick: this.cancelAction,
|
|
392
385
|
placement: "end",
|
|
393
386
|
offset: "medium",
|
|
394
387
|
screenReaderLabel: (0, _formatMessage.default)('Close')
|
|
395
|
-
})),
|
|
388
|
+
})), (0, _emotion.jsx)(_quizCommon.ModalBody, null, this.renderContent()), (0, _emotion.jsx)(_quizCommon.ModalFooter, null, this.cancelButton(), this.continueButton()));
|
|
396
389
|
}
|
|
397
390
|
}]);
|
|
398
391
|
ImportModal.displayName = "ImportModal";
|
|
@@ -430,8 +423,9 @@ var ImportModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
430
423
|
// passed in by connect
|
|
431
424
|
setUploadStatus: _propTypes.default.func.isRequired,
|
|
432
425
|
// passed in by connect
|
|
433
|
-
uploadStatus: _propTypes.default.oneOf([_quizCommon.FILE_UPLOAD_SELECT, _quizCommon.FILE_UPLOAD_IMPORTING, _quizCommon.FILE_UPLOAD_SUCCESS, _quizCommon.FILE_UPLOAD_FAILURE, _quizCommon.FILE_UPLOAD_ERROR]).isRequired
|
|
434
|
-
|
|
426
|
+
uploadStatus: _propTypes.default.oneOf([_quizCommon.FILE_UPLOAD_SELECT, _quizCommon.FILE_UPLOAD_IMPORTING, _quizCommon.FILE_UPLOAD_SUCCESS, _quizCommon.FILE_UPLOAD_FAILURE, _quizCommon.FILE_UPLOAD_ERROR]).isRequired,
|
|
427
|
+
// passed in by connect,
|
|
428
|
+
styles: _propTypes.default.object
|
|
435
429
|
}, _class2.defaultProps = {
|
|
436
430
|
closeOverride: null,
|
|
437
431
|
disableConfirm: false,
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
altTextWrapper: {
|
|
11
|
+
marginTop: componentTheme.altTextMargin
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var _default = generateStyle;
|
|
17
|
+
exports.default = _default;
|
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var spacing = _ref.spacing;
|
|
10
10
|
return {
|
|
11
11
|
altTextMargin: spacing.large
|
|
12
12
|
};
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var _default = generateComponentTheme;
|
|
16
|
+
exports.default = _default;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -17,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
@@ -25,7 +23,7 @@ var _reactDndHtml5Backend = _interopRequireDefault(require("react-dnd-html5-back
|
|
|
25
23
|
|
|
26
24
|
var _reactDnd = require("react-dnd");
|
|
27
25
|
|
|
28
|
-
var
|
|
26
|
+
var _emotion = require("@instructure/emotion");
|
|
29
27
|
|
|
30
28
|
var _uiI18n = require("@instructure/ui-i18n");
|
|
31
29
|
|
|
@@ -49,7 +47,7 @@ var _grading = require("../../actions/grading.js");
|
|
|
49
47
|
|
|
50
48
|
var _renderAlerts = require("../../util/renderAlerts.js");
|
|
51
49
|
|
|
52
|
-
var
|
|
50
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
53
51
|
|
|
54
52
|
var _CustomPropTypes = _interopRequireDefault(require("../../../common/util/CustomPropTypes.js"));
|
|
55
53
|
|
|
@@ -63,17 +61,9 @@ var _index3 = require("../ApiFeatureFlagInitializer/index.js");
|
|
|
63
61
|
|
|
64
62
|
var _dec, _class, _class2, _temp;
|
|
65
63
|
|
|
66
|
-
var
|
|
67
|
-
componentId: 'fzweS',
|
|
68
|
-
template: function template(theme) {
|
|
69
|
-
return "\n\n.fzweS_dXHX{height:100%}";
|
|
70
|
-
},
|
|
71
|
-
'sdk': 'fzweS_dXHX'
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
var _ref = /*#__PURE__*/_react.default.createElement(_index.default, null);
|
|
64
|
+
var _ref = (0, _emotion.jsx)(_index.default, null);
|
|
75
65
|
|
|
76
|
-
var SDKApp = (_dec = (0,
|
|
66
|
+
var SDKApp = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
77
67
|
(0, _inherits2.default)(SDKApp, _Component);
|
|
78
68
|
|
|
79
69
|
var _super = (0, _createSuper2.default)(SDKApp);
|
|
@@ -183,13 +173,13 @@ var SDKApp = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
|
|
|
183
173
|
var store = this.store,
|
|
184
174
|
props = this.props,
|
|
185
175
|
context = this.context;
|
|
186
|
-
return
|
|
176
|
+
return (0, _emotion.jsx)(_reactRedux.Provider, {
|
|
187
177
|
store: store
|
|
188
|
-
},
|
|
178
|
+
}, (0, _emotion.jsx)(_index3.ApiFeatureFlagInitializer, null, (0, _emotion.jsx)(_index2.default, this.props.rceConfig, (0, _emotion.jsx)(_uiI18n.ApplyLocale, {
|
|
189
179
|
locale: (0, _quizCommon.getLocale)(props, context),
|
|
190
180
|
timezone: props.timeZone
|
|
191
|
-
},
|
|
192
|
-
|
|
181
|
+
}, (0, _emotion.jsx)("div", {
|
|
182
|
+
css: this.props.styles.sdk,
|
|
193
183
|
"data-automation": "sdk-app"
|
|
194
184
|
}, _ref, typeof props.children === 'function' ? props.children({
|
|
195
185
|
addAlert: this.addAlert
|
|
@@ -226,7 +216,8 @@ var SDKApp = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
|
|
|
226
216
|
message: _propTypes.default.string
|
|
227
217
|
})),
|
|
228
218
|
userToken: _propTypes.default.string.isRequired,
|
|
229
|
-
disableAlertLiveRegion: _propTypes.default.bool
|
|
219
|
+
disableAlertLiveRegion: _propTypes.default.bool,
|
|
220
|
+
styles: _propTypes.default.object
|
|
230
221
|
}, _class2.contextTypes = {
|
|
231
222
|
locale: _propTypes.default.string
|
|
232
223
|
}, _class2.defaultProps = {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle() {
|
|
9
|
+
return {
|
|
10
|
+
sdk: {
|
|
11
|
+
height: '100%'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var _default = generateStyle;
|
|
17
|
+
exports.default = _default;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -17,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
@@ -25,35 +23,25 @@ var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-p
|
|
|
25
23
|
|
|
26
24
|
var _uiIcons = require("@instructure/ui-icons");
|
|
27
25
|
|
|
28
|
-
var
|
|
26
|
+
var _emotion = require("@instructure/emotion");
|
|
29
27
|
|
|
30
28
|
var _index = _interopRequireDefault(require("../StimulusShowInfo/index.js"));
|
|
31
29
|
|
|
32
|
-
var _Overlay = _interopRequireDefault(require("../../../../../common/components/shared/overlay/Overlay.js"));
|
|
33
|
-
|
|
34
30
|
var _index2 = _interopRequireDefault(require("../../../../../building/components/resources/ActionButtons/index.js"));
|
|
35
31
|
|
|
36
32
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
37
33
|
|
|
34
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
35
|
+
|
|
38
36
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
39
37
|
|
|
38
|
+
var _index3 = _interopRequireDefault(require("../../../shared/overlayEmotion/index.js"));
|
|
39
|
+
|
|
40
40
|
var _dec, _class, _class2, _temp;
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return "\n\n.ceqOh_dRGY{padding-bottom:".concat(theme.stimulusPadding || 'inherit', ";padding-top:").concat(theme.stimulusPadding || 'inherit', "}\n\n.ceqOh_fsuY{align-items:center;display:flex;height:1rem;justify-content:space-between;padding-left:").concat(theme.headerPadding || 'inherit', ";padding-right:").concat(theme.headerPadding || 'inherit', "}\n\n.ceqOh_cKlw{display:flex;overflow:hidden}\n\n.ceqOh_ffXB{color:").concat(theme.stimulusLabelColor || 'inherit', ";font-size:").concat(theme.stimulusLabelFontSize || 'inherit', ";margin:0 ").concat(theme.stimulusLabelMargin || 'inherit', ";overflow:hidden;text-overflow:ellipsis}\n\n.ceqOh_dMwa{height:100%;padding:").concat(theme.stimulusContentPaddingTop || 'inherit', " ").concat(theme.stimulusContentPaddingLeftRight || 'inherit', " ").concat(theme.stimulusContentPaddingBottom || 'inherit', "}");
|
|
46
|
-
},
|
|
47
|
-
'stimulus': 'ceqOh_dRGY',
|
|
48
|
-
'header': 'ceqOh_fsuY',
|
|
49
|
-
'leftHeader': 'ceqOh_cKlw',
|
|
50
|
-
'stimulusLabel': 'ceqOh_ffXB',
|
|
51
|
-
'stimulusContent': 'ceqOh_dMwa'
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var _ref = /*#__PURE__*/_react.default.createElement(_uiIcons.IconBankLine, null);
|
|
55
|
-
|
|
56
|
-
var StimulusShow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
42
|
+
var _ref = (0, _emotion.jsx)(_uiIcons.IconBankLine, null);
|
|
43
|
+
|
|
44
|
+
var StimulusShow = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
57
45
|
(0, _inherits2.default)(StimulusShow, _Component);
|
|
58
46
|
|
|
59
47
|
var _super = (0, _createSuper2.default)(StimulusShow);
|
|
@@ -86,20 +74,20 @@ var StimulusShow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
86
74
|
}, {
|
|
87
75
|
key: "render",
|
|
88
76
|
value: function render() {
|
|
89
|
-
return
|
|
77
|
+
return (0, _emotion.jsx)(_index3.default, {
|
|
90
78
|
onClick: this.switchOnEditing,
|
|
91
|
-
|
|
79
|
+
wrapperStyles: this.props.styles.stimulusWrapper,
|
|
92
80
|
tabIndex: "-1",
|
|
93
81
|
hideOverlay: this.props.isQuizContentLocked
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
}, this.renderBankIcon(),
|
|
101
|
-
|
|
102
|
-
}, (0, _formatMessage.default)('Stimulus'))),
|
|
82
|
+
}, (0, _emotion.jsx)("div", {
|
|
83
|
+
css: this.props.styles.stimulus
|
|
84
|
+
}, (0, _emotion.jsx)("div", {
|
|
85
|
+
css: this.props.styles.header
|
|
86
|
+
}, (0, _emotion.jsx)("div", {
|
|
87
|
+
css: this.props.styles.leftHeader
|
|
88
|
+
}, this.renderBankIcon(), (0, _emotion.jsx)("div", {
|
|
89
|
+
css: this.props.styles.stimulusLabel
|
|
90
|
+
}, (0, _formatMessage.default)('Stimulus'))), (0, _emotion.jsx)(_index2.default, {
|
|
103
91
|
connectDragSource: this.props.connectDragSource,
|
|
104
92
|
displayPosition: this.props.displayPosition,
|
|
105
93
|
onDelete: this.props.openDeleteStimulusModal,
|
|
@@ -112,11 +100,12 @@ var StimulusShow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
112
100
|
shouldDisableCopy: this.props.isQuizContentLocked,
|
|
113
101
|
shouldRenderEdit: !this.props.isQuizContentLocked,
|
|
114
102
|
shouldRenderDelete: !this.props.isQuizContentLocked
|
|
115
|
-
})),
|
|
103
|
+
})), (0, _emotion.jsx)("div", {
|
|
116
104
|
role: "presentation",
|
|
117
105
|
onClick: this.props.isQuizContentLocked ? null : this.switchOnEditing,
|
|
118
|
-
|
|
119
|
-
|
|
106
|
+
css: this.props.styles.stimulusContent,
|
|
107
|
+
"data-testid": "stimulus-content"
|
|
108
|
+
}, (0, _emotion.jsx)(_index.default, {
|
|
120
109
|
stimulus: this.props.stimulus
|
|
121
110
|
}))));
|
|
122
111
|
}
|
|
@@ -135,7 +124,8 @@ var StimulusShow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
135
124
|
shouldDisableDragHandle: _propTypes.default.bool,
|
|
136
125
|
stimulus: _reactImmutableProptypes.default.record.isRequired,
|
|
137
126
|
switchOnEditing: _propTypes.default.func.isRequired,
|
|
138
|
-
shouldFocusOnMount: _propTypes.default.bool.isRequired
|
|
127
|
+
shouldFocusOnMount: _propTypes.default.bool.isRequired,
|
|
128
|
+
styles: _propTypes.default.object
|
|
139
129
|
}, _class2.defaultProps = {
|
|
140
130
|
isBankedContent: false,
|
|
141
131
|
isQuizContentLocked: false,
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
stimulus: {
|
|
11
|
+
paddingTop: componentTheme.stimulusPadding,
|
|
12
|
+
paddingBottom: componentTheme.stimulusPadding
|
|
13
|
+
},
|
|
14
|
+
header: {
|
|
15
|
+
height: '1rem',
|
|
16
|
+
paddingLeft: componentTheme.headerPadding,
|
|
17
|
+
paddingRight: componentTheme.headerPadding,
|
|
18
|
+
display: 'flex',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
justifyContent: 'space-between'
|
|
21
|
+
},
|
|
22
|
+
leftHeader: {
|
|
23
|
+
display: 'flex',
|
|
24
|
+
overflow: 'hidden'
|
|
25
|
+
},
|
|
26
|
+
stimulusLabel: {
|
|
27
|
+
color: componentTheme.stimulusLabelColor,
|
|
28
|
+
fontSize: componentTheme.stimulusLabelFontSize,
|
|
29
|
+
margin: "0 ".concat(componentTheme.stimulusLabelMargin),
|
|
30
|
+
overflow: 'hidden',
|
|
31
|
+
textOverflow: 'ellipsis'
|
|
32
|
+
},
|
|
33
|
+
stimulusContent: {
|
|
34
|
+
height: '10%0',
|
|
35
|
+
padding: "".concat(componentTheme.stimulusContentPaddingTop, " ").concat(componentTheme.stimulusContentPaddingLeftRight, " ").concat(componentTheme.stimulusContentPaddingBottom)
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var _default = generateStyle;
|
|
41
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var spacing = _ref.spacing,
|
|
10
10
|
typography = _ref.typography,
|
|
11
11
|
colors = _ref.colors;
|
|
@@ -19,4 +19,7 @@ function generator(_ref) {
|
|
|
19
19
|
stimulusContentPaddingBottom: spacing.small,
|
|
20
20
|
stimulusContentPaddingLeftRight: spacing.small
|
|
21
21
|
};
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var _default = generateComponentTheme;
|
|
25
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.10.1-rc.
|
|
3
|
+
"version": "20.10.1-rc.7+c0ed1ff3f",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@instructure/emotion": "^8.51.0",
|
|
45
45
|
"@instructure/grading-utils": "^1.0.0",
|
|
46
46
|
"@instructure/outcomes-ui": "^3.1.0",
|
|
47
|
-
"@instructure/quiz-common": "20.10.1-rc.
|
|
48
|
-
"@instructure/quiz-i18n": "20.10.1-rc.
|
|
49
|
-
"@instructure/quiz-interactions": "20.10.1-rc.
|
|
50
|
-
"@instructure/quiz-number-input": "20.10.1-rc.
|
|
51
|
-
"@instructure/quiz-rce": "20.10.1-rc.
|
|
47
|
+
"@instructure/quiz-common": "20.10.1-rc.7+c0ed1ff3f",
|
|
48
|
+
"@instructure/quiz-i18n": "20.10.1-rc.7+c0ed1ff3f",
|
|
49
|
+
"@instructure/quiz-interactions": "20.10.1-rc.7+c0ed1ff3f",
|
|
50
|
+
"@instructure/quiz-number-input": "20.10.1-rc.7+c0ed1ff3f",
|
|
51
|
+
"@instructure/quiz-rce": "20.10.1-rc.7+c0ed1ff3f",
|
|
52
52
|
"@instructure/ui-a11y-content": "^8.51.0",
|
|
53
53
|
"@instructure/ui-alerts": "^8.51.0",
|
|
54
54
|
"@instructure/ui-avatar": "^8.51.0",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"file-saver": "~2.0.5",
|
|
113
113
|
"humps": "^2.0.0",
|
|
114
114
|
"immutable": "^3.8.1",
|
|
115
|
-
"instructure-validations": "20.10.1-rc.
|
|
115
|
+
"instructure-validations": "20.10.1-rc.7+c0ed1ff3f",
|
|
116
116
|
"ipaddr.js": "^1.5.4",
|
|
117
117
|
"isomorphic-fetch": "^2.2.0",
|
|
118
118
|
"isuuid": "^0.1.0",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"intl": "^1.2.4",
|
|
164
164
|
"jquery": "^2.2.3",
|
|
165
165
|
"most-subject": "^5.3.0",
|
|
166
|
-
"quiz-presets": "20.10.1-rc.
|
|
166
|
+
"quiz-presets": "20.10.1-rc.7+c0ed1ff3f",
|
|
167
167
|
"react": "^16.8.6",
|
|
168
168
|
"react-addons-test-utils": "^15.6.2",
|
|
169
169
|
"react-dom": "^16.8.6",
|
|
@@ -179,5 +179,5 @@
|
|
|
179
179
|
"publishConfig": {
|
|
180
180
|
"access": "public"
|
|
181
181
|
},
|
|
182
|
-
"gitHead": "
|
|
182
|
+
"gitHead": "c0ed1ff3f93fd948f16d8073e223cbb46dab4a74"
|
|
183
183
|
}
|