@instructure/quiz-core 22.5.1-rc.7 → 22.5.1-rc.9

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.
@@ -610,7 +610,7 @@ export var BankEntry = (_dec = withStyleOverrides(generateStyle, generateCompone
610
610
  useBankTags = _this$props3.useBankTags;
611
611
  var props = this.editProps(entry);
612
612
  var propsFunc = this.isItemEntry() ? propsForItemVersioningWrapper : propsForStimulusVersioningWrapper;
613
- var versioningProps = propsFunc(entry.isImmutable(), this.props.shouldClone, this.props.setShouldClone, this.navigateToBank, true);
613
+ var versioningProps = propsFunc(entry.isImmutable(), this.props.shouldClone, this.props.setShouldClone, this.navigateToBank, true, 'warning', this.isPassageEntry());
614
614
  var canEdit = !entry.isImmutable() || this.props.shouldClone;
615
615
  var ItemComponent = canEdit ? ItemEdit : ItemShow;
616
616
  var StimulusComponent = canEdit ? StimulusEditInfo : StimulusShowInfo;
@@ -177,6 +177,7 @@ export var Quiz = (_dec = withStateCache(function (quiz) {
177
177
  title: t('Add Title...'),
178
178
  filterIpAddress: false,
179
179
  filters: Map(),
180
- valid: true
180
+ valid: true,
181
+ detectMultipleSessions: false
181
182
  })), _applyDecoratedDescriptor(_class.prototype, "getQuizEntries", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "getQuizEntries"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "getWorkingQuizEntries", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, "getWorkingQuizEntries"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "getWorkingInstance", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, "getWorkingInstance"), _class.prototype), _class);
182
183
  export default Quiz;
@@ -0,0 +1,43 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ export var LocalStoreService = /*#__PURE__*/function () {
4
+ function LocalStoreService(storage) {
5
+ _classCallCheck(this, LocalStoreService);
6
+ try {
7
+ this.storage = storage || window.localStorage;
8
+ } catch (_unused) {
9
+ this.storage = undefined;
10
+ }
11
+ this.isEnabled = this.checkStorageEnabled();
12
+ }
13
+ return _createClass(LocalStoreService, [{
14
+ key: "checkStorageEnabled",
15
+ value: function checkStorageEnabled() {
16
+ if (!this.storage) return false;
17
+ var testKey = 'localStorageCheck';
18
+ var testValue = 'just checking';
19
+ try {
20
+ this.set(testKey, testValue);
21
+ return this.get(testKey) === testValue;
22
+ } catch (_unused2) {
23
+ return false;
24
+ }
25
+ }
26
+ }, {
27
+ key: "get",
28
+ value: function get(key) {
29
+ return this.storage.getItem(key);
30
+ }
31
+ }, {
32
+ key: "set",
33
+ value: function set(key, value) {
34
+ return value ? this.storage.setItem(key, value) : this.remove(key);
35
+ }
36
+ }, {
37
+ key: "remove",
38
+ value: function remove(key) {
39
+ return this.storage.removeItem(key);
40
+ }
41
+ }]);
42
+ }();
43
+ export default LocalStoreService;
package/es/index.js CHANGED
@@ -83,6 +83,7 @@ export { RetryGradePassbackButton } from './moderating/components/resources/Retr
83
83
  export { GenericAsyncSearch } from './common/components/shared/GenericAsyncSearch/GenericAsyncSearch';
84
84
  export { MaskedTextInput } from './common/components/MaskedTextInput';
85
85
  export { AccessCodeTextInput } from './common/components/AccessCodeTextInput';
86
+ export { LocalStoreService } from './common/util/localStoreService';
86
87
 
87
88
  // Utilities
88
89
  export { environment as config } from './config';
