eligius 1.0.9 → 1.0.10

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
@@ -12,7 +12,7 @@ The main concepts in Eligius are timelines, actions and operations. A timeline c
12
12
 
13
13
  Actions can be called on specified points on such a timeline. An action consists of a list of start and end operations.
14
14
 
15
- An operation is an atomic function. A context, for sharing data, is passed between each successive operation. Examples of operations are `select-element`, `create-element` or `add-class`. [Here is a complete list of all available operations.](https://github.com/rolandzwaga/eligius/tree/dev/src/operation)
15
+ An operation is an atomic function. A context, for sharing data, is passed between each successive operation. Examples of operations are `select-element`, `create-element` or `add-class`. [Here is a complete list of all available operations.](https://github.com/rolandzwaga/eligius/tree/main/src/operation)
16
16
  By composing these atomic operations complex functionality can be achieved.
17
17
 
18
18
  An example of an action is adding an removing an image from the stage at specific times. This action would consist of these start operations: `select-element`(to select the image parent), `create-element`(to create the img element with the required src attribute) and `set-element-contents`(to add the img element to the previously selected parent).
@@ -29,9 +29,9 @@ This section describes the different parts of this configuration.
29
29
  ### systemName property
30
30
 
31
31
  In the rest of this section the property name `systemName` will be shown often. The value of this property describes a named import.
32
- Currently one resource importer is supported by default: [`EligiusResourceImporter`](https://github.com/rolandzwaga/eligius/blob/dev/src/importer/eligius-resource-importer.ts).
32
+ Currently one resource importer is supported by default: [`EligiusResourceImporter`](https://rolandzwaga.github.io/eligius/classes/EligiusResourceImporter.html).
33
33
  However, this importer contains all of Eligius classes, function, providers, etc. So, bundling this with a presentation will bloat the bundle.
34
- Eligius offers a generator function for this: [`generateImporterSourceCode`](https://github.com/rolandzwaga/eligius/blob/dev/src/build/generate-importer-source-code.ts). This function is able to generate source code (Typescript) for a custom resource importer based on a given Eligius configuration. This will result in an importer that only includes the code that is referenced in the configuration.
34
+ Eligius offers a generator function for this: [`generateImporterSourceCode`](https://rolandzwaga.github.io/eligius/functions/generateImporterSourceCode.html). This function is able to generate source code (Typescript) for a custom resource importer based on a given Eligius configuration. This will result in an importer that only includes the code that is referenced in the configuration.
35
35
 
36
36
  ### engine
37
37
 
@@ -234,7 +234,7 @@ This a list of actions that can be triggered by an event broadcast. Since an eve
234
234
  ### labels
235
235
 
236
236
  A list of label information that describes all of the textual content for the presentation.
237
- Labels can be rendered by the [`LabelController`](https://github.com/rolandzwaga/eligius/blob/dev/src/controllers/label-controller.ts). This controller listens for the appropriate language change events as well, and will change the contents of the element it controls accordingly.
237
+ Labels can be rendered by the [`LabelController`](https://rolandzwaga.github.io/eligius/classes/LabelController.html). This controller listens for the appropriate language change events as well, and will change the contents of the element it controls accordingly.
238
238
 
239
239
  ```json
240
240
  {
@@ -271,6 +271,10 @@ const engine = factory.createEngine((engineConfig as unknown) as IEngineConfigur
271
271
  engine.init().then(()=> {console.log('Eligius engine ready for business');});
272
272
  ```
273
273
 
274
+ ## Source documentation
275
+
276
+ [Check out this link for the full type docs](https://rolandzwaga.github.io/eligius/)
277
+
274
278
  ## installation
275
279
 
276
280
  ```sh
@@ -11,6 +11,7 @@ export declare class ProgressbarController implements IController<IProgressbarCo
11
11
  selectedElement: JQuery | null;
12
12
  textElement: JQuery | null;
13
13
  detachers: TEventbusRemover[];
14
+ duration: number;
14
15
  init(operationData: TOperationData): void;
15
16
  attach(eventbus: IEventbus): void;
16
17
  detach(_eventbus: IEventbus): void;
@@ -18,5 +19,5 @@ export declare class ProgressbarController implements IController<IProgressbarCo
18
19
  position: number;
19
20
  duration: number;
20
21
  }): void;
21
- clickHandler(): void;
22
+ clickHandler(eventbus: IEventbus, event: any): void;
22
23
  }
@@ -437,6 +437,10 @@ function prepareValueForSerialization(value) {
437
437
  } else if (value instanceof $__default["default"]) {
438
438
  return 'jQuery object';
439
439
  } else if (value !== null && typeof value === 'object') {
440
+ if (value.constructor.toString().substring(0, 5) === 'class') {
441
+ return 'Complex object';
442
+ }
443
+
440
444
  return Object.fromEntries(Object.entries(value).map(function (_ref) {
441
445
  var propName = _ref[0],
442
446
  propValue = _ref[1];
@@ -1745,6 +1749,7 @@ var ProgressbarController = /*#__PURE__*/function () {
1745
1749
  this.selectedElement = null;
1746
1750
  this.textElement = null;
1747
1751
  this.detachers = [];
1752
+ this.duration = 0;
1748
1753
  }
1749
1754
 
1750
1755
  var _proto = ProgressbarController.prototype;
@@ -1755,17 +1760,20 @@ var ProgressbarController = /*#__PURE__*/function () {
1755
1760
  };
1756
1761
 
1757
1762
  _proto.attach = function attach(eventbus) {
1758
- var _this$selectedElement,
1759
- _this = this;
1763
+ var _this = this,
1764
+ _this$selectedElement;
1760
1765
 
1761
1766
  this.detachers.push(eventbus.on(TimelineEventNames.POSITION_UPDATE, this.positionUpdateHandler.bind(this)));
1762
- var clickHandler = this.clickHandler.bind(this);
1767
+ eventbus.broadcast(TimelineEventNames.DURATION_REQUEST, [function (duration) {
1768
+ return _this.duration = duration;
1769
+ }]);
1770
+ var clickHandler = this.clickHandler.bind(this, eventbus);
1763
1771
  (_this$selectedElement = this.selectedElement) == null ? void 0 : _this$selectedElement.on('click', clickHandler);
1764
1772
  this.detachers.push(function () {
1765
1773
  var _this$selectedElement2;
1766
1774
 
1767
- return (_this$selectedElement2 = _this.selectedElement) == null ? void 0 : _this$selectedElement2.off('click');
1768
- }, clickHandler);
1775
+ return (_this$selectedElement2 = _this.selectedElement) == null ? void 0 : _this$selectedElement2.off('click', clickHandler);
1776
+ });
1769
1777
  };
1770
1778
 
1771
1779
  _proto.detach = function detach(_eventbus) {
@@ -1784,7 +1792,14 @@ var ProgressbarController = /*#__PURE__*/function () {
1784
1792
  (_this$textElement = this.textElement) == null ? void 0 : _this$textElement.text(Math.floor(percentage) + "%");
1785
1793
  };
1786
1794
 
1787
- _proto.clickHandler = function clickHandler() {};
1795
+ _proto.clickHandler = function clickHandler(eventbus, event) {
1796
+ var element = event.target;
1797
+ var rect = element.getBoundingClientRect();
1798
+ var x = event.clientX - rect.left; //x position within the element.
1799
+
1800
+ var percentage = 100 / rect.width * x;
1801
+ eventbus.broadcast(TimelineEventNames.SEEK_REQUEST, [Math.floor(this.duration / 100 * percentage)]);
1802
+ };
1788
1803
 
1789
1804
  return ProgressbarController;
1790
1805
  }();
@@ -5386,7 +5401,7 @@ function setElementAttributes() {
5386
5401
  function setElementContent() {
5387
5402
  return {
5388
5403
  description: 'Sets the given HTML content in the selected element',
5389
- dependentProperties: ['selectedElement'],
5404
+ dependentProperties: ['selectedElement', 'template'],
5390
5405
  properties: {
5391
5406
  insertionType: [{
5392
5407
  value: 'overwrite',
@@ -5398,11 +5413,7 @@ function setElementContent() {
5398
5413
  }, {
5399
5414
  value: 'prepend',
5400
5415
  description: 'the new content will be inserted before the current content'
5401
- }],
5402
- template: {
5403
- type: 'ParameterType:htmlContent',
5404
- required: true
5405
- }
5416
+ }]
5406
5417
  }
5407
5418
  };
5408
5419
  }