@novnc/novnc 1.2.0 → 1.3.0-g0ef7582

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 (75) hide show
  1. package/LICENSE.txt +0 -6
  2. package/README.md +16 -6
  3. package/core/decoders/copyrect.js +5 -0
  4. package/core/decoders/hextile.js +57 -3
  5. package/core/decoders/jpeg.js +141 -0
  6. package/core/decoders/raw.js +12 -2
  7. package/core/decoders/tight.js +24 -8
  8. package/core/decoders/zrle.js +185 -0
  9. package/core/display.js +21 -151
  10. package/core/encodings.js +4 -0
  11. package/core/input/domkeytable.js +25 -21
  12. package/core/input/keyboard.js +22 -127
  13. package/core/input/util.js +18 -35
  14. package/core/input/vkeys.js +0 -1
  15. package/core/input/xtscancodes.js +5 -3
  16. package/core/ra2.js +567 -0
  17. package/core/rfb.js +487 -171
  18. package/core/util/browser.js +0 -17
  19. package/core/util/cursor.js +1 -11
  20. package/core/util/events.js +0 -4
  21. package/core/util/md5.js +79 -0
  22. package/core/websock.js +76 -17
  23. package/docs/API.md +107 -6
  24. package/docs/LIBRARY.md +3 -7
  25. package/lib/base64.js +24 -38
  26. package/lib/decoders/copyrect.js +6 -11
  27. package/lib/decoders/hextile.js +68 -44
  28. package/lib/decoders/jpeg.js +146 -0
  29. package/lib/decoders/raw.js +14 -21
  30. package/lib/decoders/rre.js +3 -17
  31. package/lib/decoders/tight.js +43 -93
  32. package/lib/decoders/tightpng.js +11 -33
  33. package/lib/decoders/zrle.js +185 -0
  34. package/lib/deflator.js +9 -26
  35. package/lib/des.js +22 -38
  36. package/lib/display.js +100 -315
  37. package/lib/encodings.js +7 -8
  38. package/lib/inflator.js +6 -22
  39. package/lib/input/domkeytable.js +240 -208
  40. package/lib/input/fixedkeys.js +10 -5
  41. package/lib/input/gesturehandler.js +84 -154
  42. package/lib/input/keyboard.js +87 -238
  43. package/lib/input/keysym.js +16 -272
  44. package/lib/input/keysymdef.js +7 -9
  45. package/lib/input/util.js +69 -156
  46. package/lib/input/vkeys.js +2 -7
  47. package/lib/input/xtscancodes.js +10 -171
  48. package/lib/ra2.js +1033 -0
  49. package/lib/rfb.js +947 -1149
  50. package/lib/util/browser.js +25 -52
  51. package/lib/util/cursor.js +25 -81
  52. package/lib/util/element.js +3 -5
  53. package/lib/util/events.js +26 -35
  54. package/lib/util/eventtarget.js +4 -16
  55. package/lib/util/int.js +2 -3
  56. package/lib/util/logging.js +3 -21
  57. package/lib/util/md5.js +83 -0
  58. package/lib/util/strings.js +3 -5
  59. package/lib/vendor/pako/lib/utils/common.js +10 -19
  60. package/lib/vendor/pako/lib/zlib/adler32.js +4 -8
  61. package/lib/vendor/pako/lib/zlib/constants.js +4 -7
  62. package/lib/vendor/pako/lib/zlib/crc32.js +6 -13
  63. package/lib/vendor/pako/lib/zlib/deflate.js +304 -708
  64. package/lib/vendor/pako/lib/zlib/gzheader.js +2 -14
  65. package/lib/vendor/pako/lib/zlib/inffast.js +61 -177
  66. package/lib/vendor/pako/lib/zlib/inflate.js +421 -909
  67. package/lib/vendor/pako/lib/zlib/inftrees.js +66 -172
  68. package/lib/vendor/pako/lib/zlib/messages.js +3 -13
  69. package/lib/vendor/pako/lib/zlib/trees.js +250 -592
  70. package/lib/vendor/pako/lib/zlib/zstream.js +3 -19
  71. package/lib/websock.js +119 -111
  72. package/package.json +2 -10
  73. package/core/util/polyfill.js +0 -61
  74. package/lib/util/polyfill.js +0 -72
  75. package/lib/vendor/promise.js +0 -255
package/lib/encodings.js CHANGED
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.encodingName = encodingName;
7
7
  exports.encodings = void 0;
