eligius 1.0.6 → 1.0.71

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/README.md CHANGED
@@ -4,6 +4,8 @@ A Javascript engine that allows arbitrary functionality to be triggered accordin
4
4
 
5
5
  The engine can be the basis for video annotations, presentation software or interactive infographics, for example.
6
6
 
7
+ Eligius is NOT a game or animation engine.
8
+
7
9
  ## description
8
10
 
9
11
  The main concepts in Eligius are timelines, actions and operations. A timeline can be played, paused, stopped and scrubbed through.
@@ -2,33 +2,42 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var $ = require('jquery');
5
6
  var tsIsPresent = require('ts-is-present');
6
7
  var fs = require('fs');
7
8
  var path = require('path');
8
9
  var lottie = require('lottie-web');
9
- var $ = require('jquery');
10
10
  var hotkeys = require('hotkeys-js');
11
11
  var uuid = require('uuid');
12
12
 
13
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
14
 
15
+ var $__default = /*#__PURE__*/_interopDefaultLegacy($);
15
16
  var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
16
17
  var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
17
18
  var lottie__default = /*#__PURE__*/_interopDefaultLegacy(lottie);
18
- var $__default = /*#__PURE__*/_interopDefaultLegacy($);
19
19
  var hotkeys__default = /*#__PURE__*/_interopDefaultLegacy(hotkeys);
20
20
 
21
21
  function prepareValueForSerialization(value) {
22
22
  if (Array.isArray(value)) {
23
23
  return value.map(prepareValueForSerialization);
24
+ } else if (value instanceof $__default["default"]) {
25
+ return 'jQuery object';
24
26
  } else if (typeof value === 'object') {
25
27
  return Object.fromEntries(Object.entries(value).map(function (_ref) {
26
- var name = _ref[0],
27
- value = _ref[1];
28
- return [name, prepareValueForSerialization(value)];
28
+ var propName = _ref[0],
29
+ propValue = _ref[1];
30
+ return [propName, prepareValueForSerialization(propValue)];
29
31
  }));
30
32
  } else if (typeof value === 'function') {
31
- return value.toString();
33
+ var funcString = value.toString();
34
+ var paranIndex = funcString.indexOf('{');
35
+
36
+ if (paranIndex > -1) {
37
+ return funcString.substring(0, funcString.indexOf('{') + 1);
38
+ }
39
+
40
+ return funcString;
32
41
  }
33
42
 
34
43
  return value;
@@ -43,11 +52,19 @@ var DevToolEventListener = /*#__PURE__*/function () {
43
52
  var _proto = DevToolEventListener.prototype;
44
53
 
45
54
  _proto.handleEvent = function handleEvent(eventName, eventTopic, args) {
46
- this.agent.postMessage('eligius-diagnostics-event', {
55
+ var message = {
47
56
  eventName: eventName,
48
57
  eventTopic: eventTopic,
49
58
  args: prepareValueForSerialization(args)
50
- });
59
+ };
60
+
61
+ try {
62
+ this.agent.postMessage('eligius-diagnostics-event', message);
63
+ } catch (e) {
64
+ console.error('postmessage failed');
65
+ console.error(e);
66
+ console.log('message', message);
67
+ }
51
68
  };
52
69
 
53
70
  return DevToolEventListener;
@@ -2924,7 +2941,15 @@ var EngineFactory = /*#__PURE__*/function () {
2924
2941
  eventbus.registerEventlistener(eventbusListener);
2925
2942
 
2926
2943
  Diagnostics.send = function (name, data) {
2927
- agent.postMessage(name, data);
2944
+ var message = prepareValueForSerialization(data);
2945
+
2946
+ try {
2947
+ agent.postMessage(name, message);
2948
+ } catch (e) {
2949
+ console.error('postmessage failed');
2950
+ console.error(e);
2951
+ console.log('message', message);
2952
+ }
2928
2953
  };
2929
2954
 
2930
2955
  Diagnostics.send('eligius-diagnostics-factory', 'Diagnostics initialized');