@instructure/quiz-core 20.26.0 → 20.26.1-snapshot.5
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/CHANGELOG.md +4643 -0
- package/es/building/api/quizzes.js +5 -4
- package/es/building/components/resources/ActionButtons/presenter.js +3 -2
- package/es/building/components/resources/quiz/instructions/Edit/presenter.js +5 -5
- package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +5 -7
- package/es/common/actions/modifications.js +3 -2
- package/es/common/components/layout/sidebar/Sidebar/index.js +5 -3
- package/es/common/components/layout/sidebar/SidebarItem/presenter.js +5 -2
- package/es/common/components/layout/sidebar/Stimulus/presenter.js +3 -1
- package/es/common/components/resources/quiz/AddContent/Button/index.js +2 -0
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +5 -7
- package/es/common/components/shared/TagWrapper/presenter.js +9 -3
- package/es/common/components/shared/overlay/index.js +3 -1
- package/es/common/util/clickHandlers.js +19 -0
- package/es/index.js +2 -1
- package/lib/building/api/quizzes.js +5 -4
- package/lib/building/components/resources/ActionButtons/presenter.js +2 -1
- package/lib/building/components/resources/quiz/instructions/Edit/presenter.js +5 -5
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +5 -7
- package/lib/common/actions/modifications.js +3 -2
- package/lib/common/components/layout/sidebar/Sidebar/index.js +4 -2
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +5 -2
- package/lib/common/components/layout/sidebar/Stimulus/presenter.js +3 -1
- package/lib/common/components/resources/quiz/AddContent/Button/index.js +2 -0
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +5 -7
- package/lib/common/components/shared/TagWrapper/presenter.js +9 -3
- package/lib/common/components/shared/overlay/index.js +3 -1
- package/lib/common/util/clickHandlers.js +26 -0
- package/lib/index.js +15 -6
- package/package.json +11 -10
|
@@ -231,15 +231,16 @@ export function setFilterIpAddress(quizId, value, completeCb) {
|
|
|
231
231
|
filter_ip_address: Boolean(value)
|
|
232
232
|
}, changeQuizFilterIpAddress(quizId, value), completeCb);
|
|
233
233
|
}
|
|
234
|
-
export function setIpFiltersUi(quizId,
|
|
234
|
+
export function setIpFiltersUi(quizId, ips, namedIps) {
|
|
235
235
|
return function (dispatch, getState) {
|
|
236
|
-
dispatch(changeQuizIpFilters(quizId,
|
|
236
|
+
dispatch(changeQuizIpFilters(quizId, ips, namedIps));
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
|
-
export function setIpFiltersApi(quizId,
|
|
239
|
+
export function setIpFiltersApi(quizId, ips, namedIps, completeCb) {
|
|
240
240
|
return setQuizProperty(quizId, {
|
|
241
241
|
filters: {
|
|
242
|
-
ips:
|
|
242
|
+
ips: ips,
|
|
243
|
+
named_ips: namedIps
|
|
243
244
|
}
|
|
244
245
|
}, null, completeCb);
|
|
245
246
|
}
|
|
@@ -13,7 +13,7 @@ import { withStyle, jsx, Global } from '@instructure/emotion';
|
|
|
13
13
|
import DragHandle from "../../../../common/components/shared/drag_and_drop/DragHandle/index.js";
|
|
14
14
|
import makeScrollable from "../../../../common/components/shared/functionality/makeScrollable.js";
|
|
15
15
|
import noop from "../../../../common/util/noop.js";
|
|
16
|
-
import { EDIT, REMOVE, COPY } from '@instructure/quiz-common';
|
|
16
|
+
import { EDIT, REMOVE, COPY, END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
|
|
17
17
|
import generateStyle from "./styles.js";
|
|
18
18
|
import generateComponentTheme from "./theme.js";
|
|
19
19
|
var ScrollTargetButton = makeScrollable(IconButton);
|
|
@@ -71,8 +71,9 @@ export var ActionButtons = (_dec = withStyle(generateStyle, generateComponentThe
|
|
|
71
71
|
key: "render",
|
|
72
72
|
value: function render() {
|
|
73
73
|
var hideClass = !this.props.shouldRenderEdit ? 'hide' : '';
|
|
74
|
+
var parentDivClass = "buttons ".concat(END_EDITING_TRIGGER_CLASSNAME);
|
|
74
75
|
return jsx("div", {
|
|
75
|
-
className:
|
|
76
|
+
className: parentDivClass,
|
|
76
77
|
tabIndex: "-1",
|
|
77
78
|
onFocus: this.onButtonFocus,
|
|
78
79
|
css: this.props.styles.buttons
|
|
@@ -10,7 +10,7 @@ import { Button } from '@instructure/ui-buttons';
|
|
|
10
10
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
11
11
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
12
12
|
import CustomPropTypes from "../../../../../../common/util/CustomPropTypes.js";
|
|
13
|
-
import
|
|
13
|
+
import { checkClickedNode } from "../../../../../../common/util/clickHandlers.js";
|
|
14
14
|
import { INSTRUCTIONS_EDIT_ID } from '@instructure/quiz-common';
|
|
15
15
|
import { RichContentInput } from '@instructure/quiz-rce';
|
|
16
16
|
import generateStyle from "./styles.js";
|
|
@@ -36,10 +36,10 @@ var QuizInstructionsEdit = (_dec = withStyle(generateStyle, generateComponentThe
|
|
|
36
36
|
}, {
|
|
37
37
|
key: "ignoreClickOutsideIf",
|
|
38
38
|
value: function ignoreClickOutsideIf(e) {
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
var _checkClickedNode = checkClickedNode(e, this.props.appContainer),
|
|
40
|
+
isEndEditingTrigger = _checkClickedNode.isEndEditingTrigger,
|
|
41
|
+
outsideApp = _checkClickedNode.outsideApp;
|
|
42
|
+
return outsideApp || !isEndEditingTrigger;
|
|
43
43
|
}
|
|
44
44
|
}, {
|
|
45
45
|
key: "render",
|
|
@@ -16,10 +16,10 @@ import first from 'lodash/first';
|
|
|
16
16
|
import { withStyle, jsx, Global } from '@instructure/emotion';
|
|
17
17
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
18
18
|
import CustomPropTypes from "../../../../../common/util/CustomPropTypes.js";
|
|
19
|
-
import elementsForSelectors from "../../../../../common/util/ElementsForSelectors.js";
|
|
20
19
|
import AddToBankModal from "../../../../../banks/components/AddToBankModal/index.js";
|
|
21
20
|
import DragAndDropZone from "../../../../../common/components/shared/drag_and_drop/DragAndDropZone/index.js";
|
|
22
21
|
import wrapWithOutsideClickEmotion from "../../../../../common/components/shared/functionality/componentWithOutsideClickEmotion.js";
|
|
22
|
+
import { checkClickedNode } from "../../../../../common/util/clickHandlers.js";
|
|
23
23
|
import QuizEntryEditHeader from "./Header/index.js";
|
|
24
24
|
import QuizEntryEditFooter from "./Footer/index.js";
|
|
25
25
|
import { SHOULD_CLONE_ITEM, TEMPORARY_ITEM_ID, DELETED_QUIZ_ENTRY, API_INPUT_VALIDATION_ERROR, CLEAR_ALL_INPUT_VALIDATION_ERRORS, PARENT_TYPE_ADDING_TO_BANK } from '@instructure/quiz-common';
|
|
@@ -294,12 +294,10 @@ var QuizEntryEdit = (_dec = withStyle(generateStyle, generateComponentTheme), _d
|
|
|
294
294
|
}, {
|
|
295
295
|
key: "ignoreClickOutsideIf",
|
|
296
296
|
value: function ignoreClickOutsideIf(e) {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
});
|
|
302
|
-
return this.props.isOccluded || outsideApp;
|
|
297
|
+
var _checkClickedNode = checkClickedNode(e, this.props.appContainer),
|
|
298
|
+
isEndEditingTrigger = _checkClickedNode.isEndEditingTrigger,
|
|
299
|
+
outsideApp = _checkClickedNode.outsideApp;
|
|
300
|
+
return this.props.isOccluded || outsideApp || !isEndEditingTrigger;
|
|
303
301
|
}
|
|
304
302
|
}, {
|
|
305
303
|
key: "isValid",
|
|
@@ -512,14 +512,15 @@ export function changeQuizFilterIpAddress(quizId, value) {
|
|
|
512
512
|
}
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
|
-
export function changeQuizIpFilters(quizId,
|
|
515
|
+
export function changeQuizIpFilters(quizId, ips, namedIps) {
|
|
516
516
|
return {
|
|
517
517
|
type: QUIZ_MODIFICATION,
|
|
518
518
|
payload: {
|
|
519
519
|
id: quizId,
|
|
520
520
|
modifications: {
|
|
521
521
|
filters: {
|
|
522
|
-
ips:
|
|
522
|
+
ips: ips,
|
|
523
|
+
namedIps: namedIps
|
|
523
524
|
}
|
|
524
525
|
}
|
|
525
526
|
}
|
|
@@ -19,7 +19,7 @@ import { View } from '@instructure/ui-view';
|
|
|
19
19
|
import { withStyle, jsx, Global } from '@instructure/emotion';
|
|
20
20
|
import { Heading } from '@instructure/ui-heading';
|
|
21
21
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
22
|
-
import { INSTRUCTIONS_SCROLL_KEY, RESULTS_SCROLL_KEY, SIDEBAR_NAV_ID, TITLE_SCROLL_KEY } from '@instructure/quiz-common';
|
|
22
|
+
import { INSTRUCTIONS_SCROLL_KEY, RESULTS_SCROLL_KEY, SIDEBAR_NAV_ID, TITLE_SCROLL_KEY, END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
|
|
23
23
|
import { onPhone } from "../../../../util/windowChecks.js";
|
|
24
24
|
import CustomPropTypes from "../../../../util/CustomPropTypes.js";
|
|
25
25
|
import noop from "../../../../util/noop.js";
|
|
@@ -105,7 +105,8 @@ export var Sidebar = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
return jsx("div", {
|
|
108
|
-
css: this.props.styles.sidebar.actionableInfo
|
|
108
|
+
css: this.props.styles.sidebar.actionableInfo,
|
|
109
|
+
className: END_EDITING_TRIGGER_CLASSNAME
|
|
109
110
|
}, jsx(Link, {
|
|
110
111
|
href: "#",
|
|
111
112
|
margin: "small",
|
|
@@ -127,7 +128,8 @@ export var Sidebar = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
127
128
|
return;
|
|
128
129
|
}
|
|
129
130
|
return jsx("div", {
|
|
130
|
-
css: this.props.styles.sidebar.actionableInfo
|
|
131
|
+
css: this.props.styles.sidebar.actionableInfo,
|
|
132
|
+
className: END_EDITING_TRIGGER_CLASSNAME
|
|
131
133
|
}, jsx(Link, {
|
|
132
134
|
href: "#",
|
|
133
135
|
margin: "small",
|
|
@@ -16,6 +16,7 @@ import t from '@instructure/quiz-i18n/es/format-message';
|
|
|
16
16
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
17
17
|
import generateStyle from "./styles.js";
|
|
18
18
|
import generateComponentTheme from "./theme.js";
|
|
19
|
+
import { END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
|
|
19
20
|
export var SidebarItem = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_SidebarItem = /*#__PURE__*/function (_Component) {
|
|
20
21
|
_inherits(SidebarItem, _Component);
|
|
21
22
|
var _super = _createSuper(SidebarItem);
|
|
@@ -110,7 +111,8 @@ export var SidebarItem = (_dec = withStyle(generateStyle, generateComponentTheme
|
|
|
110
111
|
key: "renderClosed",
|
|
111
112
|
value: function renderClosed() {
|
|
112
113
|
return jsx("div", {
|
|
113
|
-
css: this.props.styles.sidebarItem
|
|
114
|
+
css: this.props.styles.sidebarItem,
|
|
115
|
+
className: END_EDITING_TRIGGER_CLASSNAME
|
|
114
116
|
}, this.renderButton());
|
|
115
117
|
}
|
|
116
118
|
}, {
|
|
@@ -121,8 +123,9 @@ export var SidebarItem = (_dec = withStyle(generateStyle, generateComponentTheme
|
|
|
121
123
|
itemName = _this$props3.itemName,
|
|
122
124
|
pointsPossible = _this$props3.pointsPossible,
|
|
123
125
|
styles = _this$props3.styles;
|
|
126
|
+
var parentDivClass = "sidebarIsOpen ".concat(END_EDITING_TRIGGER_CLASSNAME);
|
|
124
127
|
return jsx("div", {
|
|
125
|
-
className:
|
|
128
|
+
className: parentDivClass,
|
|
126
129
|
css: styles.sidebarItem
|
|
127
130
|
}, jsx(Flex, {
|
|
128
131
|
justifyItems: "space-between"
|
|
@@ -18,6 +18,7 @@ import Summary from "./Summary/index.js";
|
|
|
18
18
|
import generateStyle from "./styles.js";
|
|
19
19
|
import generateComponentTheme from "./theme.js";
|
|
20
20
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
21
|
+
import { END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
|
|
21
22
|
export var DISPLAY_AS_SUMMARY_LIMIT = 5;
|
|
22
23
|
var _ref = jsx(IconTextLeftLine, {
|
|
23
24
|
color: "primary"
|
|
@@ -82,7 +83,8 @@ export var SidebarStimulus = (_dec = withStyle(generateStyle, generateComponentT
|
|
|
82
83
|
margin: "small",
|
|
83
84
|
forceButtonRole: false,
|
|
84
85
|
onClick: this.scrollToItem,
|
|
85
|
-
renderIcon: _ref
|
|
86
|
+
renderIcon: _ref,
|
|
87
|
+
className: END_EDITING_TRIGGER_CLASSNAME
|
|
86
88
|
}, jsx(ScreenReaderContent, null, t('Navigate to stimulus at position { displayPosition }', {
|
|
87
89
|
displayPosition: displayPosition
|
|
88
90
|
})));
|
|
@@ -13,6 +13,7 @@ import { withStyle, jsx } from '@instructure/emotion';
|
|
|
13
13
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
14
14
|
import generateStyle from "./styles.js";
|
|
15
15
|
import generateComponentTheme from "./theme.js";
|
|
16
|
+
import { END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
|
|
16
17
|
export var AddContentButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_AddContentButton = /*#__PURE__*/function (_Component) {
|
|
17
18
|
_inherits(AddContentButton, _Component);
|
|
18
19
|
var _super = _createSuper(AddContentButton);
|
|
@@ -60,6 +61,7 @@ export var AddContentButton = (_dec = withStyle(generateStyle, generateComponent
|
|
|
60
61
|
key: "renderNonStimulus",
|
|
61
62
|
value: function renderNonStimulus() {
|
|
62
63
|
return jsx("div", {
|
|
64
|
+
className: END_EDITING_TRIGGER_CLASSNAME,
|
|
63
65
|
css: this.props.styles.newItemButtonHolder
|
|
64
66
|
}, jsx("button", {
|
|
65
67
|
ref: this.storeButtonElemRef,
|
|
@@ -21,7 +21,7 @@ import AddToBankModal from "../../../../../banks/components/AddToBankModal/index
|
|
|
21
21
|
import AddToBankOptions from "../../../../../building/components/resources/AddToBankOptions/index.js";
|
|
22
22
|
import WarningWrapper from "../../WarningWrapper/index.js";
|
|
23
23
|
import CustomPropTypes from "../../../../../common/util/CustomPropTypes.js";
|
|
24
|
-
import
|
|
24
|
+
import { checkClickedNode } from "../../../../../common/util/clickHandlers.js";
|
|
25
25
|
import StimulusShowInfo from "../StimulusShowInfo/index.js";
|
|
26
26
|
import StimulusEditInfo from "../StimulusEditInfo/index.js";
|
|
27
27
|
import wrapWithOutsideClickEmotion from "../../../shared/functionality/componentWithOutsideClickEmotion.js";
|
|
@@ -286,12 +286,10 @@ export var StimulusEdit = (_dec = withStyle(generateStyle, generateComponentThem
|
|
|
286
286
|
}, {
|
|
287
287
|
key: "ignoreClickOutsideIf",
|
|
288
288
|
value: function ignoreClickOutsideIf(e) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
});
|
|
294
|
-
return outsideApp;
|
|
289
|
+
var _checkClickedNode = checkClickedNode(e, this.props.appContainer),
|
|
290
|
+
isEndEditingTrigger = _checkClickedNode.isEndEditingTrigger,
|
|
291
|
+
outsideApp = _checkClickedNode.outsideApp;
|
|
292
|
+
return outsideApp || !isEndEditingTrigger;
|
|
295
293
|
}
|
|
296
294
|
}, {
|
|
297
295
|
key: "afterSubmit",
|
|
@@ -31,7 +31,8 @@ export var TagWrapper = /*#__PURE__*/function (_Component) {
|
|
|
31
31
|
var _this$props = this.props,
|
|
32
32
|
id = _this$props.id,
|
|
33
33
|
text = _this$props.text,
|
|
34
|
-
index = _this$props.index
|
|
34
|
+
index = _this$props.index,
|
|
35
|
+
themeOverride = _this$props.themeOverride;
|
|
35
36
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
36
37
|
text: /*#__PURE__*/React.createElement(AccessibleContent, {
|
|
37
38
|
alt: t('Remove {label}', {
|
|
@@ -41,7 +42,8 @@ export var TagWrapper = /*#__PURE__*/function (_Component) {
|
|
|
41
42
|
dismissible: true,
|
|
42
43
|
key: id,
|
|
43
44
|
margin: index > 0 ? 'xxx-small 0 xxx-small xx-small' : 'xxx-small 0',
|
|
44
|
-
onClick: this.dismissTag
|
|
45
|
+
onClick: this.dismissTag,
|
|
46
|
+
themeOverride: themeOverride
|
|
45
47
|
});
|
|
46
48
|
}
|
|
47
49
|
}]);
|
|
@@ -52,6 +54,10 @@ TagWrapper.propTypes = {
|
|
|
52
54
|
text: PropTypes.string.isRequired,
|
|
53
55
|
index: PropTypes.number.isRequired,
|
|
54
56
|
id: PropTypes.string.isRequired,
|
|
55
|
-
onClick: PropTypes.func.isRequired
|
|
57
|
+
onClick: PropTypes.func.isRequired,
|
|
58
|
+
themeOverride: PropTypes.object
|
|
59
|
+
};
|
|
60
|
+
TagWrapper.defaultProps = {
|
|
61
|
+
themeOverride: {}
|
|
56
62
|
};
|
|
57
63
|
export default TagWrapper;
|
|
@@ -18,6 +18,7 @@ import PropTypes from 'prop-types';
|
|
|
18
18
|
import { withStyle, jsx, Global } from '@instructure/emotion';
|
|
19
19
|
import generateStyle from "./styles.js";
|
|
20
20
|
import generateComponentTheme from "./theme.js";
|
|
21
|
+
import { END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
|
|
21
22
|
var Overlay = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_Overlay = /*#__PURE__*/function (_Component) {
|
|
22
23
|
_inherits(Overlay, _Component);
|
|
23
24
|
var _super = _createSuper(Overlay);
|
|
@@ -31,9 +32,10 @@ var Overlay = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_cl
|
|
|
31
32
|
if (this.props.hideOverlay) {
|
|
32
33
|
return null;
|
|
33
34
|
}
|
|
35
|
+
var overlayClass = "overlay ".concat(END_EDITING_TRIGGER_CLASSNAME);
|
|
34
36
|
return jsx("div", {
|
|
35
37
|
role: "presentation",
|
|
36
|
-
className:
|
|
38
|
+
className: overlayClass,
|
|
37
39
|
css: this.props.styles.overlay,
|
|
38
40
|
onClick: this.props.onClick,
|
|
39
41
|
"data-automation": "sdk-overlay"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import elementsForSelectors from "./ElementsForSelectors.js";
|
|
2
|
+
import { END_EDITING_TRIGGER_CLASSNAME } from '@instructure/quiz-common';
|
|
3
|
+
export function checkClickedNode(e, appContainer) {
|
|
4
|
+
// Need to iterate over the appNodes since Gauge and lti have a different index for the sdk node
|
|
5
|
+
var appNodes = elementsForSelectors(appContainer);
|
|
6
|
+
var outsideApp = appNodes.every(function (node) {
|
|
7
|
+
return node && !node.contains(e.target);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// checking if the click was on an element that should end editing
|
|
11
|
+
var endEditingNodes = elementsForSelectors(".".concat(END_EDITING_TRIGGER_CLASSNAME));
|
|
12
|
+
var isEndEditingTrigger = endEditingNodes.some(function (node) {
|
|
13
|
+
return node && node.contains(e.target);
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
isEndEditingTrigger: isEndEditingTrigger,
|
|
17
|
+
outsideApp: outsideApp
|
|
18
|
+
};
|
|
19
|
+
}
|
package/es/index.js
CHANGED
|
@@ -75,7 +75,8 @@ export { Errors } from "./common/components/shared/errors/Errors.js";
|
|
|
75
75
|
export { TimeUnitsInput } from "./common/components/shared/TimeUnitsInput/index.js";
|
|
76
76
|
export { QuizEntry as QuizEntryView } from "./building/components/resources/quizEntry/QuizEntry/index.js";
|
|
77
77
|
export { Provider } from "./common/react-redux.js";
|
|
78
|
-
export { FormattedTimer } from "./common/components/shared/FormattedDuration/index.js";
|
|
78
|
+
export { FormattedTimer } from "./common/components/shared/FormattedDuration/index.js";
|
|
79
|
+
export { default as TagWrapper } from "./common/components/shared/TagWrapper/index.js"; // Utilities
|
|
79
80
|
export { environment as config } from "./config.js";
|
|
80
81
|
export { Fetcher } from "./common/util/Fetcher.js";
|
|
81
82
|
export { httpHeaders } from "./common/util/httpHeaders.js";
|
|
@@ -260,15 +260,16 @@ function setFilterIpAddress(quizId, value, completeCb) {
|
|
|
260
260
|
filter_ip_address: Boolean(value)
|
|
261
261
|
}, (0, _modifications.changeQuizFilterIpAddress)(quizId, value), completeCb);
|
|
262
262
|
}
|
|
263
|
-
function setIpFiltersUi(quizId,
|
|
263
|
+
function setIpFiltersUi(quizId, ips, namedIps) {
|
|
264
264
|
return function (dispatch, getState) {
|
|
265
|
-
dispatch((0, _modifications.changeQuizIpFilters)(quizId,
|
|
265
|
+
dispatch((0, _modifications.changeQuizIpFilters)(quizId, ips, namedIps));
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
|
-
function setIpFiltersApi(quizId,
|
|
268
|
+
function setIpFiltersApi(quizId, ips, namedIps, completeCb) {
|
|
269
269
|
return setQuizProperty(quizId, {
|
|
270
270
|
filters: {
|
|
271
|
-
ips:
|
|
271
|
+
ips: ips,
|
|
272
|
+
named_ips: namedIps
|
|
272
273
|
}
|
|
273
274
|
}, null, completeCb);
|
|
274
275
|
}
|
|
@@ -78,8 +78,9 @@ var ActionButtons = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defa
|
|
|
78
78
|
key: "render",
|
|
79
79
|
value: function render() {
|
|
80
80
|
var hideClass = !this.props.shouldRenderEdit ? 'hide' : '';
|
|
81
|
+
var parentDivClass = "buttons ".concat(_quizCommon.END_EDITING_TRIGGER_CLASSNAME);
|
|
81
82
|
return (0, _emotion.jsx)("div", {
|
|
82
|
-
className:
|
|
83
|
+
className: parentDivClass,
|
|
83
84
|
tabIndex: "-1",
|
|
84
85
|
onFocus: this.onButtonFocus,
|
|
85
86
|
css: this.props.styles.buttons
|
|
@@ -15,7 +15,7 @@ var _uiButtons = require("@instructure/ui-buttons");
|
|
|
15
15
|
var _emotion = require("@instructure/emotion");
|
|
16
16
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
17
17
|
var _CustomPropTypes = _interopRequireDefault(require("../../../../../../common/util/CustomPropTypes.js"));
|
|
18
|
-
var
|
|
18
|
+
var _clickHandlers = require("../../../../../../common/util/clickHandlers.js");
|
|
19
19
|
var _quizCommon = require("@instructure/quiz-common");
|
|
20
20
|
var _quizRce = require("@instructure/quiz-rce");
|
|
21
21
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
@@ -44,10 +44,10 @@ var QuizInstructionsEdit = (_dec = (0, _emotion.withStyle)(_styles.default, _the
|
|
|
44
44
|
}, {
|
|
45
45
|
key: "ignoreClickOutsideIf",
|
|
46
46
|
value: function ignoreClickOutsideIf(e) {
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
var _checkClickedNode = (0, _clickHandlers.checkClickedNode)(e, this.props.appContainer),
|
|
48
|
+
isEndEditingTrigger = _checkClickedNode.isEndEditingTrigger,
|
|
49
|
+
outsideApp = _checkClickedNode.outsideApp;
|
|
50
|
+
return outsideApp || !isEndEditingTrigger;
|
|
51
51
|
}
|
|
52
52
|
}, {
|
|
53
53
|
key: "render",
|
|
@@ -21,10 +21,10 @@ var _first = _interopRequireDefault(require("lodash/first"));
|
|
|
21
21
|
var _emotion = require("@instructure/emotion");
|
|
22
22
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
23
23
|
var _CustomPropTypes = _interopRequireDefault(require("../../../../../common/util/CustomPropTypes.js"));
|
|
24
|
-
var _ElementsForSelectors = _interopRequireDefault(require("../../../../../common/util/ElementsForSelectors.js"));
|
|
25
24
|
var _index = _interopRequireDefault(require("../../../../../banks/components/AddToBankModal/index.js"));
|
|
26
25
|
var _index2 = _interopRequireDefault(require("../../../../../common/components/shared/drag_and_drop/DragAndDropZone/index.js"));
|
|
27
26
|
var _componentWithOutsideClickEmotion = _interopRequireDefault(require("../../../../../common/components/shared/functionality/componentWithOutsideClickEmotion.js"));
|
|
27
|
+
var _clickHandlers = require("../../../../../common/util/clickHandlers.js");
|
|
28
28
|
var _index3 = _interopRequireDefault(require("./Header/index.js"));
|
|
29
29
|
var _index4 = _interopRequireDefault(require("./Footer/index.js"));
|
|
30
30
|
var _quizCommon = require("@instructure/quiz-common");
|
|
@@ -302,12 +302,10 @@ var QuizEntryEdit = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defa
|
|
|
302
302
|
}, {
|
|
303
303
|
key: "ignoreClickOutsideIf",
|
|
304
304
|
value: function ignoreClickOutsideIf(e) {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
});
|
|
310
|
-
return this.props.isOccluded || outsideApp;
|
|
305
|
+
var _checkClickedNode = (0, _clickHandlers.checkClickedNode)(e, this.props.appContainer),
|
|
306
|
+
isEndEditingTrigger = _checkClickedNode.isEndEditingTrigger,
|
|
307
|
+
outsideApp = _checkClickedNode.outsideApp;
|
|
308
|
+
return this.props.isOccluded || outsideApp || !isEndEditingTrigger;
|
|
311
309
|
}
|
|
312
310
|
}, {
|
|
313
311
|
key: "isValid",
|
|
@@ -557,14 +557,15 @@ function changeQuizFilterIpAddress(quizId, value) {
|
|
|
557
557
|
}
|
|
558
558
|
};
|
|
559
559
|
}
|
|
560
|
-
function changeQuizIpFilters(quizId,
|
|
560
|
+
function changeQuizIpFilters(quizId, ips, namedIps) {
|
|
561
561
|
return {
|
|
562
562
|
type: _quizCommon.QUIZ_MODIFICATION,
|
|
563
563
|
payload: {
|
|
564
564
|
id: quizId,
|
|
565
565
|
modifications: {
|
|
566
566
|
filters: {
|
|
567
|
-
ips:
|
|
567
|
+
ips: ips,
|
|
568
|
+
namedIps: namedIps
|
|
568
569
|
}
|
|
569
570
|
}
|
|
570
571
|
}
|
|
@@ -112,7 +112,8 @@ var Sidebar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
114
|
return (0, _emotion.jsx)("div", {
|
|
115
|
-
css: this.props.styles.sidebar.actionableInfo
|
|
115
|
+
css: this.props.styles.sidebar.actionableInfo,
|
|
116
|
+
className: _quizCommon.END_EDITING_TRIGGER_CLASSNAME
|
|
116
117
|
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
117
118
|
href: "#",
|
|
118
119
|
margin: "small",
|
|
@@ -134,7 +135,8 @@ var Sidebar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
134
135
|
return;
|
|
135
136
|
}
|
|
136
137
|
return (0, _emotion.jsx)("div", {
|
|
137
|
-
css: this.props.styles.sidebar.actionableInfo
|
|
138
|
+
css: this.props.styles.sidebar.actionableInfo,
|
|
139
|
+
className: _quizCommon.END_EDITING_TRIGGER_CLASSNAME
|
|
138
140
|
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
139
141
|
href: "#",
|
|
140
142
|
margin: "small",
|
|
@@ -21,6 +21,7 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
|
|
|
21
21
|
var _quizRce = require("@instructure/quiz-rce");
|
|
22
22
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
23
23
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
24
|
+
var _quizCommon = require("@instructure/quiz-common");
|
|
24
25
|
var _dec, _class, _SidebarItem;
|
|
25
26
|
/** @jsx jsx */
|
|
26
27
|
var SidebarItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_SidebarItem = /*#__PURE__*/function (_Component) {
|
|
@@ -117,7 +118,8 @@ var SidebarItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
117
118
|
key: "renderClosed",
|
|
118
119
|
value: function renderClosed() {
|
|
119
120
|
return (0, _emotion.jsx)("div", {
|
|
120
|
-
css: this.props.styles.sidebarItem
|
|
121
|
+
css: this.props.styles.sidebarItem,
|
|
122
|
+
className: _quizCommon.END_EDITING_TRIGGER_CLASSNAME
|
|
121
123
|
}, this.renderButton());
|
|
122
124
|
}
|
|
123
125
|
}, {
|
|
@@ -128,8 +130,9 @@ var SidebarItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
128
130
|
itemName = _this$props3.itemName,
|
|
129
131
|
pointsPossible = _this$props3.pointsPossible,
|
|
130
132
|
styles = _this$props3.styles;
|
|
133
|
+
var parentDivClass = "sidebarIsOpen ".concat(_quizCommon.END_EDITING_TRIGGER_CLASSNAME);
|
|
131
134
|
return (0, _emotion.jsx)("div", {
|
|
132
|
-
className:
|
|
135
|
+
className: parentDivClass,
|
|
133
136
|
css: styles.sidebarItem
|
|
134
137
|
}, (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
135
138
|
justifyItems: "space-between"
|
|
@@ -23,6 +23,7 @@ var _index3 = _interopRequireDefault(require("./Summary/index.js"));
|
|
|
23
23
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
24
24
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
25
25
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
26
|
+
var _quizCommon = require("@instructure/quiz-common");
|
|
26
27
|
var _dec, _class, _SidebarStimulus;
|
|
27
28
|
/** @jsx jsx */
|
|
28
29
|
var DISPLAY_AS_SUMMARY_LIMIT = 5;
|
|
@@ -90,7 +91,8 @@ var SidebarStimulus = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.de
|
|
|
90
91
|
margin: "small",
|
|
91
92
|
forceButtonRole: false,
|
|
92
93
|
onClick: this.scrollToItem,
|
|
93
|
-
renderIcon: _ref
|
|
94
|
+
renderIcon: _ref,
|
|
95
|
+
className: _quizCommon.END_EDITING_TRIGGER_CLASSNAME
|
|
94
96
|
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Navigate to stimulus at position { displayPosition }', {
|
|
95
97
|
displayPosition: displayPosition
|
|
96
98
|
})));
|
|
@@ -18,6 +18,7 @@ var _emotion = require("@instructure/emotion");
|
|
|
18
18
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
19
19
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
20
20
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
21
|
+
var _quizCommon = require("@instructure/quiz-common");
|
|
21
22
|
var _dec, _class, _AddContentButton;
|
|
22
23
|
/** @jsx jsx */
|
|
23
24
|
var AddContentButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_AddContentButton = /*#__PURE__*/function (_Component) {
|
|
@@ -67,6 +68,7 @@ var AddContentButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.d
|
|
|
67
68
|
key: "renderNonStimulus",
|
|
68
69
|
value: function renderNonStimulus() {
|
|
69
70
|
return (0, _emotion.jsx)("div", {
|
|
71
|
+
className: _quizCommon.END_EDITING_TRIGGER_CLASSNAME,
|
|
70
72
|
css: this.props.styles.newItemButtonHolder
|
|
71
73
|
}, (0, _emotion.jsx)("button", {
|
|
72
74
|
ref: this.storeButtonElemRef,
|
|
@@ -26,7 +26,7 @@ var _index = _interopRequireDefault(require("../../../../../banks/components/Add
|
|
|
26
26
|
var _index2 = _interopRequireDefault(require("../../../../../building/components/resources/AddToBankOptions/index.js"));
|
|
27
27
|
var _index3 = _interopRequireDefault(require("../../WarningWrapper/index.js"));
|
|
28
28
|
var _CustomPropTypes = _interopRequireDefault(require("../../../../../common/util/CustomPropTypes.js"));
|
|
29
|
-
var
|
|
29
|
+
var _clickHandlers = require("../../../../../common/util/clickHandlers.js");
|
|
30
30
|
var _index4 = _interopRequireDefault(require("../StimulusShowInfo/index.js"));
|
|
31
31
|
var _index5 = _interopRequireDefault(require("../StimulusEditInfo/index.js"));
|
|
32
32
|
var _componentWithOutsideClickEmotion = _interopRequireDefault(require("../../../shared/functionality/componentWithOutsideClickEmotion.js"));
|
|
@@ -293,12 +293,10 @@ var StimulusEdit = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defau
|
|
|
293
293
|
}, {
|
|
294
294
|
key: "ignoreClickOutsideIf",
|
|
295
295
|
value: function ignoreClickOutsideIf(e) {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
});
|
|
301
|
-
return outsideApp;
|
|
296
|
+
var _checkClickedNode = (0, _clickHandlers.checkClickedNode)(e, this.props.appContainer),
|
|
297
|
+
isEndEditingTrigger = _checkClickedNode.isEndEditingTrigger,
|
|
298
|
+
outsideApp = _checkClickedNode.outsideApp;
|
|
299
|
+
return outsideApp || !isEndEditingTrigger;
|
|
302
300
|
}
|
|
303
301
|
}, {
|
|
304
302
|
key: "afterSubmit",
|
|
@@ -39,7 +39,8 @@ var TagWrapper = /*#__PURE__*/function (_Component) {
|
|
|
39
39
|
var _this$props = this.props,
|
|
40
40
|
id = _this$props.id,
|
|
41
41
|
text = _this$props.text,
|
|
42
|
-
index = _this$props.index
|
|
42
|
+
index = _this$props.index,
|
|
43
|
+
themeOverride = _this$props.themeOverride;
|
|
43
44
|
return /*#__PURE__*/_react.default.createElement(_uiTag.Tag, {
|
|
44
45
|
text: /*#__PURE__*/_react.default.createElement(_uiA11yContent.AccessibleContent, {
|
|
45
46
|
alt: (0, _formatMessage.default)('Remove {label}', {
|
|
@@ -49,7 +50,8 @@ var TagWrapper = /*#__PURE__*/function (_Component) {
|
|
|
49
50
|
dismissible: true,
|
|
50
51
|
key: id,
|
|
51
52
|
margin: index > 0 ? 'xxx-small 0 xxx-small xx-small' : 'xxx-small 0',
|
|
52
|
-
onClick: this.dismissTag
|
|
53
|
+
onClick: this.dismissTag,
|
|
54
|
+
themeOverride: themeOverride
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
57
|
}]);
|
|
@@ -61,7 +63,11 @@ TagWrapper.propTypes = {
|
|
|
61
63
|
text: _propTypes.default.string.isRequired,
|
|
62
64
|
index: _propTypes.default.number.isRequired,
|
|
63
65
|
id: _propTypes.default.string.isRequired,
|
|
64
|
-
onClick: _propTypes.default.func.isRequired
|
|
66
|
+
onClick: _propTypes.default.func.isRequired,
|
|
67
|
+
themeOverride: _propTypes.default.object
|
|
68
|
+
};
|
|
69
|
+
TagWrapper.defaultProps = {
|
|
70
|
+
themeOverride: {}
|
|
65
71
|
};
|
|
66
72
|
var _default = TagWrapper;
|
|
67
73
|
exports.default = _default;
|
|
@@ -15,6 +15,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
var _emotion = require("@instructure/emotion");
|
|
16
16
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
17
17
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
18
|
+
var _quizCommon = require("@instructure/quiz-common");
|
|
18
19
|
var _dec, _class, _Overlay;
|
|
19
20
|
/** @jsx jsx */
|
|
20
21
|
/* eslint "jsx-a11y/click-events-have-key-events": "warn" */
|
|
@@ -37,9 +38,10 @@ var Overlay = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
37
38
|
if (this.props.hideOverlay) {
|
|
38
39
|
return null;
|
|
39
40
|
}
|
|
41
|
+
var overlayClass = "overlay ".concat(_quizCommon.END_EDITING_TRIGGER_CLASSNAME);
|
|
40
42
|
return (0, _emotion.jsx)("div", {
|
|
41
43
|
role: "presentation",
|
|
42
|
-
className:
|
|
44
|
+
className: overlayClass,
|
|
43
45
|
css: this.props.styles.overlay,
|
|
44
46
|
onClick: this.props.onClick,
|
|
45
47
|
"data-automation": "sdk-overlay"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.checkClickedNode = checkClickedNode;
|
|
8
|
+
var _ElementsForSelectors = _interopRequireDefault(require("./ElementsForSelectors.js"));
|
|
9
|
+
var _quizCommon = require("@instructure/quiz-common");
|
|
10
|
+
function checkClickedNode(e, appContainer) {
|
|
11
|
+
// Need to iterate over the appNodes since Gauge and lti have a different index for the sdk node
|
|
12
|
+
var appNodes = (0, _ElementsForSelectors.default)(appContainer);
|
|
13
|
+
var outsideApp = appNodes.every(function (node) {
|
|
14
|
+
return node && !node.contains(e.target);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// checking if the click was on an element that should end editing
|
|
18
|
+
var endEditingNodes = (0, _ElementsForSelectors.default)(".".concat(_quizCommon.END_EDITING_TRIGGER_CLASSNAME));
|
|
19
|
+
var isEndEditingTrigger = endEditingNodes.some(function (node) {
|
|
20
|
+
return node && node.contains(e.target);
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
isEndEditingTrigger: isEndEditingTrigger,
|
|
24
|
+
outsideApp: outsideApp
|
|
25
|
+
};
|
|
26
|
+
}
|