@@ -617,7 +617,7 @@ var BankEntry = exports.BankEntry = (_dec = (0, _quizCommon.withStyleOverrides)(
617
617
  useBankTags = _this$props3.useBankTags;
618
618
  var props = this.editProps(entry);
619
619
  var propsFunc = this.isItemEntry() ? _warningHelpers.propsForItemVersioningWrapper : _warningHelpers.propsForStimulusVersioningWrapper;
620
- var versioningProps = propsFunc(entry.isImmutable(), this.props.shouldClone, this.props.setShouldClone, this.navigateToBank, true);
620
+ var versioningProps = propsFunc(entry.isImmutable(), this.props.shouldClone, this.props.setShouldClone, this.navigateToBank, true, 'warning', this.isPassageEntry());
621
621
  var canEdit = !entry.isImmutable() || this.props.shouldClone;
622
622
  var ItemComponent = canEdit ? _ItemEdit["default"] : _ItemShow["default"];
623
623
  var StimulusComponent = canEdit ? _StimulusEditInfo["default"] : _StimulusShowInfo["default"];
@@ -184,6 +184,7 @@ var Quiz = exports.Quiz = (_dec = (0, _withStateCache["default"])(function (quiz
184
184
  title: (0, _formatMessage["default"])('Add Title...'),
185
185
  filterIpAddress: false,
186
186
  filters: (0, _immutable.Map)(),
187
- valid: true
187
+ valid: true,
188
+ detectMultipleSessions: false
188
189
  })), (0, _applyDecoratedDescriptor2["default"])(_class.prototype, "getQuizEntries", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, "getQuizEntries"), _class.prototype), (0, _applyDecoratedDescriptor2["default"])(_class.prototype, "getWorkingQuizEntries", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, "getWorkingQuizEntries"), _class.prototype), (0, _applyDecoratedDescriptor2["default"])(_class.prototype, "getWorkingInstance", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, "getWorkingInstance"), _class.prototype), _class);
189
190
  var _default = exports["default"] = Quiz;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = exports.LocalStoreService = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var LocalStoreService = exports.LocalStoreService = /*#__PURE__*/function () {
11
+ function LocalStoreService(storage) {
12
+ (0, _classCallCheck2["default"])(this, LocalStoreService);
13
+ try {
14
+ this.storage = storage || window.localStorage;
15
+ } catch (_unused) {
16
+ this.storage = undefined;
17
+ }
18
+ this.isEnabled = this.checkStorageEnabled();
19
+ }
20
+ return (0, _createClass2["default"])(LocalStoreService, [{
21
+ key: "checkStorageEnabled",
22
+ value: function checkStorageEnabled() {
23
+ if (!this.storage) return false;
24
+ var testKey = 'localStorageCheck';
25
+ var testValue = 'just checking';
26
+ try {
27
+ this.set(testKey, testValue);
28
+ return this.get(testKey) === testValue;
29
+ } catch (_unused2) {
30
+ return false;
31
+ }
32
+ }
33
+ }, {
34
+ key: "get",
35
+ value: function get(key) {
36
+ return this.storage.getItem(key);
37
+ }
38
+ }, {
39
+ key: "set",
40
+ value: function set(key, value) {
41
+ return value ? this.storage.setItem(key, value) : this.remove(key);
42
+ }
43
+ }, {
44
+ key: "remove",
45
+ value: function remove(key) {
46
+ return this.storage.removeItem(key);
47
+ }
48
+ }]);
49
+ }();
50
+ var _default = exports["default"] = LocalStoreService;
package/lib/index.js CHANGED
@@ -82,6 +82,7 @@ var _exportNames = {
82
82
  GenericAsyncSearch: true,
83
83
  MaskedTextInput: true,
84
84
  AccessCodeTextInput: true,
85
+ LocalStoreService: true,
85
86
  config: true,
86
87
  Fetcher: true,
87
88
  httpHeaders: true,
@@ -406,6 +407,12 @@ Object.defineProperty(exports, "Legend", {
406
407
  return _Legend.Legend;
407
408
  }
408
409
  });
