@instructure/quiz-core 20.1.0 → 20.1.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/banks/components/BankEntry/presenter.js +43 -56
- package/es/banks/components/BankEntry/styles.js +65 -0
- package/es/banks/components/BankEntry/theme.js +4 -2
- package/es/banks/components/BankEntryRow/presenter.js +55 -65
- package/es/banks/components/BankEntryRow/styles.js +50 -0
- package/es/banks/components/BankEntryRow/theme.js +4 -2
- package/lib/banks/components/BankEntry/presenter.js +41 -57
- package/lib/banks/components/BankEntry/styles.js +75 -0
- package/lib/banks/components/BankEntry/theme.js +6 -3
- package/lib/banks/components/BankEntryRow/presenter.js +54 -69
- package/lib/banks/components/BankEntryRow/styles.js +58 -0
- package/lib/banks/components/BankEntryRow/theme.js +6 -3
- package/package.json +10 -10
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -21,7 +19,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
21
19
|
|
|
22
20
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
23
21
|
|
|
24
|
-
var _react =
|
|
22
|
+
var _react = require("react");
|
|
25
23
|
|
|
26
24
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
27
25
|
|
|
@@ -57,7 +55,7 @@ var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
|
57
55
|
|
|
58
56
|
var _uiTextInput = require("@instructure/ui-text-input");
|
|
59
57
|
|
|
60
|
-
var
|
|
58
|
+
var _emotion = require("@instructure/emotion");
|
|
61
59
|
|
|
62
60
|
var _index = _interopRequireDefault(require("../../../common/components/resources/entry/EntrySave/index.js"));
|
|
63
61
|
|
|
@@ -91,31 +89,15 @@ var _index10 = _interopRequireDefault(require("../NavWrapper/index.js"));
|
|
|
91
89
|
|
|
92
90
|
var _quizCommon = require("@instructure/quiz-common");
|
|
93
91
|
|
|
92
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
93
|
+
|
|
94
94
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
95
95
|
|
|
96
96
|
var _dec, _class, _class2, _temp;
|
|
97
97
|
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return "\n\n.dhhIK_caGd{background-color:".concat(theme.contentBackgroundColor || 'inherit', ";padding:").concat(theme.contentPaddingTopBottom || 'inherit', " ").concat(theme.contentPaddingLeftRight || 'inherit', "}\n\n.dhhIK_blfJ{margin-bottom:").concat(theme.entryRowMargin || 'inherit', "}\n\n.dhhIK_dlpV{color:").concat(theme.headerRowColor || 'inherit', ";flex-direction:row;justify-content:space-between;padding:").concat(theme.headerRowPadding || 'inherit', "}\n\n.dhhIK_dlpV,.dhhIK_cKlw{align-items:flex-start;display:flex}\n\n.dhhIK_cKlw{flex:0 0 auto;flex-direction:column;margin-right:").concat(theme.leftHeaderMargin || 'inherit', "}\n\n.dhhIK_fAhB{font-size:").concat(theme.headerTextFontSize || 'inherit', "}\n\n.dhhIK_fsuY{align-items:center;background-color:").concat(theme.headerBackgroundColor || 'inherit', ";color:").concat(theme.headerColor || 'inherit', ";display:flex;justify-content:space-between;padding:").concat(theme.headerPaddingTopBottom || 'inherit', " ").concat(theme.headerPaddingLeftRight || 'inherit', ";vertical-align:middle}\n\n.dhhIK_IoDT{padding-left:").concat(theme.rightHeaderPaddingLeft || 'inherit', ";text-align:right}\n\n[dir=ltr] .dhhIK_IoDT,[dir=rtl] .dhhIK_IoDT{text-align:right}\n\n.dhhIK_cjWK,.dhhIK_bVuu,.dhhIK_ekxs{display:flex;flex-direction:row}\n\n.dhhIK_cjWK{padding-bottom:").concat(theme.footerPaddingBottom || 'inherit', ";padding-top:").concat(theme.footerPaddingTop || 'inherit', ";text-align:left}\n\n[dir=ltr] .dhhIK_cjWK,[dir=rtl] .dhhIK_cjWK{text-align:left}\n\n.dhhIK_ekxs{flex:8 0 0;justify-content:flex-end;padding-left:").concat(theme.rightFooterPaddingLeftRight || 'inherit', ";padding-right:").concat(theme.rightFooterPaddingLeftRight || 'inherit', "}\n\n.dhhIK_eNDu{border-bottom:").concat(theme.entryEditBorderWidth || 'inherit', " solid ").concat(theme.entryEditBorderColor || 'inherit', "}");
|
|
102
|
-
},
|
|
103
|
-
'content': 'dhhIK_caGd',
|
|
104
|
-
'entryRow': 'dhhIK_blfJ',
|
|
105
|
-
'headerRow': 'dhhIK_dlpV',
|
|
106
|
-
'leftHeader': 'dhhIK_cKlw',
|
|
107
|
-
'headerText': 'dhhIK_fAhB',
|
|
108
|
-
'header': 'dhhIK_fsuY',
|
|
109
|
-
'rightHeader': 'dhhIK_IoDT',
|
|
110
|
-
'footer': 'dhhIK_cjWK',
|
|
111
|
-
'leftFooter': 'dhhIK_bVuu',
|
|
112
|
-
'rightFooter': 'dhhIK_ekxs',
|
|
113
|
-
'entryEdit': 'dhhIK_eNDu'
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
var _ref3 = /*#__PURE__*/_react.default.createElement(_Spinner.default, null);
|
|
117
|
-
|
|
118
|
-
var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
98
|
+
var _ref3 = (0, _emotion.jsx)(_Spinner.default, null);
|
|
99
|
+
|
|
100
|
+
var BankEntry = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
119
101
|
(0, _inherits2.default)(BankEntry, _Component);
|
|
120
102
|
|
|
121
103
|
var _super = (0, _createSuper2.default)(BankEntry);
|
|
@@ -362,17 +344,17 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
362
344
|
returnToUrl = _this$props.returnToUrl,
|
|
363
345
|
bank = _this$props.bank;
|
|
364
346
|
var isScopeEmpty = !Object.keys(scope).length;
|
|
365
|
-
return
|
|
347
|
+
return (0, _emotion.jsx)(_index10.default, {
|
|
366
348
|
closeTray: closeTray,
|
|
367
349
|
navigateToBanks: navigateToBanks,
|
|
368
350
|
navigateToBuild: navigateToBuild,
|
|
369
351
|
returnToUrl: isScopeEmpty ? null : returnToUrl,
|
|
370
352
|
canvasReferrerLinkText: isScopeEmpty ? null : scope.title
|
|
371
|
-
},
|
|
353
|
+
}, (0, _emotion.jsx)(_uiBreadcrumb.BreadcrumbLink, {
|
|
372
354
|
key: "bank",
|
|
373
355
|
onClick: this.navigateToBank,
|
|
374
356
|
ref: this.setNavToBankRef
|
|
375
|
-
}, bank.title),
|
|
357
|
+
}, bank.title), (0, _emotion.jsx)(_uiBreadcrumb.BreadcrumbLink, {
|
|
376
358
|
key: "bankEntry"
|
|
377
359
|
}, this.entryLinkName()));
|
|
378
360
|
}
|
|
@@ -380,8 +362,8 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
380
362
|
key: "renderTitle",
|
|
381
363
|
value: function renderTitle(entry) {
|
|
382
364
|
if (this.isItemEntry()) {
|
|
383
|
-
return
|
|
384
|
-
renderLabel:
|
|
365
|
+
return (0, _emotion.jsx)(_uiTextInput.TextInput, {
|
|
366
|
+
renderLabel: (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Edit question title')),
|
|
385
367
|
type: "text",
|
|
386
368
|
placeholder: (0, _formatMessage.default)('Question Title'),
|
|
387
369
|
onChange: this.handleTitleChange,
|
|
@@ -403,18 +385,18 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
403
385
|
var itemIdentifier = this.isTemporary() ? tempIdentifier : identifier;
|
|
404
386
|
var entryName = this.isItemEntry() ? entry.getInteractionType().name : (0, _formatMessage.default)('Stimulus');
|
|
405
387
|
var separator = ' | ';
|
|
406
|
-
return
|
|
407
|
-
|
|
408
|
-
},
|
|
409
|
-
|
|
410
|
-
},
|
|
411
|
-
|
|
412
|
-
},
|
|
388
|
+
return (0, _emotion.jsx)("div", {
|
|
389
|
+
css: this.props.styles.header
|
|
390
|
+
}, (0, _emotion.jsx)("div", {
|
|
391
|
+
css: this.props.styles.leftHeader
|
|
392
|
+
}, (0, _emotion.jsx)("div", {
|
|
393
|
+
css: this.props.styles.headerText
|
|
394
|
+
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
413
395
|
level: "reset",
|
|
414
396
|
as: "h2"
|
|
415
|
-
}, entryName,
|
|
416
|
-
|
|
417
|
-
},
|
|
397
|
+
}, entryName, (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, separator), itemIdentifier))), this.renderTitle(entry), (0, _emotion.jsx)("div", {
|
|
398
|
+
css: this.props.styles.rightHeader
|
|
399
|
+
}, (0, _emotion.jsx)(_index.default, props)));
|
|
418
400
|
}
|
|
419
401
|
}, {
|
|
420
402
|
key: "hasPendingTagModifications",
|
|
@@ -596,7 +578,7 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
596
578
|
text = (0, _formatMessage.default)('Edit Question Level Feedback');
|
|
597
579
|
}
|
|
598
580
|
|
|
599
|
-
return
|
|
581
|
+
return (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
600
582
|
onClick: this.openFeedbackModal,
|
|
601
583
|
withBackground: false,
|
|
602
584
|
withBorder: false,
|
|
@@ -659,7 +641,7 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
659
641
|
var entryId = this.getBankEntryId(bankEntry);
|
|
660
642
|
|
|
661
643
|
var tags = function tags() {
|
|
662
|
-
return
|
|
644
|
+
return (0, _emotion.jsx)(_index8.default, {
|
|
663
645
|
allowNewTags: true,
|
|
664
646
|
noMatchText: (0, _formatMessage.default)('Enter a tag to find or create'),
|
|
665
647
|
parentType: entryType,
|
|
@@ -670,20 +652,20 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
670
652
|
};
|
|
671
653
|
|
|
672
654
|
var editWarning = this.isItemEntry() ? (0, _formatMessage.default)('Edits made here will appear on any assessment using this question.') : (0, _formatMessage.default)('Edits made here will appear on any assessment using this stimulus.');
|
|
673
|
-
return
|
|
674
|
-
|
|
675
|
-
},
|
|
655
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
|
|
656
|
+
css: this.props.styles.entryEdit
|
|
657
|
+
}, (0, _emotion.jsx)(_index9.default, versioningProps, canEdit && (0, _emotion.jsx)(_uiAlerts.Alert, {
|
|
676
658
|
renderCloseButtonLabel: (0, _formatMessage.default)('Dismiss'),
|
|
677
659
|
margin: "0 0 medium 0"
|
|
678
|
-
},
|
|
660
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
679
661
|
color: "primary"
|
|
680
|
-
}, editWarning)),
|
|
681
|
-
|
|
682
|
-
},
|
|
683
|
-
|
|
684
|
-
}, this.renderFeedbackSection()),
|
|
685
|
-
|
|
686
|
-
},
|
|
662
|
+
}, editWarning)), (0, _emotion.jsx)(EntryComponent, props), useBankTags && tags())), (0, _emotion.jsx)("div", {
|
|
663
|
+
css: this.props.styles.footer
|
|
664
|
+
}, (0, _emotion.jsx)("div", {
|
|
665
|
+
css: this.props.styles.leftFooter
|
|
666
|
+
}, this.renderFeedbackSection()), (0, _emotion.jsx)("div", {
|
|
667
|
+
css: this.props.styles.rightFooter
|
|
668
|
+
}, (0, _emotion.jsx)(_index.default, props))));
|
|
687
669
|
}
|
|
688
670
|
}, {
|
|
689
671
|
key: "render",
|
|
@@ -694,9 +676,9 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
694
676
|
return _ref3;
|
|
695
677
|
}
|
|
696
678
|
|
|
697
|
-
return
|
|
698
|
-
|
|
699
|
-
}, this.renderHeader(entry), this.renderEntry(entry), !this.props.isCompact &&
|
|
679
|
+
return (0, _emotion.jsx)(_index5.default, null, this.renderNav(), (0, _emotion.jsx)("div", {
|
|
680
|
+
css: this.props.styles.content
|
|
681
|
+
}, this.renderHeader(entry), this.renderEntry(entry), !this.props.isCompact && (0, _emotion.jsx)(_index3.default, {
|
|
700
682
|
parentId: this.props.bankId,
|
|
701
683
|
parentType: _quizCommon.PARENT_TYPE_BANK
|
|
702
684
|
})));
|
|
@@ -748,7 +730,9 @@ var BankEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
748
730
|
tagInput: _propTypes.default.string,
|
|
749
731
|
updateItem: _propTypes.default.func.isRequired,
|
|
750
732
|
updateStimulus: _propTypes.default.func.isRequired,
|
|
751
|
-
useBankTags: _propTypes.default.bool
|
|
733
|
+
useBankTags: _propTypes.default.bool,
|
|
734
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
735
|
+
styles: _propTypes.default.object
|
|
752
736
|
}, _class2.defaultProps = {
|
|
753
737
|
closeTray: function closeTray() {},
|
|
754
738
|
entry: null,
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
13
|
+
var footerStyles = {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
flexDirection: 'row'
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
content: {
|
|
19
|
+
padding: "".concat(componentTheme.contentPaddingTopBottom, " ").concat(componentTheme.contentPaddingLeftRight),
|
|
20
|
+
backgroundColor: componentTheme.contentBackgroundColor
|
|
21
|
+
},
|
|
22
|
+
entryRow: {
|
|
23
|
+
marginBottom: componentTheme.entryRowMargin
|
|
24
|
+
},
|
|
25
|
+
headerRow: {
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'row',
|
|
28
|
+
justifyContent: 'space-between',
|
|
29
|
+
alignItems: 'flex-start',
|
|
30
|
+
color: componentTheme.headerRowColor,
|
|
31
|
+
padding: componentTheme.headerRowPadding
|
|
32
|
+
},
|
|
33
|
+
leftHeader: {
|
|
34
|
+
flex: '0 0 auto',
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
alignItems: 'flex-start',
|
|
38
|
+
marginRight: componentTheme.leftHeaderMargin
|
|
39
|
+
},
|
|
40
|
+
headerText: {
|
|
41
|
+
fontSize: componentTheme.headerTextFontSize
|
|
42
|
+
},
|
|
43
|
+
header: {
|
|
44
|
+
backgroundColor: componentTheme.headerBackgroundColor,
|
|
45
|
+
color: componentTheme.headerColor,
|
|
46
|
+
padding: "".concat(componentTheme.headerPaddingTopBottom, " ").concat(componentTheme.headerPaddingLeftRight),
|
|
47
|
+
display: 'flex',
|
|
48
|
+
justifyContent: 'space-between',
|
|
49
|
+
verticalAlign: 'middle',
|
|
50
|
+
alignItems: 'center'
|
|
51
|
+
},
|
|
52
|
+
rightHeader: {
|
|
53
|
+
textAlign: 'right',
|
|
54
|
+
paddingLeft: componentTheme.rightHeaderPaddingLeft
|
|
55
|
+
},
|
|
56
|
+
footer: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, footerStyles), {}, {
|
|
57
|
+
textAlign: 'left',
|
|
58
|
+
paddingBottom: componentTheme.footerPaddingBottom,
|
|
59
|
+
paddingTop: componentTheme.footerPaddingTop
|
|
60
|
+
}),
|
|
61
|
+
leftFooter: footerStyles,
|
|
62
|
+
rightFooter: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, footerStyles), {}, {
|
|
63
|
+
flex: '8 0 0',
|
|
64
|
+
justifyContent: 'flex-end',
|
|
65
|
+
paddingLeft: componentTheme.rightFooterPaddingLeftRight,
|
|
66
|
+
paddingRight: componentTheme.rightFooterPaddingLeftRight
|
|
67
|
+
}),
|
|
68
|
+
entryEdit: {
|
|
69
|
+
borderBottom: "".concat(componentTheme.entryEditBorderWidth, " solid ").concat(componentTheme.entryEditBorderColor)
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
var _default = generateStyle;
|
|
75
|
+
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
|
colors = _ref.colors,
|
|
11
11
|
typography = _ref.typography,
|
|
@@ -28,4 +28,7 @@ function generator(_ref) {
|
|
|
28
28
|
entryEditBorderWidth: borders.widthSmall,
|
|
29
29
|
entryEditBorderColor: colors.tiara
|
|
30
30
|
};
|
|
31
|
-
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var _default = generateComponentTheme;
|
|
34
|
+
exports.default = _default;
|
|
@@ -23,8 +23,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
23
23
|
|
|
24
24
|
var _partial = _interopRequireDefault(require("lodash/partial"));
|
|
25
25
|
|
|
26
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
27
|
-
|
|
28
26
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
29
27
|
|
|
30
28
|
var _immutable = _interopRequireDefault(require("immutable"));
|
|
@@ -43,12 +41,12 @@ var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
|
43
41
|
|
|
44
42
|
var _uiAlerts = require("@instructure/ui-alerts");
|
|
45
43
|
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
var _quizRce = require("@instructure/quiz-rce");
|
|
44
|
+
var _emotion = require("@instructure/emotion");
|
|
49
45
|
|
|
50
46
|
var _quizCommon = require("@instructure/quiz-common");
|
|
51
47
|
|
|
48
|
+
var _quizRce = require("@instructure/quiz-rce");
|
|
49
|
+
|
|
52
50
|
var _quizInteractions = require("@instructure/quiz-interactions");
|
|
53
51
|
|
|
54
52
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
@@ -67,30 +65,15 @@ var _index4 = _interopRequireDefault(require("../../../common/components/resourc
|
|
|
67
65
|
|
|
68
66
|
var _index5 = _interopRequireDefault(require("../../../common/components/shared/TagDisplay/index.js"));
|
|
69
67
|
|
|
68
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
69
|
+
|
|
70
70
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
71
71
|
|
|
72
72
|
var _dec, _class, _class2, _temp;
|
|
73
73
|
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return "\n\n.eQXFj_IXXK{padding:".concat(theme.entryDetailPadding || 'inherit', "}\n\n.eQXFj_dlpV{align-items:flex-start;color:").concat(theme.headerRowColor || 'inherit', ";display:flex;flex-direction:row;justify-content:space-between}\n\n.eQXFj_exDh{display:inline-flex;position:relative;z-index:").concat(theme.buttonsZIndex || 'inherit', "}\n\n.eQXFj_bTHH{border-left:").concat(theme.expandButtonContainerBorderWidth || 'inherit', " solid ").concat(theme.expandButtonContainerBorderColor || 'inherit', "}\n\n.eQXFj_AHIw{display:block}\n\n.eQXFj_eTBd{margin-bottom:").concat(theme.deletePrefaceMargin || 'inherit', "}\n\n.eQXFj_ftIe{margin-bottom:").concat(theme.addButtonMargin || 'inherit', "}\n\n.eQXFj_fAhB{color:").concat(theme.headerTextColor || 'inherit', ";font-size:").concat(theme.headerTextFontSize || 'inherit', "}\n\n.eQXFj_cloC{font-size:").concat(theme.stemFontSize || 'inherit', ";line-height:").concat(theme.stemLineHeight || 'inherit', ";overflow-x:auto}\n\n.eQXFj_cloC p{margin:0}\n\n.eQXFj_cjWK{border-top:").concat(theme.footerBorderWidth || 'inherit', " solid ").concat(theme.footerBorderColor || 'inherit', ";font-size:").concat(theme.footerFontSize || 'inherit', ";padding:").concat(theme.footerPadding || 'inherit', "}");
|
|
78
|
-
},
|
|
79
|
-
'entryDetail': 'eQXFj_IXXK',
|
|
80
|
-
'headerRow': 'eQXFj_dlpV',
|
|
81
|
-
'buttons': 'eQXFj_exDh',
|
|
82
|
-
'expandButtonContainer': 'eQXFj_bTHH',
|
|
83
|
-
'deleteAlert': 'eQXFj_AHIw',
|
|
84
|
-
'deletePreface': 'eQXFj_eTBd',
|
|
85
|
-
'addButton': 'eQXFj_ftIe',
|
|
86
|
-
'headerText': 'eQXFj_fAhB',
|
|
87
|
-
'stem': 'eQXFj_cloC',
|
|
88
|
-
'footer': 'eQXFj_cjWK'
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
var _ref2 = /*#__PURE__*/_react.default.createElement("div", null);
|
|
92
|
-
|
|
93
|
-
var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
|
|
74
|
+
var _ref2 = (0, _emotion.jsx)("div", null);
|
|
75
|
+
|
|
76
|
+
var BankEntryRow = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
|
|
94
77
|
(0, _inherits2.default)(BankEntryRow, _withI18nSupport);
|
|
95
78
|
|
|
96
79
|
var _super = (0, _createSuper2.default)(BankEntryRow);
|
|
@@ -112,21 +95,20 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
112
95
|
|
|
113
96
|
_this.deleteBankEntry = function () {
|
|
114
97
|
var deletePreface = _this.isItemEntry() ? (0, _formatMessage.default)('Deleting this question:') : (0, _formatMessage.default)('Deleting this stimulus:');
|
|
115
|
-
|
|
116
|
-
var confirmBody = /*#__PURE__*/_react.default.createElement(_uiAlerts.Alert, {
|
|
98
|
+
var confirmBody = (0, _emotion.jsx)(_uiAlerts.Alert, {
|
|
117
99
|
variant: "error",
|
|
118
100
|
padding: "0"
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
}, deletePreface),
|
|
101
|
+
}, (0, _emotion.jsx)("div", {
|
|
102
|
+
css: _this.props.styles.deleteAlert
|
|
103
|
+
}, (0, _emotion.jsx)("div", {
|
|
104
|
+
css: _this.props.styles.deletePreface
|
|
105
|
+
}, deletePreface), (0, _emotion.jsx)(_uiList.List, null, (0, _emotion.jsx)(_uiList.List.Item, null, _formatMessage.default.rich('will <0>NOT</0> remove it from any assessments', [function (_ref) {
|
|
124
106
|
var children = _ref.children;
|
|
125
|
-
return
|
|
107
|
+
return (0, _emotion.jsx)(_uiText.Text, {
|
|
126
108
|
weight: "bold",
|
|
127
109
|
key: "0"
|
|
128
110
|
}, children);
|
|
129
|
-
}])),
|
|
111
|
+
}])), (0, _emotion.jsx)(_uiList.List.Item, null, (0, _formatMessage.default)('will lose its statistical link in reporting')), (0, _emotion.jsx)(_uiList.List.Item, null, (0, _formatMessage.default)('will remove access for all users with whom this bank has been shared')))));
|
|
130
112
|
|
|
131
113
|
_this.props.withConfirm((0, _partial.default)(_this.props.removeBankEntry, _this.props.bank.id, _this.props.bankEntry.id), {
|
|
132
114
|
title: (0, _formatMessage.default)('Delete {type}', {
|
|
@@ -179,7 +161,7 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
179
161
|
var title = (0, _formatMessage.default)('Delete {type}', {
|
|
180
162
|
type: _this.type()
|
|
181
163
|
});
|
|
182
|
-
return
|
|
164
|
+
return (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
183
165
|
size: "medium",
|
|
184
166
|
withBackground: false,
|
|
185
167
|
withBorder: false,
|
|
@@ -248,12 +230,13 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
248
230
|
}) : (0, _formatMessage.default)('Expand {type} details', {
|
|
249
231
|
type: type
|
|
250
232
|
});
|
|
251
|
-
return
|
|
252
|
-
|
|
253
|
-
},
|
|
233
|
+
return (0, _emotion.jsx)("div", {
|
|
234
|
+
css: this.props.styles.expandButtonContainer
|
|
235
|
+
}, (0, _emotion.jsx)(_index2.default, {
|
|
254
236
|
onClick: this.props.toggleExpanded,
|
|
255
237
|
title: title,
|
|
256
|
-
isExpanded: this.props.isExpanded
|
|
238
|
+
isExpanded: this.props.isExpanded,
|
|
239
|
+
"data-automation": "expand-bank-question-button"
|
|
257
240
|
}));
|
|
258
241
|
}
|
|
259
242
|
}, {
|
|
@@ -263,9 +246,9 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
263
246
|
var title = (0, _formatMessage.default)('Add {type} to this quiz', {
|
|
264
247
|
type: this.type()
|
|
265
248
|
});
|
|
266
|
-
return
|
|
267
|
-
|
|
268
|
-
},
|
|
249
|
+
return (0, _emotion.jsx)("div", {
|
|
250
|
+
css: [this.props.styles.buttons, this.props.styles.addButton]
|
|
251
|
+
}, (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
269
252
|
color: "primary",
|
|
270
253
|
shape: "circle",
|
|
271
254
|
size: "small",
|
|
@@ -285,7 +268,7 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
285
268
|
key: "renderMoveButton",
|
|
286
269
|
value: function renderMoveButton() {
|
|
287
270
|
var title = this.moveModalTitle();
|
|
288
|
-
return
|
|
271
|
+
return (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
289
272
|
ref: this.storeCopyMoveBankEntryButtonRef,
|
|
290
273
|
size: "medium",
|
|
291
274
|
withBackground: false,
|
|
@@ -306,16 +289,16 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
306
289
|
key: "renderHeader",
|
|
307
290
|
value: function renderHeader() {
|
|
308
291
|
var separator = ' | ';
|
|
309
|
-
return
|
|
310
|
-
|
|
311
|
-
}, this.renderAddButton(),
|
|
312
|
-
|
|
313
|
-
}, this.props.bank.canEdit() &&
|
|
314
|
-
|
|
315
|
-
},
|
|
292
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
|
|
293
|
+
css: this.props.styles.headerRow
|
|
294
|
+
}, this.renderAddButton(), (0, _emotion.jsx)("div", {
|
|
295
|
+
css: this.props.styles.buttons
|
|
296
|
+
}, this.props.bank.canEdit() && (0, _emotion.jsx)(_react.default.Fragment, null, this.renderEditButton(), this.renderMoveButton(), this.renderTrashButton()), this.renderExpandButton())), (0, _emotion.jsx)("div", {
|
|
297
|
+
css: this.props.styles.headerText
|
|
298
|
+
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
316
299
|
level: "reset",
|
|
317
300
|
as: "h2"
|
|
318
|
-
}, this.entryHeader(),
|
|
301
|
+
}, this.entryHeader(), (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, separator), this.entryIdentifier())));
|
|
319
302
|
}
|
|
320
303
|
}, {
|
|
321
304
|
key: "renderEntryCollapsed",
|
|
@@ -324,13 +307,13 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
324
307
|
// or title plain text
|
|
325
308
|
|
|
326
309
|
if (itemOrStimulus.itemBody) {
|
|
327
|
-
return
|
|
328
|
-
customStyles: styles.stem,
|
|
310
|
+
return (0, _emotion.jsx)(_quizRce.RichContentRendererEmotion, {
|
|
311
|
+
customStyles: this.props.styles.stem,
|
|
329
312
|
content: itemOrStimulus.itemBody
|
|
330
313
|
});
|
|
331
314
|
} else {
|
|
332
|
-
return
|
|
333
|
-
|
|
315
|
+
return (0, _emotion.jsx)("div", {
|
|
316
|
+
css: this.props.styles.stem
|
|
334
317
|
}, itemOrStimulus.title);
|
|
335
318
|
}
|
|
336
319
|
}
|
|
@@ -340,12 +323,12 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
340
323
|
var entry = this.getEntry();
|
|
341
324
|
|
|
342
325
|
if (this.isItemEntry()) {
|
|
343
|
-
return
|
|
326
|
+
return (0, _emotion.jsx)(_index3.default, {
|
|
344
327
|
entry: entry,
|
|
345
328
|
guid: this.props.bankEntry.id
|
|
346
329
|
});
|
|
347
330
|
} else {
|
|
348
|
-
return
|
|
331
|
+
return (0, _emotion.jsx)(_index4.default, {
|
|
349
332
|
stimulus: entry
|
|
350
333
|
});
|
|
351
334
|
}
|
|
@@ -356,7 +339,7 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
356
339
|
var title = (0, _formatMessage.default)('Edit {type}', {
|
|
357
340
|
type: this.type()
|
|
358
341
|
});
|
|
359
|
-
return
|
|
342
|
+
return (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
360
343
|
ref: this.storeEditButtonRef,
|
|
361
344
|
size: "medium",
|
|
362
345
|
withBackground: false,
|
|
@@ -375,7 +358,7 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
375
358
|
return null;
|
|
376
359
|
}
|
|
377
360
|
|
|
378
|
-
return
|
|
361
|
+
return (0, _emotion.jsx)(_index5.default, {
|
|
379
362
|
tagAssociations: this.props.tagAssociations
|
|
380
363
|
});
|
|
381
364
|
}
|
|
@@ -385,7 +368,7 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
385
368
|
var lastUpdate = _formatMessage.default.rich('<0>Last Update</0> { updatedAt }', {
|
|
386
369
|
0: function _(_ref3) {
|
|
387
370
|
var children = _ref3.children;
|
|
388
|
-
return
|
|
371
|
+
return (0, _emotion.jsx)(_uiText.Text, {
|
|
389
372
|
key: "lastUpdate",
|
|
390
373
|
weight: "bold",
|
|
391
374
|
color: "primary"
|
|
@@ -394,24 +377,24 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
394
377
|
updatedAt: this.formatDatetimeMedium(this.props.bankEntry.get('updatedAt'))
|
|
395
378
|
});
|
|
396
379
|
|
|
397
|
-
return
|
|
398
|
-
|
|
399
|
-
},
|
|
380
|
+
return (0, _emotion.jsx)("div", {
|
|
381
|
+
css: this.props.styles.footer
|
|
382
|
+
}, (0, _emotion.jsx)("span", null, lastUpdate), this.renderTags());
|
|
400
383
|
}
|
|
401
384
|
}, {
|
|
402
385
|
key: "render",
|
|
403
386
|
value: function render() {
|
|
404
387
|
var isExpanded = this.props.isExpanded;
|
|
405
|
-
return
|
|
388
|
+
return (0, _emotion.jsx)(_Overlay.default, {
|
|
406
389
|
onClick: this.props.toggleExpanded,
|
|
407
390
|
tabIndex: "-1",
|
|
408
391
|
ariaLabel: this.entryIdentifier()
|
|
409
|
-
},
|
|
392
|
+
}, (0, _emotion.jsx)("div", {
|
|
410
393
|
role: "group"
|
|
411
|
-
},
|
|
412
|
-
|
|
394
|
+
}, (0, _emotion.jsx)("div", {
|
|
395
|
+
css: this.props.styles.entryDetail,
|
|
413
396
|
"data-automation": "sdk-bankEntryItem"
|
|
414
|
-
}, this.renderHeader(), isExpanded ? this.renderEntryExpanded() : this.renderEntryCollapsed()), isExpanded && this.renderFooter()),
|
|
397
|
+
}, this.renderHeader(), isExpanded ? this.renderEntryExpanded() : this.renderEntryCollapsed()), isExpanded && this.renderFooter()), (0, _emotion.jsx)(_index.default, {
|
|
415
398
|
createEntry: this.createEntryForBank,
|
|
416
399
|
label: this.moveModalTitle(),
|
|
417
400
|
sourceBankId: this.props.bank.id,
|
|
@@ -446,7 +429,9 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
446
429
|
toggleExpanded: _propTypes.default.func.isRequired,
|
|
447
430
|
withConfirm: _propTypes.default.func.isRequired,
|
|
448
431
|
locale: _propTypes.default.string,
|
|
449
|
-
timezone: _propTypes.default.string
|
|
432
|
+
timezone: _propTypes.default.string,
|
|
433
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
434
|
+
styles: _propTypes.default.object
|
|
450
435
|
}, _class2.defaultProps = {
|
|
451
436
|
activeQuizId: null,
|
|
452
437
|
addEntryToQuiz: null,
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
entryDetail: {
|
|
11
|
+
padding: componentTheme.entryDetailPadding
|
|
12
|
+
},
|
|
13
|
+
headerRow: {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
flexDirection: 'row',
|
|
16
|
+
justifyContent: 'space-between',
|
|
17
|
+
alignItems: 'flex-start',
|
|
18
|
+
color: componentTheme.headerRowColor
|
|
19
|
+
},
|
|
20
|
+
buttons: {
|
|
21
|
+
position: 'relative',
|
|
22
|
+
display: 'inline-flex',
|
|
23
|
+
zIndex: componentTheme.buttonsZIndex
|
|
24
|
+
},
|
|
25
|
+
expandButtonContainer: {
|
|
26
|
+
borderLeft: "".concat(componentTheme.expandButtonContainerBorderWidth, " solid ").concat(componentTheme.expandButtonContainerBorderColor)
|
|
27
|
+
},
|
|
28
|
+
deleteAlert: {
|
|
29
|
+
display: 'block'
|
|
30
|
+
},
|
|
31
|
+
deletePreface: {
|
|
32
|
+
marginBottom: componentTheme.deletePrefaceMargin
|
|
33
|
+
},
|
|
34
|
+
addButton: {
|
|
35
|
+
marginBottom: componentTheme.addButtonMargin
|
|
36
|
+
},
|
|
37
|
+
headerText: {
|
|
38
|
+
color: componentTheme.headerTextColor,
|
|
39
|
+
fontSize: componentTheme.headerTextFontSize
|
|
40
|
+
},
|
|
41
|
+
stem: {
|
|
42
|
+
overflowX: 'auto',
|
|
43
|
+
fontSize: componentTheme.stemFontSize,
|
|
44
|
+
lineHeight: componentTheme.stemLineHeight,
|
|
45
|
+
'& p': {
|
|
46
|
+
margin: 0
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
footer: {
|
|
50
|
+
padding: componentTheme.footerPadding,
|
|
51
|
+
borderTop: "".concat(componentTheme.footerBorderWidth, " solid ").concat(componentTheme.footerBorderColor),
|
|
52
|
+
fontSize: componentTheme.footerFontSize
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var _default = generateStyle;
|
|
58
|
+
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
|
colors = _ref.colors,
|
|
11
11
|
borders = _ref.borders,
|
|
@@ -27,4 +27,7 @@ function generator(_ref) {
|
|
|
27
27
|
footerFontSize: typography.fontSizeXSmall,
|
|
28
28
|
deletePrefaceMargin: spacing.xxSmall
|
|
29
29
|
};
|
|
30
|
-
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var _default = generateComponentTheme;
|
|
33
|
+
exports.default = _default;
|