eligius 1.0.8 → 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 +10 -6
- package/dist/controllers/label-controller.d.ts +3 -0
- package/dist/controllers/progressbar-controller.d.ts +2 -1
- package/dist/eligius-engine.d.ts +15 -4
- package/dist/eligius.cjs.development.js +225 -156
- package/dist/eligius.cjs.development.js.map +1 -1
- package/dist/eligius.cjs.production.min.js +1 -1
- package/dist/eligius.cjs.production.min.js.map +1 -1
- package/dist/eligius.esm.js +224 -157
- package/dist/eligius.esm.js.map +1 -1
- package/dist/operation/calc.d.ts +1 -1
- package/dist/operation/create-element.d.ts +0 -1
- package/dist/operation/get-controller-instance.d.ts +1 -3
- package/dist/operation/get-query-params.d.ts +28 -0
- package/dist/operation/index.d.ts +2 -0
- package/dist/operation/invoke-object-method.d.ts +15 -0
- package/dist/operation/load-json.d.ts +2 -3
- package/dist/operation/math.d.ts +1 -1
- package/dist/operation/metadata/get-query-params.d.ts +4 -0
- package/dist/operation/metadata/index.d.ts +2 -0
- package/dist/operation/metadata/invoke-object-method.d.ts +4 -0
- package/dist/operation/metadata/types.d.ts +1 -1
- package/dist/operation/remove-properties-from-operation-data.d.ts +1 -0
- package/dist/operation/select-element.d.ts +2 -3
- package/dist/operation/set-style.d.ts +4 -4
- package/dist/operation/start-loop.d.ts +2 -3
- package/dist/types.d.ts +42 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ 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.
|
|
7
|
+
Eligius is NOT a game or animation engine, instead, it is a Story Telling Engine.
|
|
8
8
|
|
|
9
9
|
## description
|
|
10
10
|
|
|
@@ -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/
|
|
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).
|
|
@@ -22,16 +22,16 @@ A more comprehensive example could be, for example, a rich subtitling system for
|
|
|
22
22
|
|
|
23
23
|
## configuration
|
|
24
24
|
|
|
25
|
-
The Eligius engine is populated by a JSON configuration. Think of this JSON as its file format. This configuration contains all of the timelines, actions, operations and other data for the engine to run. A JSON schema for this configuration can be found [here](https://github.
|
|
25
|
+
The Eligius engine is populated by a JSON configuration. Think of this JSON as its file format. This configuration contains all of the timelines, actions, operations and other data for the engine to run. A JSON schema for this configuration can be found [here](https://rolandzwaga.github.io/eligius/jsonschema/eligius-configuration.json).
|
|
26
26
|
|
|
27
27
|
This section describes the different parts of this configuration.
|
|
28
28
|
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
@@ -12,8 +12,11 @@ export declare class LabelController implements IController<ILabelControllerMeta
|
|
|
12
12
|
operationData: ILabelControllerMetadata | null;
|
|
13
13
|
labelData: Record<string, string>;
|
|
14
14
|
name: string;
|
|
15
|
+
requestLabelDataBound?: (labelId: string) => void;
|
|
15
16
|
init(operationData: ILabelControllerMetadata): void;
|
|
17
|
+
setLabelId(newLabelId: string): void;
|
|
16
18
|
attach(eventbus: IEventbus): void;
|
|
19
|
+
requestLabelData(eventbus: IEventbus, labelId: string): void;
|
|
17
20
|
setLabel(): void;
|
|
18
21
|
detach(_eventbus: IEventbus): void;
|
|
19
22
|
handleLanguageChange(code: string): void;
|
|
@@ -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
|
}
|
package/dist/eligius-engine.d.ts
CHANGED
|
@@ -4,9 +4,8 @@ import { LanguageManager } from './language-manager';
|
|
|
4
4
|
import { ITimelineProvider } from './timelineproviders/types';
|
|
5
5
|
import { IEligiusEngine, ITimelineProviderInfo, TimelineTypes } from './types';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* the given timeline provider and triggering the actions associated with
|
|
9
|
-
* ...
|
|
7
|
+
* This is where the magic happens. The engine is responsible for starting and stopping
|
|
8
|
+
* the given timeline provider and triggering the actions associated with the positions along the timeline.
|
|
10
9
|
*/
|
|
11
10
|
export declare class EligiusEngine implements IEligiusEngine {
|
|
12
11
|
private configuration;
|
|
@@ -19,10 +18,22 @@ export declare class EligiusEngine implements IEligiusEngine {
|
|
|
19
18
|
private _activeTimelineProvider;
|
|
20
19
|
private _lastPosition;
|
|
21
20
|
constructor(configuration: IResolvedEngineConfiguration, eventbus: IEventbus, timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>, languageManager: LanguageManager);
|
|
21
|
+
/**
|
|
22
|
+
* Initializes the engine by creating the HTML layout and the first time line
|
|
23
|
+
* by executing its initActions.
|
|
24
|
+
*/
|
|
22
25
|
init(): Promise<ITimelineProvider>;
|
|
23
26
|
private _createLayoutTemplate;
|
|
24
27
|
private _initializeTimelineProvider;
|
|
25
28
|
private _cleanUp;
|
|
29
|
+
/**
|
|
30
|
+
* Cleans up all the necessary parts that the engine initialized.
|
|
31
|
+
* - It ends the currently active operations and the init actions.
|
|
32
|
+
* - It removes all its eventbus listeners, handlers and interceptors.
|
|
33
|
+
* - It destroys all of its timeline providers
|
|
34
|
+
* - It empties the HTML element indicated by the containerSelector configuration property.
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
26
37
|
destroy(): Promise<void>;
|
|
27
38
|
private _addEventListener;
|
|
28
39
|
private _addInitialisationListeners;
|
|
@@ -32,7 +43,7 @@ export declare class EligiusEngine implements IEligiusEngine {
|
|
|
32
43
|
private _initializeTimelinePosition;
|
|
33
44
|
private _executeActions;
|
|
34
45
|
private _handleRequestEngineRoot;
|
|
35
|
-
_handleRequestTimelineUri
|
|
46
|
+
private _handleRequestTimelineUri;
|
|
36
47
|
private _cleanUpTimeline;
|
|
37
48
|
private _executeStartActions;
|
|
38
49
|
private _getActionsForPosition;
|