410
+ Object.defineProperty(exports, "LocalStoreService", {
411
+ enumerable: true,
412
+ get: function get() {
413
+ return _localStoreService.LocalStoreService;
414
+ }
415
+ });
409
416
  Object.defineProperty(exports, "MaskedTextInput", {
410
417
  enumerable: true,
411
418
  get: function get() {
@@ -1562,6 +1569,7 @@ var _RetryGradePassbackButton = require("./moderating/components/resources/Retry
1562
1569
  var _GenericAsyncSearch = require("./common/components/shared/GenericAsyncSearch/GenericAsyncSearch");
1563
1570
  var _MaskedTextInput = require("./common/components/MaskedTextInput");
1564
1571
  var _AccessCodeTextInput = require("./common/components/AccessCodeTextInput");
1572
+ var _localStoreService = require("./common/util/localStoreService");
1565
1573
  var _config = require("./config");
1566
1574
  var _Fetcher = require("./common/util/Fetcher");
1567
1575
  var _httpHeaders = require("./common/util/httpHeaders");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "22.5.1-rc.7+fb1785b02",
3
+ "version": "22.5.1-rc.9+1737286f2",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -46,11 +46,11 @@
46
46
  "@instructure/emotion": "10.14.0",
47
47
  "@instructure/grading-utils": "^1.0.0",
48
48
  "@instructure/outcomes-ui": "3.2.3",
49
- "@instructure/quiz-common": "22.5.1-rc.7+fb1785b02",
50
- "@instructure/quiz-i18n": "22.5.1-rc.7+fb1785b02",
51
- "@instructure/quiz-interactions": "22.5.1-rc.7+fb1785b02",
52
- "@instructure/quiz-number-input": "22.5.1-rc.7+fb1785b02",
53
- "@instructure/quiz-rce": "22.5.1-rc.7+fb1785b02",
49
+ "@instructure/quiz-common": "22.5.1-rc.9+1737286f2",
50
+ "@instructure/quiz-i18n": "22.5.1-rc.9+1737286f2",
51
+ "@instructure/quiz-interactions": "22.5.1-rc.9+1737286f2",
52
+ "@instructure/quiz-number-input": "22.5.1-rc.9+1737286f2",
53
+ "@instructure/quiz-rce": "22.5.1-rc.9+1737286f2",
54
54
  "@instructure/ui-a11y-content": "10.14.0",
55
55
  "@instructure/ui-alerts": "10.14.0",
56
56
  "@instructure/ui-avatar": "10.14.0",
@@ -109,7 +109,7 @@
109
109
  "file-saver": "~2.0.5",
110
110
  "humps": "^2.0.0",
111
111
  "immutable": "^3.8.1",
112
- "instructure-validations": "22.5.1-rc.7+fb1785b02",
112
+ "instructure-validations": "22.5.1-rc.9+1737286f2",
113
113
  "ipaddr.js": "^1.5.4",
114
114
  "isomorphic-fetch": "^2.2.0",
115
115
  "isuuid": "^0.1.0",
@@ -158,7 +158,7 @@
158
158
  "jquery": "^2.2.3",
159
159
  "karma-junit-reporter": "^2.0.1",
160
160
  "most-subject": "^5.3.0",
161
- "quiz-presets": "22.5.1-rc.7+fb1785b02",
161
+ "quiz-presets": "22.5.1-rc.9+1737286f2",
162
162
  "react": "^16.8.6",
163
163
  "react-addons-test-utils": "^15.6.2",
164
164
  "react-dom": "^16.8.6",
@@ -174,5 +174,5 @@
174
174
  "publishConfig": {
175
175
  "access": "public"
176
176
  },
177
- "gitHead": "fb1785b02d084ad6dfc2722f6031c484a06cfb5e"
177
+ "gitHead": "1737286f28fa3aa9359079ea3fed7e493550d06b"
178
178
  }