@instructure/quiz-core 17.41.1-rc.13 → 17.41.1-rc.14

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.
@@ -98,7 +98,7 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
98
98
 
99
99
  useEffect(function () {
100
100
  _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
101
- var endpoint, response, json;
101
+ var host, base, url, response, json;
102
102
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
103
103
  while (1) {
104
104
  switch (_context2.prev = _context2.next) {
@@ -113,41 +113,45 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
113
113
  return _context2.abrupt("return");
114
114
 
115
115
  case 3:
116
- endpoint = "".concat(props.rcsHost, "/api/rceConfig?contextType=").concat(props.contextType, "&contextId=").concat(props.contextId);
117
- _context2.next = 6;
118
- return fetch(endpoint, {
116
+ host = props.rcsHost;
117
+ base = host.match(/^https?:\/\//) ? host : "".concat(window.location.protocol, "//").concat(host);
118
+ url = new URL('/api/rceConfig', base);
119
+ url.searchParams.append('contextType', props.contextType);
120
+ url.searchParams.append('contextId', props.contextId);
121
+ _context2.next = 10;
122
+ return fetch(url.href, {
119
123
  headers: {
120
124
  'Authorization': "Bearer ".concat(props.rcsJwt)
121
125
  }
122
126
  });
123
127
 
124
- case 6:
128
+ case 10:
125
129
  response = _context2.sent;
126
- _context2.next = 9;
130
+ _context2.next = 13;
127
131
  return response.json();
128
132
 
129
- case 9:
133
+ case 13:
130
134
  json = _context2.sent;
131
135
  setCanvasConfig(json);
132
- _context2.next = 16;
136
+ _context2.next = 20;
133
137
  break;
134
138
 
135
- case 13:
136
- _context2.prev = 13;
139
+ case 17:
140
+ _context2.prev = 17;
137
141
  _context2.t0 = _context2["catch"](0);
138
142
  setCanvasConfig(null);
139
143
 
140
- case 16:
141
- _context2.prev = 16;
144
+ case 20:
145
+ _context2.prev = 20;
142
146
  setCanvasConfigLoading(false);
143
- return _context2.finish(16);
147
+ return _context2.finish(20);
144
148
 
145
- case 19:
149
+ case 23:
146
150
  case "end":
147
151
  return _context2.stop();
148
152
  }
149
153
  }
150
- }, _callee2, null, [[0, 13, 16, 19]]);
154
+ }, _callee2, null, [[0, 17, 20, 23]]);
151
155
  }))();
152
156
  }, [props.useNewRce]);
153
157
  if (!props.useNewRce) return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
@@ -120,7 +120,7 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
120
120
 
121
121
  (0, _react.useEffect)(function () {
122
122
  (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
123
- var endpoint, response, json;
123
+ var host, base, url, response, json;
124
124
  return _regenerator.default.wrap(function _callee2$(_context2) {
125
125
  while (1) {
126
126
  switch (_context2.prev = _context2.next) {
@@ -135,41 +135,45 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
135
135
  return _context2.abrupt("return");
136
136
 
137
137
  case 3:
138
- endpoint = "".concat(props.rcsHost, "/api/rceConfig?contextType=").concat(props.contextType, "&contextId=").concat(props.contextId);
139
- _context2.next = 6;
140
- return fetch(endpoint, {
138
+ host = props.rcsHost;
139
+ base = host.match(/^https?:\/\//) ? host : "".concat(window.location.protocol, "//").concat(host);
140
+ url = new URL('/api/rceConfig', base);
141
+ url.searchParams.append('contextType', props.contextType);
142
+ url.searchParams.append('contextId', props.contextId);
143
+ _context2.next = 10;
144
+ return fetch(url.href, {
141
145
  headers: {
142
146
  'Authorization': "Bearer ".concat(props.rcsJwt)
143
147
  }
144
148
  });
145
149
 
146
- case 6:
150
+ case 10:
147
151
  response = _context2.sent;
148
- _context2.next = 9;
152
+ _context2.next = 13;
149
153
  return response.json();
150
154
 
151
- case 9:
155
+ case 13:
152
156
  json = _context2.sent;
153
157
  setCanvasConfig(json);
154
- _context2.next = 16;
158
+ _context2.next = 20;
155
159
  break;
156
160
 
157
- case 13:
158
- _context2.prev = 13;
161
+ case 17:
162
+ _context2.prev = 17;
159
163
  _context2.t0 = _context2["catch"](0);
160
164
  setCanvasConfig(null);
161
165
 
162
- case 16:
163
- _context2.prev = 16;
166
+ case 20:
167
+ _context2.prev = 20;
164
168
  setCanvasConfigLoading(false);
165
- return _context2.finish(16);
169
+ return _context2.finish(20);
166
170
 
167
- case 19:
171
+ case 23:
168
172
  case "end":
169
173
  return _context2.stop();
170
174
  }
171
175
  }
172
- }, _callee2, null, [[0, 13, 16, 19]]);
176
+ }, _callee2, null, [[0, 17, 20, 23]]);
173
177
  }))();
174
178
  }, [props.useNewRce]);
