@gamelearn/arcade-components 1.4.10 → 1.4.11-fix1

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.
@@ -144,6 +144,10 @@ var DecisionComponent = function DecisionComponent(_ref) {
144
144
  onFinish: function onFinish() {
145
145
  if (_onFinish) {
146
146
  _onFinish();
147
+ } else {
148
+ emitEvent({
149
+ type: 'success'
150
+ });
147
151
  }
148
152
 
149
153
  setResultChoice({});
@@ -264,19 +264,21 @@ var DragItemPuzzleComponent = function DragItemPuzzleComponent(_ref) {
264
264
  currentImage.src = imageUrl;
265
265
 
266
266
  currentImage.onload = function () {
267
- layerConfig.current = {
268
- x: canvas.current.clientWidth / 2,
269
- y: canvas.current.clientHeight / 2,
270
- width: currentImage.width,
271
- height: currentImage.height,
272
- offsetX: currentImage.width / 2,
273
- offsetY: currentImage.height / 2,
274
- scale: {
275
- x: Math.min(canvas.current.clientWidth / currentImage.width, canvas.current.clientHeight / currentImage.height),
276
- y: Math.min(canvas.current.clientWidth / currentImage.width, canvas.current.clientHeight / currentImage.height)
277
- }
278
- };
279
- setImageLoaded(true);
267
+ if (canvas.current) {
268
+ layerConfig.current = {
269
+ x: canvas.current.clientWidth / 2,
270
+ y: canvas.current.clientHeight / 2,
271
+ width: currentImage.width,
272
+ height: currentImage.height,
273
+ offsetX: currentImage.width / 2,
274
+ offsetY: currentImage.height / 2,
275
+ scale: {
276
+ x: Math.min(canvas.current.clientWidth / currentImage.width, canvas.current.clientHeight / currentImage.height),
277
+ y: Math.min(canvas.current.clientWidth / currentImage.width, canvas.current.clientHeight / currentImage.height)
278
+ }
279
+ };
280
+ setImageLoaded(true);
281
+ }
280
282
  };
281
283
 
282
284
  setShowTooltip(true);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "1.4.10",
5
+ "version": "1.4.11-fix1",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",