@gamelearn/arcade-components 0.17.5 → 0.18.0

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.
@@ -36,8 +36,10 @@ var READING_TIME = 0.2;
36
36
  var LecturesComponent = function LecturesComponent(_ref) {
37
37
  var emitEvent = _ref.emitEvent,
38
38
  name = _ref.name,
39
+ name_labelId = _ref.name_labelId,
39
40
  required = _ref.required,
40
41
  text = _ref.text,
42
+ text_labelId = _ref.text_labelId,
41
43
  visible = _ref.visible,
42
44
  documentType = _ref.documentType,
43
45
  viewed = _ref.viewed,
@@ -66,14 +68,14 @@ var LecturesComponent = function LecturesComponent(_ref) {
66
68
  emitEvent({
67
69
  type: 'finishMedia',
68
70
  payload: {
69
- name: name,
71
+ name: name_labelId,
70
72
  type: 'text',
71
- text: text,
73
+ text: text_labelId,
72
74
  documentType: documentType
73
75
  }
74
76
  });
75
77
  }
76
- }, [documentType, emitEvent, goToLecture, name, text]);
78
+ }, [documentType, emitEvent, goToLecture, name_labelId, text_labelId]);
77
79
  (0, _react.useEffect)(function () {
78
80
  if (!visible && !saved) {
79
81
  close();
@@ -36,7 +36,7 @@ var defaultBgImageForAudio = "https://min.gamelearn.io/css-resources/gamelearn/r
36
36
  var VideoVisor = function VideoVisor(_ref) {
37
37
  var documentType = _ref.documentType,
38
38
  url = _ref.url,
39
- imgId = _ref.imgId,
39
+ backgroundImage = _ref.backgroundImage,
40
40
  endVideo = _ref.endVideo;
41
41
 
42
42
  var _useState = (0, _react.useState)(),
@@ -93,7 +93,7 @@ var VideoVisor = function VideoVisor(_ref) {
93
93
 
94
94
  return undefined;
95
95
  }, [isHls, url, videoPlayer]);
96
- var audioBackgroundImage = imgId || defaultBgImageForAudio;
96
+ var audioBackgroundImage = backgroundImage || defaultBgImageForAudio;
97
97
  var CoverOrContain = audioBackgroundImage === defaultBgImageForAudio ? "cover" : "contain";
98
98
  var configForAudio = {
99
99
  backgroundImage: "url(\"".concat(audioBackgroundImage, "\")"),
@@ -128,7 +128,7 @@ var VideoVisor = function VideoVisor(_ref) {
128
128
  VideoVisor.defaultProps = {
129
129
  url: "",
130
130
  name: "",
131
- imgId: null,
131
+ backgroundImage: null,
132
132
  documentType: "",
133
133
  required: false,
134
134
  viewed: false,
@@ -40,7 +40,8 @@ var PdfComponent = function PdfComponent(_ref) {
40
40
  required = _ref.required,
41
41
  viewed = _ref.viewed,
42
42
  visible = _ref.visible,
43
- props = _objectWithoutProperties(_ref, ["emitEvent", "documentType", "name", "required", "viewed", "visible"]);
43
+ documentId = _ref.documentId,
44
+ props = _objectWithoutProperties(_ref, ["emitEvent", "documentType", "name", "required", "viewed", "visible", "documentId"]);
44
45
 
45
46
  var translate = function translate(id) {
46
47
  return emitEvent({
@@ -63,10 +64,10 @@ var PdfComponent = function PdfComponent(_ref) {
63
64
  return {
64
65
  documentType: documentType,
65
66
  name: name,
66
- document: documentFile,
67
+ documentId: documentId,
67
68
  type: 'pdf'
68
69
  };
69
- }, [documentType, name, documentFile]);
70
+ }, [documentType, name, documentId]);
70
71
  var emitFinish = (0, _react.useCallback)(function () {
71
72
  emitEvent({
72
73
  type: 'finishMedia',
@@ -22,22 +22,24 @@ var VideoComponent = function VideoComponent(_ref) {
22
22
  name = _ref.name,
23
23
  documentType = _ref.documentType,
24
24
  document = _ref.document,
25
+ documentId = _ref.documentId,
25
26
  required = _ref.required,
26
27
  viewed = _ref.viewed,
27
28
  visible = _ref.visible,
28
- img = _ref.img;
29
+ img = _ref.img,
30
+ imgId = _ref.imgId;
29
31
  var url = document.url;
30
32
  var item = (0, _react.useMemo)(function () {
31
33
  return {
32
- document: document,
33
- img: img,
34
+ documentId: documentId,
35
+ imgId: imgId,
34
36
  required: required,
35
37
  name: name,
36
38
  type: 'video',
37
39
  viewed: viewed,
38
40
  documentType: documentType
39
41
  };
40
- }, [document, required, name, viewed, img, documentType]);
42
+ }, [documentId, imgId, required, name, viewed, documentType]);
41
43
 
42
44
  var _endVideo = (0, _react.useCallback)(function () {
43
45
  emitEvent({
@@ -57,7 +59,7 @@ var VideoComponent = function VideoComponent(_ref) {
57
59
  }
58
60
 
59
61
  return /*#__PURE__*/_react.default.createElement(_videoVisor.default, {
60
- imgId: img === null || img === void 0 ? void 0 : img.url,
62
+ backgroundImage: img === null || img === void 0 ? void 0 : img.url,
61
63
  url: url,
62
64
  documentType: documentType,
63
65
  required: required,
@@ -11,8 +11,6 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _hls = _interopRequireDefault(require("hls.js"));
13
13
 
14
- var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
14
  var _VideoControllers = _interopRequireDefault(require("./VideoControllers"));
17
15
 
18
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -42,7 +40,7 @@ var VideoVisor = function VideoVisor(_ref) {
42
40
  url = _ref.url,
43
41
  required = _ref.required,
44
42
  viewed = _ref.viewed,
45
- imgId = _ref.imgId,
43
+ backgroundImage = _ref.backgroundImage,
46
44
  endVideo = _ref.endVideo;
47
45
 
48
46
  var _useState = (0, _react.useState)(0),
@@ -216,7 +214,7 @@ var VideoVisor = function VideoVisor(_ref) {
216
214
  }
217
215
  };
218
216
 
219
- var audioBackgroundImage = imgId || defaultBgImageForAudio;
217
+ var audioBackgroundImage = backgroundImage || defaultBgImageForAudio;
220
218
  var CoverOrContain = audioBackgroundImage === defaultBgImageForAudio ? "cover" : "contain";
221
219
  var configForAudio = {
222
220
  backgroundImage: "url(\"".concat(audioBackgroundImage, "\")"),
@@ -289,20 +287,11 @@ var VideoVisor = function VideoVisor(_ref) {
289
287
  VideoVisor.defaultProps = {
290
288
  url: "",
291
289
  name: "",
292
- imgId: null,
290
+ backgroundImage: null,
293
291
  documentType: "",
294
292
  required: false,
295
293
  viewed: false,
296
294
  endVideo: function endVideo() {}
297
295
  };
298
- VideoVisor.propTypes = {
299
- endVideo: _propTypes.default.func,
300
- url: _propTypes.default.string,
301
- documentType: _propTypes.default.string,
302
- name: _propTypes.default.string,
303
- imgId: _propTypes.default.string,
304
- required: _propTypes.default.bool,
305
- viewed: _propTypes.default.bool
306
- };
307
296
  var _default = VideoVisor;
308
297
  exports.default = _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "license": "Gamelearn",
4
- "version": "0.17.5",
4
+ "version": "0.18.0",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist",