@instructure/quiz-core 22.10.0 → 22.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/banks/components/BankEntry/presenter.js +5 -3
- package/es/banks/components/BankEntryRow/presenter.js +4 -3
- package/es/banks/components/HeaderBreadCrumb/index.js +57 -90
- package/es/banks/components/NavWrapper/presenter.js +4 -1
- package/lib/banks/components/BankEntry/presenter.js +4 -2
- package/lib/banks/components/BankEntryRow/presenter.js +4 -3
- package/lib/banks/components/HeaderBreadCrumb/index.js +58 -90
- package/lib/banks/components/NavWrapper/presenter.js +4 -1
- package/package.json +54 -54
|
@@ -38,7 +38,7 @@ import { IconButton } from '@instructure/ui-buttons';
|
|
|
38
38
|
import { Text } from '@instructure/ui-text';
|
|
39
39
|
import { Heading } from '@instructure/ui-heading';
|
|
40
40
|
import { IconDiscussionLine, IconDiscussionSolid } from '@instructure/ui-icons';
|
|
41
|
-
import {
|
|
41
|
+
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
42
42
|
import { jsx } from '@instructure/emotion';
|
|
43
43
|
import { HeaderBreadCrumb } from '../HeaderBreadCrumb';
|
|
44
44
|
import EntrySave from '../../../common/components/resources/entry/EntrySave';
|
|
@@ -406,7 +406,6 @@ export var BankEntry = (_dec = withStyleOverrides(generateStyle, generateCompone
|
|
|
406
406
|
var tempIdentifier = this.getTemporaryIdentifier();
|
|
407
407
|
var itemIdentifier = this.isTemporary() ? tempIdentifier : identifier;
|
|
408
408
|
var entryName = this.getEntryName(entry);
|
|
409
|
-
var separator = ' | ';
|
|
410
409
|
return jsx("div", {
|
|
411
410
|
css: this.props.styles.header
|
|
412
411
|
}, jsx("div", {
|
|
@@ -416,7 +415,10 @@ export var BankEntry = (_dec = withStyleOverrides(generateStyle, generateCompone
|
|
|
416
415
|
}, jsx(Heading, {
|
|
417
416
|
level: "reset",
|
|
418
417
|
as: "h2"
|
|
419
|
-
}, entryName
|
|
418
|
+
}, t('{entryName} | {itemIdentifier}', {
|
|
419
|
+
entryName: entryName,
|
|
420
|
+
itemIdentifier: itemIdentifier
|
|
421
|
+
})))), this.renderTitle(entry), jsx("div", {
|
|
420
422
|
css: this.props.styles.rightHeader
|
|
421
423
|
}, jsx(EntrySave, props)));
|
|
422
424
|
}
|
|
@@ -30,7 +30,6 @@ import { IconButton } from '@instructure/ui-buttons';
|
|
|
30
30
|
import { Text } from '@instructure/ui-text';
|
|
31
31
|
import { List } from '@instructure/ui-list';
|
|
32
32
|
import { Heading } from '@instructure/ui-heading';
|
|
33
|
-
import { PresentationContent } from '@instructure/ui-a11y-content';
|
|
34
33
|
import { Alert } from '@instructure/ui-alerts';
|
|
35
34
|
import { jsx } from '@instructure/emotion';
|
|
36
35
|
import { BUILD_TRAY_POSITION, COPY_MOVE_BANK_ENTRY_MODAL, SET_EDIT_BUTTON_FOCUS, withI18nSupport, withStyleOverrides } from '@instructure/quiz-common';
|
|
@@ -281,7 +280,6 @@ export var BankEntryRow = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
281
280
|
}, {
|
|
282
281
|
key: "renderHeader",
|
|
283
282
|
value: function renderHeader() {
|
|
284
|
-
var separator = ' | ';
|
|
285
283
|
return jsx("div", null, jsx("div", {
|
|
286
284
|
css: this.props.styles.headerRow
|
|
287
285
|
}, this.renderAddButton(), jsx("div", {
|
|
@@ -291,7 +289,10 @@ export var BankEntryRow = (_dec = withStyleOverrides(generateStyle, generateComp
|
|
|
291
289
|
}, jsx(Heading, {
|
|
292
290
|
level: "reset",
|
|
293
291
|
as: "h2"
|
|
294
|
-
},
|
|
292
|
+
}, t('{entryHeader} | {entryIdentifier}', {
|
|
293
|
+
entryHeader: this.entryHeader(),
|
|
294
|
+
entryIdentifier: this.entryIdentifier()
|
|
295
|
+
}))));
|
|
295
296
|
}
|
|
296
297
|
}, {
|
|
297
298
|
key: "renderEntryCollapsed",
|
|
@@ -1,88 +1,65 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
4
|
-
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
function _callSuper(_this, derived, args) {
|
|
8
|
-
function isNativeReflectConstruct() {
|
|
9
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
10
|
-
if (Reflect.construct.sham) return false;
|
|
11
|
-
if (typeof Proxy === "function") return true;
|
|
12
|
-
try {
|
|
13
|
-
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
14
|
-
} catch (e) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
derived = _getPrototypeOf(derived);
|
|
19
|
-
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
20
|
-
}
|
|
21
|
-
import React, { Component } from 'react';
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
22
3
|
import PropTypes from 'prop-types';
|
|
23
4
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
24
5
|
import { Breadcrumb, BreadcrumbLink } from '@instructure/ui-breadcrumb';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
6
|
+
export function HeaderBreadCrumb(_ref) {
|
|
7
|
+
var _ref$returnToUrl = _ref.returnToUrl,
|
|
8
|
+
returnToUrl = _ref$returnToUrl === void 0 ? null : _ref$returnToUrl,
|
|
9
|
+
_ref$scope = _ref.scope,
|
|
10
|
+
scope = _ref$scope === void 0 ? {} : _ref$scope,
|
|
11
|
+
_ref$navigateToBuild = _ref.navigateToBuild,
|
|
12
|
+
navigateToBuild = _ref$navigateToBuild === void 0 ? null : _ref$navigateToBuild,
|
|
13
|
+
_ref$navigateToBanks = _ref.navigateToBanks,
|
|
14
|
+
navigateToBanks = _ref$navigateToBanks === void 0 ? null : _ref$navigateToBanks,
|
|
15
|
+
_ref$renderIcon = _ref.renderIcon,
|
|
16
|
+
renderIcon = _ref$renderIcon === void 0 ? null : _ref$renderIcon,
|
|
17
|
+
_ref$setItemBanksRef = _ref.setItemBanksRef,
|
|
18
|
+
setItemBanksRef = _ref$setItemBanksRef === void 0 ? null : _ref$setItemBanksRef,
|
|
19
|
+
_ref$isCompact = _ref.isCompact,
|
|
20
|
+
isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact,
|
|
21
|
+
_ref$children = _ref.children,
|
|
22
|
+
children = _ref$children === void 0 ? null : _ref$children;
|
|
23
|
+
var itemBanksRef = useRef(null);
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
// Note: InstUI doesn't handle refs properly, so we need to unwrap the link manually and
|
|
26
|
+
// focus the button within it.
|
|
27
|
+
if (navigateToBuild && navigateToBanks && itemBanksRef.current && !setItemBanksRef) {
|
|
28
|
+
var itemBanksElement = ReactDOM.findDOMNode(itemBanksRef.current);
|
|
29
|
+
if (itemBanksElement && itemBanksElement.querySelector('button')) {
|
|
30
|
+
itemBanksElement.querySelector('button').focus();
|
|
45
31
|
}
|
|
46
32
|
}
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
href: returnToUrl,
|
|
62
|
-
target: "_top"
|
|
63
|
-
}, canvasReferrerLinkText);
|
|
64
|
-
var banksLink = /*#__PURE__*/React.createElement(BreadcrumbLink, {
|
|
65
|
-
key: "Banks",
|
|
66
|
-
onClick: navigateToBanks,
|
|
67
|
-
renderIcon: renderIcon,
|
|
68
|
-
ref: setItemBanksRef || this.setItemBanksRef
|
|
69
|
-
}, t('Item Banks'));
|
|
33
|
+
}, [navigateToBuild, navigateToBanks, setItemBanksRef]);
|
|
34
|
+
var isScopeEmpty = !Object.keys(scope).length;
|
|
35
|
+
var canvasReferrerLinkText = isScopeEmpty ? null : scope.title;
|
|
36
|
+
var canvasReferrerLink = returnToUrl && canvasReferrerLinkText && /*#__PURE__*/React.createElement(BreadcrumbLink, {
|
|
37
|
+
key: "Context",
|
|
38
|
+
href: returnToUrl,
|
|
39
|
+
target: "_top"
|
|
40
|
+
}, canvasReferrerLinkText);
|
|
41
|
+
var banksLink = /*#__PURE__*/React.createElement(BreadcrumbLink, {
|
|
42
|
+
key: "Banks",
|
|
43
|
+
onClick: navigateToBanks,
|
|
44
|
+
renderIcon: renderIcon,
|
|
45
|
+
ref: setItemBanksRef || itemBanksRef
|
|
46
|
+
}, t('Item Banks'));
|
|
70
47
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
48
|
+
// If Breadcrumb has multiple children (even if 2nd is null), it will
|
|
49
|
+
// render the `>` icon, which we don't want if there are no children.
|
|
50
|
+
var breadCrumbLinks = [banksLink];
|
|
51
|
+
if (children) {
|
|
52
|
+
breadCrumbLinks = breadCrumbLinks.concat(children);
|
|
53
|
+
}
|
|
54
|
+
if (canvasReferrerLink) {
|
|
55
|
+
breadCrumbLinks.unshift(canvasReferrerLink);
|
|
56
|
+
}
|
|
57
|
+
return /*#__PURE__*/React.createElement(Breadcrumb, {
|
|
58
|
+
label: t('You are here:'),
|
|
59
|
+
size: isCompact ? 'small' : 'medium'
|
|
60
|
+
}, breadCrumbLinks);
|
|
61
|
+
}
|
|
62
|
+
HeaderBreadCrumb.propTypes = {
|
|
86
63
|
returnToUrl: PropTypes.string,
|
|
87
64
|
scope: PropTypes.objectOf(PropTypes.shape({
|
|
88
65
|
type: PropTypes.string,
|
|
@@ -95,15 +72,5 @@ _defineProperty(HeaderBreadCrumb, "propTypes", {
|
|
|
95
72
|
setItemBanksRef: PropTypes.func,
|
|
96
73
|
renderIcon: PropTypes.node,
|
|
97
74
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
|
|
98
|
-
}
|
|
99
|
-
_defineProperty(HeaderBreadCrumb, "defaultProps", {
|
|
100
|
-
returnToUrl: null,
|
|
101
|
-
scope: {},
|
|
102
|
-
navigateToBuild: null,
|
|
103
|
-
navigateToBanks: null,
|
|
104
|
-
isCompact: false,
|
|
105
|
-
setItemBanksRef: null,
|
|
106
|
-
renderIcon: null,
|
|
107
|
-
children: null
|
|
108
|
-
});
|
|
75
|
+
};
|
|
109
76
|
export default HeaderBreadCrumb;
|
|
@@ -62,7 +62,10 @@ var NavWrapper = (_dec = withStyleOverrides(generateStyle, generateComponentThem
|
|
|
62
62
|
if (this.closeButtonRef) {
|
|
63
63
|
ReactDOM.findDOMNode(this.closeButtonRef).focus();
|
|
64
64
|
} else if (this.props.navigateToBanks && this.itemBanksRef) {
|
|
65
|
-
ReactDOM.findDOMNode(this.itemBanksRef)
|
|
65
|
+
var itemBanksElement = ReactDOM.findDOMNode(this.itemBanksRef);
|
|
66
|
+
if (itemBanksElement && itemBanksElement.querySelector('button')) {
|
|
67
|
+
itemBanksElement.querySelector('button').focus();
|
|
68
|
+
}
|
|
66
69
|
}
|
|
67
70
|
}
|
|
68
71
|
}, {
|
|
@@ -413,7 +413,6 @@ var BankEntry = exports.BankEntry = (_dec = (0, _quizCommon.withStyleOverrides)(
|
|
|
413
413
|
var tempIdentifier = this.getTemporaryIdentifier();
|
|
414
414
|
var itemIdentifier = this.isTemporary() ? tempIdentifier : identifier;
|
|
415
415
|
var entryName = this.getEntryName(entry);
|
|
416
|
-
var separator = ' | ';
|
|
417
416
|
return (0, _emotion.jsx)("div", {
|
|
418
417
|
css: this.props.styles.header
|
|
419
418
|
}, (0, _emotion.jsx)("div", {
|
|
@@ -423,7 +422,10 @@ var BankEntry = exports.BankEntry = (_dec = (0, _quizCommon.withStyleOverrides)(
|
|
|
423
422
|
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
424
423
|
level: "reset",
|
|
425
424
|
as: "h2"
|
|
426
|
-
},
|
|
425
|
+
}, (0, _formatMessage["default"])('{entryName} | {itemIdentifier}', {
|
|
426
|
+
entryName: entryName,
|
|
427
|
+
itemIdentifier: itemIdentifier
|
|
428
|
+
})))), this.renderTitle(entry), (0, _emotion.jsx)("div", {
|
|
427
429
|
css: this.props.styles.rightHeader
|
|
428
430
|
}, (0, _emotion.jsx)(_EntrySave["default"], props)));
|
|
429
431
|
}
|
|
@@ -21,7 +21,6 @@ var _uiButtons = require("@instructure/ui-buttons");
|
|
|
21
21
|
var _uiText = require("@instructure/ui-text");
|
|
22
22
|
var _uiList = require("@instructure/ui-list");
|
|
23
23
|
var _uiHeading = require("@instructure/ui-heading");
|
|
24
|
-
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
25
24
|
var _uiAlerts = require("@instructure/ui-alerts");
|
|
26
25
|
var _emotion = require("@instructure/emotion");
|
|
27
26
|
var _quizCommon = require("@instructure/quiz-common");
|
|
@@ -290,7 +289,6 @@ var BankEntryRow = exports.BankEntryRow = (_dec = (0, _quizCommon.withStyleOverr
|
|
|
290
289
|
}, {
|
|
291
290
|
key: "renderHeader",
|
|
292
291
|
value: function renderHeader() {
|
|
293
|
-
var separator = ' | ';
|
|
294
292
|
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
|
|
295
293
|
css: this.props.styles.headerRow
|
|
296
294
|
}, this.renderAddButton(), (0, _emotion.jsx)("div", {
|
|
@@ -300,7 +298,10 @@ var BankEntryRow = exports.BankEntryRow = (_dec = (0, _quizCommon.withStyleOverr
|
|
|
300
298
|
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
301
299
|
level: "reset",
|
|
302
300
|
as: "h2"
|
|
303
|
-
},
|
|
301
|
+
}, (0, _formatMessage["default"])('{entryHeader} | {entryIdentifier}', {
|
|
302
|
+
entryHeader: this.entryHeader(),
|
|
303
|
+
entryIdentifier: this.entryIdentifier()
|
|
304
|
+
}))));
|
|
304
305
|
}
|
|
305
306
|
}, {
|
|
306
307
|
key: "renderEntryCollapsed",
|
|
@@ -4,94 +4,72 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
8
|
-
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
|
+
exports.HeaderBreadCrumb = HeaderBreadCrumb;
|
|
8
|
+
exports["default"] = void 0;
|
|
14
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
15
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
12
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
17
13
|
var _uiBreadcrumb = require("@instructure/ui-breadcrumb");
|
|
18
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
19
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return _this2;
|
|
47
|
-
}
|
|
48
|
-
(0, _inherits2["default"])(HeaderBreadCrumb, _Component);
|
|
49
|
-
return (0, _createClass2["default"])(HeaderBreadCrumb, [{
|
|
50
|
-
key: "componentDidMount",
|
|
51
|
-
value: function componentDidMount() {
|
|
52
|
-
if (this.props.navigateToBuild && this.props.navigateToBanks && this.itemBanksRef) {
|
|
53
|
-
_reactDom["default"].findDOMNode(this.itemBanksRef).focus();
|
|
16
|
+
function HeaderBreadCrumb(_ref) {
|
|
17
|
+
var _ref$returnToUrl = _ref.returnToUrl,
|
|
18
|
+
returnToUrl = _ref$returnToUrl === void 0 ? null : _ref$returnToUrl,
|
|
19
|
+
_ref$scope = _ref.scope,
|
|
20
|
+
scope = _ref$scope === void 0 ? {} : _ref$scope,
|
|
21
|
+
_ref$navigateToBuild = _ref.navigateToBuild,
|
|
22
|
+
navigateToBuild = _ref$navigateToBuild === void 0 ? null : _ref$navigateToBuild,
|
|
23
|
+
_ref$navigateToBanks = _ref.navigateToBanks,
|
|
24
|
+
navigateToBanks = _ref$navigateToBanks === void 0 ? null : _ref$navigateToBanks,
|
|
25
|
+
_ref$renderIcon = _ref.renderIcon,
|
|
26
|
+
renderIcon = _ref$renderIcon === void 0 ? null : _ref$renderIcon,
|
|
27
|
+
_ref$setItemBanksRef = _ref.setItemBanksRef,
|
|
28
|
+
setItemBanksRef = _ref$setItemBanksRef === void 0 ? null : _ref$setItemBanksRef,
|
|
29
|
+
_ref$isCompact = _ref.isCompact,
|
|
30
|
+
isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact,
|
|
31
|
+
_ref$children = _ref.children,
|
|
32
|
+
children = _ref$children === void 0 ? null : _ref$children;
|
|
33
|
+
var itemBanksRef = (0, _react.useRef)(null);
|
|
34
|
+
(0, _react.useEffect)(function () {
|
|
35
|
+
// Note: InstUI doesn't handle refs properly, so we need to unwrap the link manually and
|
|
36
|
+
// focus the button within it.
|
|
37
|
+
if (navigateToBuild && navigateToBanks && itemBanksRef.current && !setItemBanksRef) {
|
|
38
|
+
var itemBanksElement = _reactDom["default"].findDOMNode(itemBanksRef.current);
|
|
39
|
+
if (itemBanksElement && itemBanksElement.querySelector('button')) {
|
|
40
|
+
itemBanksElement.querySelector('button').focus();
|
|
54
41
|
}
|
|
55
42
|
}
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
href: returnToUrl,
|
|
71
|
-
target: "_top"
|
|
72
|
-
}, canvasReferrerLinkText);
|
|
73
|
-
var banksLink = /*#__PURE__*/_react["default"].createElement(_uiBreadcrumb.BreadcrumbLink, {
|
|
74
|
-
key: "Banks",
|
|
75
|
-
onClick: navigateToBanks,
|
|
76
|
-
renderIcon: renderIcon,
|
|
77
|
-
ref: setItemBanksRef || this.setItemBanksRef
|
|
78
|
-
}, (0, _formatMessage["default"])('Item Banks'));
|
|
43
|
+
}, [navigateToBuild, navigateToBanks, setItemBanksRef]);
|
|
44
|
+
var isScopeEmpty = !Object.keys(scope).length;
|
|
45
|
+
var canvasReferrerLinkText = isScopeEmpty ? null : scope.title;
|
|
46
|
+
var canvasReferrerLink = returnToUrl && canvasReferrerLinkText && /*#__PURE__*/_react["default"].createElement(_uiBreadcrumb.BreadcrumbLink, {
|
|
47
|
+
key: "Context",
|
|
48
|
+
href: returnToUrl,
|
|
49
|
+
target: "_top"
|
|
50
|
+
}, canvasReferrerLinkText);
|
|
51
|
+
var banksLink = /*#__PURE__*/_react["default"].createElement(_uiBreadcrumb.BreadcrumbLink, {
|
|
52
|
+
key: "Banks",
|
|
53
|
+
onClick: navigateToBanks,
|
|
54
|
+
renderIcon: renderIcon,
|
|
55
|
+
ref: setItemBanksRef || itemBanksRef
|
|
56
|
+
}, (0, _formatMessage["default"])('Item Banks'));
|
|
79
57
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
58
|
+
// If Breadcrumb has multiple children (even if 2nd is null), it will
|
|
59
|
+
// render the `>` icon, which we don't want if there are no children.
|
|
60
|
+
var breadCrumbLinks = [banksLink];
|
|
61
|
+
if (children) {
|
|
62
|
+
breadCrumbLinks = breadCrumbLinks.concat(children);
|
|
63
|
+
}
|
|
64
|
+
if (canvasReferrerLink) {
|
|
65
|
+
breadCrumbLinks.unshift(canvasReferrerLink);
|
|
66
|
+
}
|
|
67
|
+
return /*#__PURE__*/_react["default"].createElement(_uiBreadcrumb.Breadcrumb, {
|
|
68
|
+
label: (0, _formatMessage["default"])('You are here:'),
|
|
69
|
+
size: isCompact ? 'small' : 'medium'
|
|
70
|
+
}, breadCrumbLinks);
|
|
71
|
+
}
|
|
72
|
+
HeaderBreadCrumb.propTypes = {
|
|
95
73
|
returnToUrl: _propTypes["default"].string,
|
|
96
74
|
scope: _propTypes["default"].objectOf(_propTypes["default"].shape({
|
|
97
75
|
type: _propTypes["default"].string,
|
|
@@ -104,15 +82,5 @@ var HeaderBreadCrumb = exports.HeaderBreadCrumb = /*#__PURE__*/function (_Compon
|
|
|
104
82
|
setItemBanksRef: _propTypes["default"].func,
|
|
105
83
|
renderIcon: _propTypes["default"].node,
|
|
106
84
|
children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node])
|
|
107
|
-
}
|
|
108
|
-
(0, _defineProperty2["default"])(HeaderBreadCrumb, "defaultProps", {
|
|
109
|
-
returnToUrl: null,
|
|
110
|
-
scope: {},
|
|
111
|
-
navigateToBuild: null,
|
|
112
|
-
navigateToBanks: null,
|
|
113
|
-
isCompact: false,
|
|
114
|
-
setItemBanksRef: null,
|
|
115
|
-
renderIcon: null,
|
|
116
|
-
children: null
|
|
117
|
-
});
|
|
85
|
+
};
|
|
118
86
|
var _default = exports["default"] = HeaderBreadCrumb;
|
|
@@ -69,7 +69,10 @@ var NavWrapper = (_dec = (0, _quizCommon.withStyleOverrides)(_styles["default"],
|
|
|
69
69
|
if (this.closeButtonRef) {
|
|
70
70
|
_reactDom["default"].findDOMNode(this.closeButtonRef).focus();
|
|
71
71
|
} else if (this.props.navigateToBanks && this.itemBanksRef) {
|
|
72
|
-
_reactDom["default"].findDOMNode(this.itemBanksRef)
|
|
72
|
+
var itemBanksElement = _reactDom["default"].findDOMNode(this.itemBanksRef);
|
|
73
|
+
if (itemBanksElement && itemBanksElement.querySelector('button')) {
|
|
74
|
+
itemBanksElement.querySelector('button').focus();
|
|
75
|
+
}
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "22.10.
|
|
3
|
+
"version": "22.10.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -22,53 +22,53 @@
|
|
|
22
22
|
"lib"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@instructure/emotion": "10.
|
|
25
|
+
"@instructure/emotion": "10.17.0",
|
|
26
26
|
"@instructure/grading-utils": "^1.0.0",
|
|
27
27
|
"@instructure/outcomes-ui": "3.2.3",
|
|
28
|
-
"@instructure/ui-a11y-content": "10.
|
|
29
|
-
"@instructure/ui-alerts": "10.
|
|
30
|
-
"@instructure/ui-avatar": "10.
|
|
31
|
-
"@instructure/ui-billboard": "10.
|
|
32
|
-
"@instructure/ui-breadcrumb": "10.
|
|
33
|
-
"@instructure/ui-buttons": "10.
|
|
34
|
-
"@instructure/ui-checkbox": "10.
|
|
35
|
-
"@instructure/ui-color-utils": "10.
|
|
36
|
-
"@instructure/ui-dialog": "10.
|
|
37
|
-
"@instructure/ui-drilldown": "10.
|
|
38
|
-
"@instructure/ui-focusable": "10.
|
|
39
|
-
"@instructure/ui-grid": "10.
|
|
40
|
-
"@instructure/ui-heading": "10.
|
|
41
|
-
"@instructure/ui-i18n": "10.
|
|
42
|
-
"@instructure/ui-icons": "10.
|
|
43
|
-
"@instructure/ui-img": "10.
|
|
44
|
-
"@instructure/ui-link": "10.
|
|
45
|
-
"@instructure/ui-list": "10.
|
|
46
|
-
"@instructure/ui-menu": "10.
|
|
47
|
-
"@instructure/ui-metric": "10.
|
|
48
|
-
"@instructure/ui-modal": "10.
|
|
49
|
-
"@instructure/ui-motion": "10.
|
|
50
|
-
"@instructure/ui-number-input": "10.
|
|
51
|
-
"@instructure/ui-overlays": "10.
|
|
52
|
-
"@instructure/ui-pagination": "10.
|
|
53
|
-
"@instructure/ui-popover": "10.
|
|
54
|
-
"@instructure/ui-portal": "10.
|
|
55
|
-
"@instructure/ui-progress": "10.
|
|
56
|
-
"@instructure/ui-prop-types": "10.
|
|
57
|
-
"@instructure/ui-radio-input": "10.
|
|
58
|
-
"@instructure/ui-react-utils": "10.
|
|
59
|
-
"@instructure/ui-select": "10.
|
|
60
|
-
"@instructure/ui-spinner": "10.
|
|
61
|
-
"@instructure/ui-table": "10.
|
|
62
|
-
"@instructure/ui-tabs": "10.
|
|
63
|
-
"@instructure/ui-tag": "10.
|
|
64
|
-
"@instructure/ui-text": "10.
|
|
65
|
-
"@instructure/ui-themes": "10.
|
|
66
|
-
"@instructure/ui-toggle-details": "10.
|
|
67
|
-
"@instructure/ui-tooltip": "10.
|
|
68
|
-
"@instructure/ui-top-nav-bar": "10.
|
|
69
|
-
"@instructure/ui-tray": "10.
|
|
70
|
-
"@instructure/ui-truncate-text": "10.
|
|
71
|
-
"@instructure/ui-view": "10.
|
|
28
|
+
"@instructure/ui-a11y-content": "10.17.0",
|
|
29
|
+
"@instructure/ui-alerts": "10.17.0",
|
|
30
|
+
"@instructure/ui-avatar": "10.17.0",
|
|
31
|
+
"@instructure/ui-billboard": "10.17.0",
|
|
32
|
+
"@instructure/ui-breadcrumb": "10.17.0",
|
|
33
|
+
"@instructure/ui-buttons": "10.17.0",
|
|
34
|
+
"@instructure/ui-checkbox": "10.17.0",
|
|
35
|
+
"@instructure/ui-color-utils": "10.17.0",
|
|
36
|
+
"@instructure/ui-dialog": "10.17.0",
|
|
37
|
+
"@instructure/ui-drilldown": "10.17.0",
|
|
38
|
+
"@instructure/ui-focusable": "10.17.0",
|
|
39
|
+
"@instructure/ui-grid": "10.17.0",
|
|
40
|
+
"@instructure/ui-heading": "10.17.0",
|
|
41
|
+
"@instructure/ui-i18n": "10.17.0",
|
|
42
|
+
"@instructure/ui-icons": "10.17.0",
|
|
43
|
+
"@instructure/ui-img": "10.17.0",
|
|
44
|
+
"@instructure/ui-link": "10.17.0",
|
|
45
|
+
"@instructure/ui-list": "10.17.0",
|
|
46
|
+
"@instructure/ui-menu": "10.17.0",
|
|
47
|
+
"@instructure/ui-metric": "10.17.0",
|
|
48
|
+
"@instructure/ui-modal": "10.17.0",
|
|
49
|
+
"@instructure/ui-motion": "10.17.0",
|
|
50
|
+
"@instructure/ui-number-input": "10.17.0",
|
|
51
|
+
"@instructure/ui-overlays": "10.17.0",
|
|
52
|
+
"@instructure/ui-pagination": "10.17.0",
|
|
53
|
+
"@instructure/ui-popover": "10.17.0",
|
|
54
|
+
"@instructure/ui-portal": "10.17.0",
|
|
55
|
+
"@instructure/ui-progress": "10.17.0",
|
|
56
|
+
"@instructure/ui-prop-types": "10.17.0",
|
|
57
|
+
"@instructure/ui-radio-input": "10.17.0",
|
|
58
|
+
"@instructure/ui-react-utils": "10.17.0",
|
|
59
|
+
"@instructure/ui-select": "10.17.0",
|
|
60
|
+
"@instructure/ui-spinner": "10.17.0",
|
|
61
|
+
"@instructure/ui-table": "10.17.0",
|
|
62
|
+
"@instructure/ui-tabs": "10.17.0",
|
|
63
|
+
"@instructure/ui-tag": "10.17.0",
|
|
64
|
+
"@instructure/ui-text": "10.17.0",
|
|
65
|
+
"@instructure/ui-themes": "10.17.0",
|
|
66
|
+
"@instructure/ui-toggle-details": "10.17.0",
|
|
67
|
+
"@instructure/ui-tooltip": "10.17.0",
|
|
68
|
+
"@instructure/ui-top-nav-bar": "10.17.0",
|
|
69
|
+
"@instructure/ui-tray": "10.17.0",
|
|
70
|
+
"@instructure/ui-truncate-text": "10.17.0",
|
|
71
|
+
"@instructure/ui-view": "10.17.0",
|
|
72
72
|
"aws-sdk": "^2.3.2",
|
|
73
73
|
"aws4fetch": "^1.0.20",
|
|
74
74
|
"classnames": "^2.2.5",
|
|
@@ -111,15 +111,15 @@
|
|
|
111
111
|
"store": "^1.3.20",
|
|
112
112
|
"striptags": "^2.0.0",
|
|
113
113
|
"uuid": "^3.2.1",
|
|
114
|
-
"@instructure/quiz-common": "22.10.
|
|
115
|
-
"@instructure/quiz-
|
|
116
|
-
"@instructure/quiz-
|
|
117
|
-
"@instructure/quiz-
|
|
118
|
-
"instructure-validations": "22.10.
|
|
119
|
-
"@instructure/quiz-
|
|
114
|
+
"@instructure/quiz-common": "22.10.1",
|
|
115
|
+
"@instructure/quiz-i18n": "22.10.1",
|
|
116
|
+
"@instructure/quiz-interactions": "22.10.1",
|
|
117
|
+
"@instructure/quiz-number-input": "22.10.1",
|
|
118
|
+
"instructure-validations": "22.10.1",
|
|
119
|
+
"@instructure/quiz-rce": "22.10.1"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
|
-
"@instructure/ui-axe-check": "10.
|
|
122
|
+
"@instructure/ui-axe-check": "10.17.0",
|
|
123
123
|
"@instructure/ui-test-utils": "^7.22.1",
|
|
124
124
|
"@testing-library/react": "^12.1.5",
|
|
125
125
|
"@testing-library/user-event": "^12.0.0",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"sinon": "^6.1.3",
|
|
146
146
|
"sinon-chai": "^3.3.0",
|
|
147
147
|
"@instructure/quiz-scripts": "21.0.0",
|
|
148
|
-
"quiz-presets": "22.10.
|
|
148
|
+
"quiz-presets": "22.10.1"
|
|
149
149
|
},
|
|
150
150
|
"peerDependencies": {
|
|
151
151
|
"react": "^15 || ^16"
|