@instructure/quiz-core 17.53.1-rc.8 → 17.53.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.
- package/es/messages/postMessageService.js +10 -10
- package/es/messages/subjectHandlers/lti.capabilities.js +1 -1
- package/es/messages/subjectHandlers/lti.frameResize.js +1 -1
- package/es/messages/subjectHandlers/lti.get_data.js +1 -1
- package/es/messages/subjectHandlers/lti.put_data.js +5 -5
- package/lib/messages/postMessageService.js +10 -10
- package/lib/messages/subjectHandlers/lti.capabilities.js +1 -1
- package/lib/messages/subjectHandlers/lti.frameResize.js +1 -1
- package/lib/messages/subjectHandlers/lti.get_data.js +1 -1
- package/lib/messages/subjectHandlers/lti.put_data.js +5 -5
- package/package.json +9 -9
|
@@ -46,28 +46,28 @@ var PostMessageService = function PostMessageService() {
|
|
|
46
46
|
window.removeEventListener('message', _this.messageHandlerDispatcher);
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
this.sendResponse = function (subject, data, sourceWindow) {
|
|
49
|
+
this.sendResponse = function (subject, data, sourceWindow, origin) {
|
|
50
50
|
sourceWindow.postMessage(_objectSpread({
|
|
51
51
|
subject: subject + '.response'
|
|
52
|
-
}, data));
|
|
52
|
+
}, data), origin);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
this.sendSuccessPostMessageResponse = function (subject, message, sourceWindow) {
|
|
55
|
+
this.sendSuccessPostMessageResponse = function (subject, message, sourceWindow, origin) {
|
|
56
56
|
_this.sendResponse(subject, {
|
|
57
57
|
message: message
|
|
58
|
-
}, sourceWindow);
|
|
58
|
+
}, sourceWindow, origin);
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
this.sendErrorPostMessageResponse = function (subject, message, code, sourceWindow) {
|
|
62
|
-
_this.sendResponse(subject, _this.buildError(code, message), sourceWindow);
|
|
61
|
+
this.sendErrorPostMessageResponse = function (subject, message, code, sourceWindow, origin) {
|
|
62
|
+
_this.sendResponse(subject, _this.buildError(code, message), sourceWindow, origin);
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
this.sendBadRequestErrorPostMessageResponse = function (subject, errorMessage, sourceWindow) {
|
|
66
|
-
_this.sendErrorPostMessageResponse(subject, errorMessage, _this.BAD_REQUEST_ERROR_CODE, sourceWindow);
|
|
65
|
+
this.sendBadRequestErrorPostMessageResponse = function (subject, errorMessage, sourceWindow, origin) {
|
|
66
|
+
_this.sendErrorPostMessageResponse(subject, errorMessage, _this.BAD_REQUEST_ERROR_CODE, sourceWindow, origin);
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
this.sendGenericErrorPostMessageResponse = function (subject, errorMessage, sourceWindow) {
|
|
70
|
-
_this.sendErrorPostMessageResponse(subject, errorMessage, _this.GENERIC_ERROR_CODE, sourceWindow);
|
|
69
|
+
this.sendGenericErrorPostMessageResponse = function (subject, errorMessage, sourceWindow, origin) {
|
|
70
|
+
_this.sendErrorPostMessageResponse(subject, errorMessage, _this.GENERIC_ERROR_CODE, sourceWindow, origin);
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
this.buildError = function (code, message) {
|
|
@@ -4,7 +4,7 @@ var handleCapabilities = function handleCapabilities(event, postMessageService)
|
|
|
4
4
|
var supported_messages = postMessageService.capabilities();
|
|
5
5
|
postMessageService.sendResponse('lti.capabilities', {
|
|
6
6
|
supported_messages: supported_messages
|
|
7
|
-
}, sourceWindow);
|
|
7
|
+
}, sourceWindow, event.origin);
|
|
8
8
|
return true;
|
|
9
9
|
} catch (_unused) {
|
|
10
10
|
return false;
|
|
@@ -6,7 +6,7 @@ var handleFrameResize = function handleFrameResize(event, postMessageService) {
|
|
|
6
6
|
if (ltiIframe && event.data.height > 0) {
|
|
7
7
|
ltiIframe.height = event.data.height + 'px';
|
|
8
8
|
ltiIframe.style.height = event.data.height + 'px';
|
|
9
|
-
postMessageService.sendSuccessPostMessageResponse('lti.frameResize', void 0, event.source);
|
|
9
|
+
postMessageService.sendSuccessPostMessageResponse('lti.frameResize', void 0, event.source, event.origin);
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -19,7 +19,7 @@ var handleGetData = function handleGetData(event, postMessageService) {
|
|
|
19
19
|
postMessageService.sendSuccessPostMessageResponse('lti.get_data', {
|
|
20
20
|
key: key,
|
|
21
21
|
value: value
|
|
22
|
-
}, event.source);
|
|
22
|
+
}, event.source, event.origin);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export default handleGetData;
|
|
@@ -9,12 +9,12 @@ var handlePutData = function handlePutData(event, postMessageService) {
|
|
|
9
9
|
message_id = _event$data.message_id;
|
|
10
10
|
|
|
11
11
|
if (!key) {
|
|
12
|
-
postMessageService.sendBadRequestErrorPostMessageResponse(SUBJECT, "Missing required 'key' field", event.source);
|
|
12
|
+
postMessageService.sendBadRequestErrorPostMessageResponse(SUBJECT, "Missing required 'key' field", event.source, event.origin);
|
|
13
13
|
return true;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
if (!message_id) {
|
|
17
|
-
postMessageService.sendBadRequestErrorPostMessageResponse(SUBJECT, 'Missing required "message_id" field', event.source);
|
|
17
|
+
postMessageService.sendBadRequestErrorPostMessageResponse(SUBJECT, 'Missing required "message_id" field', event.source, event.origin);
|
|
18
18
|
return true;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -24,19 +24,19 @@ var handlePutData = function handlePutData(event, postMessageService) {
|
|
|
24
24
|
postMessageService.sendSuccessPostMessageResponse(SUBJECT, {
|
|
25
25
|
key: key,
|
|
26
26
|
value: value
|
|
27
|
-
}, event.source);
|
|
27
|
+
}, event.source, event.origin);
|
|
28
28
|
} catch (e) {
|
|
29
29
|
if (e instanceof StorageExhaustionError) {
|
|
30
30
|
var code = e.code;
|
|
31
31
|
var message = e.message;
|
|
32
|
-
postMessageService.sendErrorPostMessageResponse(SUBJECT, message, code, event.source);
|
|
32
|
+
postMessageService.sendErrorPostMessageResponse(SUBJECT, message, code, event.source, event.origin);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
} else {
|
|
36
36
|
localStorageAdapter.clearData(event.origin, key);
|
|
37
37
|
postMessageService.sendResponse(SUBJECT, {
|
|
38
38
|
key: key
|
|
39
|
-
}, event.source);
|
|
39
|
+
}, event.source, event.origin);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
|
|
@@ -60,28 +60,28 @@ var PostMessageService = function PostMessageService() {
|
|
|
60
60
|
window.removeEventListener('message', _this.messageHandlerDispatcher);
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
this.sendResponse = function (subject, data, sourceWindow) {
|
|
63
|
+
this.sendResponse = function (subject, data, sourceWindow, origin) {
|
|
64
64
|
sourceWindow.postMessage((0, _objectSpread2.default)({
|
|
65
65
|
subject: subject + '.response'
|
|
66
|
-
}, data));
|
|
66
|
+
}, data), origin);
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
this.sendSuccessPostMessageResponse = function (subject, message, sourceWindow) {
|
|
69
|
+
this.sendSuccessPostMessageResponse = function (subject, message, sourceWindow, origin) {
|
|
70
70
|
_this.sendResponse(subject, {
|
|
71
71
|
message: message
|
|
72
|
-
}, sourceWindow);
|
|
72
|
+
}, sourceWindow, origin);
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
this.sendErrorPostMessageResponse = function (subject, message, code, sourceWindow) {
|
|
76
|
-
_this.sendResponse(subject, _this.buildError(code, message), sourceWindow);
|
|
75
|
+
this.sendErrorPostMessageResponse = function (subject, message, code, sourceWindow, origin) {
|
|
76
|
+
_this.sendResponse(subject, _this.buildError(code, message), sourceWindow, origin);
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
this.sendBadRequestErrorPostMessageResponse = function (subject, errorMessage, sourceWindow) {
|
|
80
|
-
_this.sendErrorPostMessageResponse(subject, errorMessage, _this.BAD_REQUEST_ERROR_CODE, sourceWindow);
|
|
79
|
+
this.sendBadRequestErrorPostMessageResponse = function (subject, errorMessage, sourceWindow, origin) {
|
|
80
|
+
_this.sendErrorPostMessageResponse(subject, errorMessage, _this.BAD_REQUEST_ERROR_CODE, sourceWindow, origin);
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
this.sendGenericErrorPostMessageResponse = function (subject, errorMessage, sourceWindow) {
|
|
84
|
-
_this.sendErrorPostMessageResponse(subject, errorMessage, _this.GENERIC_ERROR_CODE, sourceWindow);
|
|
83
|
+
this.sendGenericErrorPostMessageResponse = function (subject, errorMessage, sourceWindow, origin) {
|
|
84
|
+
_this.sendErrorPostMessageResponse(subject, errorMessage, _this.GENERIC_ERROR_CODE, sourceWindow, origin);
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
this.buildError = function (code, message) {
|
|
@@ -11,7 +11,7 @@ var handleCapabilities = function handleCapabilities(event, postMessageService)
|
|
|
11
11
|
var supported_messages = postMessageService.capabilities();
|
|
12
12
|
postMessageService.sendResponse('lti.capabilities', {
|
|
13
13
|
supported_messages: supported_messages
|
|
14
|
-
}, sourceWindow);
|
|
14
|
+
}, sourceWindow, event.origin);
|
|
15
15
|
return true;
|
|
16
16
|
} catch (_unused) {
|
|
17
17
|
return false;
|
|
@@ -13,7 +13,7 @@ var handleFrameResize = function handleFrameResize(event, postMessageService) {
|
|
|
13
13
|
if (ltiIframe && event.data.height > 0) {
|
|
14
14
|
ltiIframe.height = event.data.height + 'px';
|
|
15
15
|
ltiIframe.style.height = event.data.height + 'px';
|
|
16
|
-
postMessageService.sendSuccessPostMessageResponse('lti.frameResize', void 0, event.source);
|
|
16
|
+
postMessageService.sendSuccessPostMessageResponse('lti.frameResize', void 0, event.source, event.origin);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -27,7 +27,7 @@ var handleGetData = function handleGetData(event, postMessageService) {
|
|
|
27
27
|
postMessageService.sendSuccessPostMessageResponse('lti.get_data', {
|
|
28
28
|
key: key,
|
|
29
29
|
value: value
|
|
30
|
-
}, event.source);
|
|
30
|
+
}, event.source, event.origin);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
var _default = handleGetData;
|
|
@@ -20,12 +20,12 @@ var handlePutData = function handlePutData(event, postMessageService) {
|
|
|
20
20
|
message_id = _event$data.message_id;
|
|
21
21
|
|
|
22
22
|
if (!key) {
|
|
23
|
-
postMessageService.sendBadRequestErrorPostMessageResponse(SUBJECT, "Missing required 'key' field", event.source);
|
|
23
|
+
postMessageService.sendBadRequestErrorPostMessageResponse(SUBJECT, "Missing required 'key' field", event.source, event.origin);
|
|
24
24
|
return true;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
if (!message_id) {
|
|
28
|
-
postMessageService.sendBadRequestErrorPostMessageResponse(SUBJECT, 'Missing required "message_id" field', event.source);
|
|
28
|
+
postMessageService.sendBadRequestErrorPostMessageResponse(SUBJECT, 'Missing required "message_id" field', event.source, event.origin);
|
|
29
29
|
return true;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -36,12 +36,12 @@ var handlePutData = function handlePutData(event, postMessageService) {
|
|
|
36
36
|
postMessageService.sendSuccessPostMessageResponse(SUBJECT, {
|
|
37
37
|
key: key,
|
|
38
38
|
value: value
|
|
39
|
-
}, event.source);
|
|
39
|
+
}, event.source, event.origin);
|
|
40
40
|
} catch (e) {
|
|
41
41
|
if (e instanceof _StorageExhaustionError.default) {
|
|
42
42
|
var code = e.code;
|
|
43
43
|
var message = e.message;
|
|
44
|
-
postMessageService.sendErrorPostMessageResponse(SUBJECT, message, code, event.source);
|
|
44
|
+
postMessageService.sendErrorPostMessageResponse(SUBJECT, message, code, event.source, event.origin);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
} else {
|
|
@@ -49,7 +49,7 @@ var handlePutData = function handlePutData(event, postMessageService) {
|
|
|
49
49
|
|
|
50
50
|
postMessageService.sendResponse(SUBJECT, {
|
|
51
51
|
key: key
|
|
52
|
-
}, event.source);
|
|
52
|
+
}, event.source, event.origin);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "17.53.1-rc.
|
|
3
|
+
"version": "17.53.1-rc.9+068395446",
|
|
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.7",
|
|
44
|
-
"@instructure/quiz-common": "17.53.1-rc.
|
|
45
|
-
"@instructure/quiz-i18n": "17.53.1-rc.
|
|
46
|
-
"@instructure/quiz-interactions": "17.53.1-rc.
|
|
47
|
-
"@instructure/quiz-number-input": "17.53.1-rc.
|
|
48
|
-
"@instructure/quiz-rce": "17.53.1-rc.
|
|
44
|
+
"@instructure/quiz-common": "17.53.1-rc.9+068395446",
|
|
45
|
+
"@instructure/quiz-i18n": "17.53.1-rc.9+068395446",
|
|
46
|
+
"@instructure/quiz-interactions": "17.53.1-rc.9+068395446",
|
|
47
|
+
"@instructure/quiz-number-input": "17.53.1-rc.9+068395446",
|
|
48
|
+
"@instructure/quiz-rce": "17.53.1-rc.9+068395446",
|
|
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.53.1-rc.
|
|
109
|
+
"instructure-validations": "17.53.1-rc.9+068395446",
|
|
110
110
|
"ipaddr.js": "^1.5.4",
|
|
111
111
|
"isomorphic-fetch": "^2.2.0",
|
|
112
112
|
"isuuid": "^0.1.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.53.1-rc.
|
|
159
|
+
"quiz-presets": "17.53.1-rc.9+068395446",
|
|
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": "
|
|
175
|
+
"gitHead": "0683954467e1e2f12b08a4d7e1561963926a789e"
|
|
176
176
|
}
|