educoreapp2 1.0.77 → 1.0.79

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.
Files changed (53) hide show
  1. package/dist/App.css +111 -0
  2. package/dist/EduApp.js +309 -0
  3. package/dist/Tools.js +235 -0
  4. package/dist/Translate.js +33 -0
  5. package/dist/img/404.png +0 -0
  6. package/dist/img/lang_en.svg +10 -0
  7. package/dist/img/lang_pl.svg +4 -0
  8. package/dist/img/logo.png +0 -0
  9. package/dist/img/nointernet.png +0 -0
  10. package/dist/img/update.png +0 -0
  11. package/dist/index.js +236 -0
  12. package/dist/lib/API.js +65 -0
  13. package/dist/lib/APIFaker.js +57 -0
  14. package/dist/lib/APILocal.js +76 -0
  15. package/dist/lib/APIServer.js +76 -0
  16. package/dist/lib/ApiCode.js +11 -0
  17. package/dist/spxbasecode/EduLog.js +16 -0
  18. package/dist/spxbasecode/Request.js +43 -0
  19. package/dist/spxbasecode/Validators.js +66 -0
  20. package/dist/spxbasecode/WS.js +71 -0
  21. package/dist/spxbasecode/cmps/8.jpg +0 -0
  22. package/dist/spxbasecode/cmps/BaseAnimation.js +76 -0
  23. package/dist/spxbasecode/cmps/BaseAutocomplete.js +81 -0
  24. package/dist/spxbasecode/cmps/BaseButton.js +41 -0
  25. package/dist/spxbasecode/cmps/BaseButtonCountry.js +48 -0
  26. package/dist/spxbasecode/cmps/BaseButtonIcon.js +78 -0
  27. package/dist/spxbasecode/cmps/BaseButtonImage.js +66 -0
  28. package/dist/spxbasecode/cmps/BaseCard.js +95 -0
  29. package/dist/spxbasecode/cmps/BaseCenter.js +33 -0
  30. package/dist/spxbasecode/cmps/BaseError.js +48 -0
  31. package/dist/spxbasecode/cmps/BaseForm.js +141 -0
  32. package/dist/spxbasecode/cmps/BaseForm2.js +78 -0
  33. package/dist/spxbasecode/cmps/BaseImage.js +45 -0
  34. package/dist/spxbasecode/cmps/BaseImg.js +62 -0
  35. package/dist/spxbasecode/cmps/BaseInputString.js +269 -0
  36. package/dist/spxbasecode/cmps/BaseLabel.js +48 -0
  37. package/dist/spxbasecode/cmps/BaseLang.js +51 -0
  38. package/dist/spxbasecode/cmps/BaseList.js +79 -0
  39. package/dist/spxbasecode/cmps/BaseListFile.js +79 -0
  40. package/dist/spxbasecode/cmps/BasePage.js +26 -0
  41. package/dist/spxbasecode/cmps/BaseReadTextButton.js +40 -0
  42. package/dist/spxbasecode/cmps/BaseSSOLogin.js +31 -0
  43. package/dist/spxbasecode/cmps/BaseSlimPage.js +82 -0
  44. package/dist/spxbasecode/cmps/EduPage.js +20 -0
  45. package/dist/spxbasecode/cmps/LogoEdupanel.js +41 -0
  46. package/dist/spxbasecode/cmps/Menu.js +169 -0
  47. package/dist/spxbasecode/cmps/PageWithMenu.js +55 -0
  48. package/dist/spxbasecode/cmps/ProfileMenu.js +25 -0
  49. package/dist/spxbasecode/cmps/SpeechToText.js +48 -0
  50. package/dist/spxbasecode/cmps/TextToCommand.js +98 -0
  51. package/dist/spxbasecode/img/soundOff.svg +1 -0
  52. package/dist/spxbasecode/img/soundOn.png +0 -0
  53. package/package.json +1 -1
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactSpeechRecognition = _interopRequireWildcard(require("react-speech-recognition"));
9
+ var _educoreapp = require("educoreapp2");
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ const SpeechToText = props => {
14
+ const {
15
+ transcript,
16
+ resetTranscript
17
+ } = (0, _reactSpeechRecognition.useSpeechRecognition)();
18
+ const handleListen = () => {
19
+ resetTranscript();
20
+ if (_reactSpeechRecognition.default.browserSupportsSpeechRecognition) {
21
+ _reactSpeechRecognition.default.startListening({
22
+ continuous: true
23
+ }).then(() => {
24
+ if (!_reactSpeechRecognition.default.isMicrophoneAvailable) {
25
+ //Tools.alert("No isMicrophoneAvailable");
26
+ }
27
+ });
28
+ } else {
29
+ _educoreapp.Tools.alert("No speech recognation");
30
+ }
31
+ };
32
+ const stopListening = () => {
33
+ _reactSpeechRecognition.default.stopListening();
34
+ };
35
+ const reset = () => {
36
+ resetTranscript();
37
+ };
38
+ const getTranscript = () => {
39
+ return transcript;
40
+ };
41
+ props.parent.speech = {};
42
+ props.parent.speech.getTranscript = getTranscript;
43
+ props.parent.speech.reset = reset;
44
+ props.parent.speech.stopListening = stopListening;
45
+ props.parent.speech.handleListen = handleListen;
46
+ return /*#__PURE__*/_react.default.createElement("div", null);
47
+ };
48
+ var _default = exports.default = SpeechToText;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _SpeechToText = _interopRequireDefault(require("./SpeechToText"));
9
+ var _educoreapp = require("educoreapp2");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
+ class TextToCommand extends _react.Component {
14
+ constructor(props) {
15
+ super();
16
+ this.props = props;
17
+ this.speech = null;
18
+ this.props.parent.textToCommand = this;
19
+ this.interval = 5000;
20
+ this.props.parent.TTCInit();
21
+ }
22
+ listen(parent, pageName) {
23
+ this.speech.handleListen();
24
+ this.parent = parent;
25
+ this.pageName = pageName;
26
+ let this2 = this;
27
+ setInterval(function () {
28
+ let cmd = this2.speech.getTranscript();
29
+ this2.command(cmd);
30
+ }, this.interval);
31
+ }
32
+ command(text) {
33
+ this.speech.reset();
34
+ let pageName = this.pageName;
35
+ /*this.MAP = {
36
+ "home": {
37
+ "naciśnij przycisk": {
38
+ "fun": "clickButton",
39
+ "commands": {
40
+ "nowa gra": "new_game",
41
+ "o nas": "about_us",
42
+ "pomoc": "help"
43
+ },
44
+ }
45
+ },"new_game": {
46
+ "zaznacz pole": {
47
+ "fun": "selectField",
48
+ "commands": {
49
+ "numer 1": "1",
50
+ "numer 2": "2",
51
+ "numer 3": "3",
52
+ "numer 4": "4",
53
+ "numer 5": "5",
54
+ "numer 6": "6",
55
+ "numer 7": "7",
56
+ "numer 8": "8",
57
+ "numer 9": "9",
58
+ },
59
+ }
60
+ },
61
+ };*/
62
+ let map = this.MAP[window.App.lang][pageName];
63
+ if (!_educoreapp.Tools.isset(map)) {
64
+ map = this.MAP[window.App.lang].default;
65
+ }
66
+ for (let k in map) {
67
+ let i = text.indexOf(k);
68
+ if (i === -1) {
69
+ continue;
70
+ }
71
+ let coms = map[k].commands;
72
+ if (!_educoreapp.Tools.isset(coms)) {
73
+ let fun = map[k].fun;
74
+ let pp = map[k].param;
75
+ this.parent[fun](pp);
76
+ this.speech.reset();
77
+ return;
78
+ }
79
+ for (let l in coms) {
80
+ let j = text.indexOf(l);
81
+ if (j === -1) {
82
+ continue;
83
+ }
84
+ let fun = map[k].fun;
85
+ let pp = coms[l];
86
+ //console.log("ffff",fun,pp,this.parent);
87
+ this.parent[fun](pp);
88
+ this.speech.reset();
89
+ }
90
+ }
91
+ }
92
+ render() {
93
+ return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_SpeechToText.default, {
94
+ parent: this
95
+ }));
96
+ }
97
+ }
98
+ var _default = exports.default = TextToCommand;
@@ -0,0 +1 @@
1
+ <?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 120.97" style="enable-background:new 0 0 122.88 120.97" xml:space="preserve"><style type="text/css">.st0{fill-rule:evenodd;clip-rule:evenodd;}</style><g><path class="st0" d="M7.02,28.81h28.65c0.6,0,1.09,0.49,1.09,1.09v44.09L17.76,93H7c-3.85,0-7-3.15-7-7V35.83 C0,31.97,3.16,28.81,7.02,28.81L7.02,28.81z M111.29,6.02l11.59,11.59l-93.17,93.17L18.12,99.19L111.29,6.02L111.29,6.02z M42.33,27.67c16.7-9.16,33.4-18.32,50.09-27.48c1.6-0.88,3.32,1.49,3.32,3.32v11.5L41.66,69.1V28.34 C41.66,27.97,42.01,27.85,42.33,27.67L42.33,27.67z M95.74,51.66v65.6c0,1.92-1.82,4.45-3.5,3.5L50.29,97.11L95.74,51.66 L95.74,51.66z"/></g></svg>
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "educoreapp2",
3
3
  "private": false,
4
- "version": "1.0.77",
4
+ "version": "1.0.79",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "files": [