8
-
9
8
  /*
10
9
  * noVNC: HTML5 VNC client
11
10
  * Copyright (C) 2019 The noVNC Authors
@@ -13,13 +12,16 @@ exports.encodings = void 0;
13
12
  *
14
13
  * See README.md for usage and integration instructions.
15
14
  */
15
+
16
16
  var encodings = {
17
17
  encodingRaw: 0,
18
18
  encodingCopyRect: 1,
19
19
  encodingRRE: 2,
20
20
  encodingHextile: 5,
21
21
  encodingTight: 7,
22
+ encodingZRLE: 16,
22
23
  encodingTightPNG: -260,
24
+ encodingJPEG: 21,
23
25
  pseudoEncodingQualityLevel9: -23,
24
26
  pseudoEncodingQualityLevel0: -32,
25
27
  pseudoEncodingDesktopSize: -223,
@@ -37,27 +39,24 @@ var encodings = {
37
39
  pseudoEncodingExtendedClipboard: 0xc0a1e5ce
38
40
  };
39
41
  exports.encodings = encodings;
40
-
41
42
  function encodingName(num) {
42
43
  switch (num) {
43
44
  case encodings.encodingRaw:
44
45
  return "Raw";
45
-
46
46
  case encodings.encodingCopyRect:
47
47
  return "CopyRect";
48
-
49
48
  case encodings.encodingRRE:
50
49
  return "RRE";
51
-
52
50
  case encodings.encodingHextile:
53
51
  return "Hextile";
54
-
55
52
  case encodings.encodingTight:
56
53
  return "Tight";
57
-
54
+ case encodings.encodingZRLE:
55
+ return "ZRLE";
58
56
  case encodings.encodingTightPNG:
59
57
  return "TightPNG";
60
-
58
+ case encodings.encodingJPEG:
59
+ return "JPEG";
61
60
  default:
62
61
  return "[unknown encoding " + num + "]";
63
62
  }
package/lib/inflator.js CHANGED
@@ -3,37 +3,27 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
7
-
6
+ exports["default"] = void 0;
8
7
  var _inflate2 = require("../lib/vendor/pako/lib/zlib/inflate.js");
9
-
10
8
  var _zstream = _interopRequireDefault(require("../lib/vendor/pako/lib/zlib/zstream.js"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
-
16
11
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
17
-
18
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
19
-
12
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
20
13
  var Inflate = /*#__PURE__*/function () {
21
14
  function Inflate() {
22
15
  _classCallCheck(this, Inflate);
23
-
24
- this.strm = new _zstream.default();
16
+ this.strm = new _zstream["default"]();
25
17
  this.chunkSize = 1024 * 10 * 10;
26
18
  this.strm.output = new Uint8Array(this.chunkSize);
27
19
  this.windowBits = 5;
28
20
  (0, _inflate2.inflateInit)(this.strm, this.windowBits);
29
21
  }
30
-
31
22
  _createClass(Inflate, [{
32
23
  key: "setInput",
33
24
  value: function setInput(data) {
34
25
  if (!data) {
35
26
  //FIXME: flush remaining data.
36
-
37
27
  /* eslint-disable camelcase */
38
28
  this.strm.input = null;
39
29
  this.strm.avail_in = 0;
@@ -55,23 +45,19 @@ var Inflate = /*#__PURE__*/function () {
55
45
  this.chunkSize = expected;
56
46
  this.strm.output = new Uint8Array(this.chunkSize);
57
47
  }
58
- /* eslint-disable camelcase */
59
-
60
48
 
49
+ /* eslint-disable camelcase */
61
50
  this.strm.next_out = 0;
62
51
  this.strm.avail_out = expected;
63
52
  /* eslint-enable camelcase */
64
53
 
65
54
  var ret = (0, _inflate2.inflate)(this.strm, 0); // Flush argument not used.
66
-
67
55
  if (ret < 0) {
68
56
  throw new Error("zlib inflate failed");
69
57
  }
70
-
71
58
  if (this.strm.next_out != expected) {
72
59
  throw new Error("Incomplete zlib block");
73
60
  }
74
-
75
61
  return new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);
76
62
  }
77
63
  }, {
@@ -80,8 +66,6 @@ var Inflate = /*#__PURE__*/function () {
80
66
  (0, _inflate2.inflateReset)(this.strm);
81
67
  }
82
68
  }]);
83
-
84
69
  return Inflate;
85
70
  }();
86
-
87
- exports.default = Inflate;
71
+ exports["default"] = Inflate;