175
179
  if (!props.useNewRce) return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, props.children);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "17.41.1-rc.13+deb056816",
3
+ "version": "17.41.1-rc.14+82298d433",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -41,11 +41,11 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@instructure/outcomes-ui": "^2.1.2",
44
- "@instructure/quiz-common": "17.41.1-rc.13+deb056816",
45
- "@instructure/quiz-i18n": "17.41.1-rc.13+deb056816",
46
- "@instructure/quiz-interactions": "17.41.1-rc.13+deb056816",
47
- "@instructure/quiz-number-input": "17.41.1-rc.13+deb056816",
48
- "@instructure/quiz-rce": "17.41.1-rc.13+deb056816",
44
+ "@instructure/quiz-common": "17.41.1-rc.14+82298d433",
45
+ "@instructure/quiz-i18n": "17.41.1-rc.14+82298d433",
46
+ "@instructure/quiz-interactions": "17.41.1-rc.14+82298d433",
47
+ "@instructure/quiz-number-input": "17.41.1-rc.14+82298d433",
48
+ "@instructure/quiz-rce": "17.41.1-rc.14+82298d433",
49
49
  "@instructure/ui-a11y-content": "^7.20.0",
50
50
  "@instructure/ui-alerts": "^7.20.0",
51
51
  "@instructure/ui-avatar": "^7.20.0",
@@ -106,7 +106,7 @@
106
106
  "eventemitter3": "^3.1.0",
107
107
  "humps": "^2.0.0",
108
108
  "immutable": "^3.8.1",
109
- "instructure-validations": "17.41.1-rc.13+deb056816",
109
+ "instructure-validations": "17.41.1-rc.14+82298d433",
110
110
  "ipaddr.js": "^1.5.4",
111
111
  "isomorphic-fetch": "^2.2.0",
112
112
  "isuuid": "^0.1.0",
@@ -137,7 +137,7 @@
137
137
  "uuid": "^3.2.1"
138
138
  },
139
139
  "devDependencies": {
140
- "@instructure/quiz-scripts": "17.41.1-rc.13+deb056816",
140
+ "@instructure/quiz-scripts": "17.41.1-rc.14+82298d433",
141
141
  "@instructure/ui-axe-check": "^7.20.0",
142
142
  "@instructure/ui-babel-preset": "^7.20.0",
143
143
  "@instructure/ui-karma-config": "^7.20.0",
@@ -156,7 +156,7 @@
156
156
  "intl": "^1.2.4",
157
157
  "jquery": "^2.2.3",
158
158
  "most-subject": "^5.3.0",
159
- "quiz-presets": "17.41.1-rc.13+deb056816",
159
+ "quiz-presets": "17.41.1-rc.14+82298d433",
160
160
  "react": "^16.8.6",
161
161
  "react-addons-test-utils": "^15.6.2",
162
162
  "react-dom": "^16.8.6",
@@ -172,5 +172,5 @@
172
172
  "publishConfig": {
173
173
  "access": "public"
174
174
  },
175
- "gitHead": "deb0568160dae9096a4efc24a2632d68d2348497"
175
+ "gitHead": "82298d4336c3f8cbbb8d4059c2b4460e13f65d56"
176
176
  }