eligius 1.0.7 → 1.0.9

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 (37) hide show
  1. package/README.md +2 -2
  2. package/dist/controllers/label-controller.d.ts +5 -2
  3. package/dist/controllers/lottie-controller.d.ts +2 -2
  4. package/dist/controllers/navigation-controller.d.ts +2 -2
  5. package/dist/controllers/progressbar-controller.d.ts +2 -2
  6. package/dist/controllers/routing-controller.d.ts +2 -2
  7. package/dist/controllers/subtitles-controller.d.ts +2 -2
  8. package/dist/diagnostics/types.d.ts +22 -2
  9. package/dist/eligius-engine.d.ts +19 -7
  10. package/dist/eligius.cjs.development.js +529 -390
  11. package/dist/eligius.cjs.development.js.map +1 -1
  12. package/dist/eligius.cjs.production.min.js +1 -1
  13. package/dist/eligius.cjs.production.min.js.map +1 -1
  14. package/dist/eligius.esm.js +527 -390
  15. package/dist/eligius.esm.js.map +1 -1
  16. package/dist/engine-factory.d.ts +5 -5
  17. package/dist/eventbus/eventbus.d.ts +5 -5
  18. package/dist/eventbus/types.d.ts +5 -5
  19. package/dist/language-manager.d.ts +4 -3
  20. package/dist/operation/calc.d.ts +1 -1
  21. package/dist/operation/create-element.d.ts +0 -1
  22. package/dist/operation/get-controller-instance.d.ts +1 -3
  23. package/dist/operation/get-query-params.d.ts +28 -0
  24. package/dist/operation/index.d.ts +2 -0
  25. package/dist/operation/invoke-object-method.d.ts +15 -0
  26. package/dist/operation/load-json.d.ts +2 -3
  27. package/dist/operation/math.d.ts +1 -1
  28. package/dist/operation/metadata/get-query-params.d.ts +4 -0
  29. package/dist/operation/metadata/index.d.ts +2 -0
  30. package/dist/operation/metadata/invoke-object-method.d.ts +4 -0
  31. package/dist/operation/metadata/types.d.ts +1 -1
  32. package/dist/operation/remove-properties-from-operation-data.d.ts +1 -0
  33. package/dist/operation/select-element.d.ts +2 -3
  34. package/dist/operation/set-style.d.ts +4 -4
  35. package/dist/operation/start-loop.d.ts +2 -3
  36. package/dist/types.d.ts +42 -3
  37. package/package.json +3 -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
 
@@ -22,7 +22,7 @@ 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.com/rolandzwaga/eligius/blob/dev/jsonschema/eligius-configuration.json).
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
 
@@ -1,5 +1,5 @@
1
1
  /// <reference types="jquery" />
2
- import { IEventbus, TEventHandlerRemover } from '../eventbus/types';
2
+ import { IEventbus, TEventbusRemover } from '../eventbus/types';
3
3
  import { ILabel } from '../types';
4
4
  import { IController } from './types';
5
5
  export interface ILabelControllerMetadata {
@@ -7,13 +7,16 @@ export interface ILabelControllerMetadata {
7
7
  labelId: string;
8
8
  }
9
9
  export declare class LabelController implements IController<ILabelControllerMetadata> {
10
- listeners: TEventHandlerRemover[];
10
+ listeners: TEventbusRemover[];
11
11
  currentLanguage: string | null;
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;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="jquery" />
2
2
  import { AnimationItem, CanvasRendererConfig, HTMLRendererConfig, SVGRendererConfig } from 'lottie-web';
3
- import { IEventbus, TEventHandlerRemover } from '../eventbus/types';
3
+ import { IEventbus, TEventbusRemover } from '../eventbus/types';
4
4
  import { IController } from './types';
5
5
  export interface IInnerMetadata {
6
6
  selectedElement: JQuery;
@@ -20,7 +20,7 @@ export declare class LottieController implements IController<ILottieControllerMe
20
20
  name: string;
21
21
  currentLanguage: string | null;
22
22
  labelData: Record<string, Record<string, string>>;
23
- listeners: TEventHandlerRemover[];
23
+ listeners: TEventbusRemover[];
24
24
  animationItem: AnimationItem | null;
25
25
  operationData: IInnerMetadata | null;
26
26
  serializedData: string | null;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="jquery" />
2
- import { IEventbus, TEventHandlerRemover } from '../eventbus/types';
2
+ import { IEventbus, TEventbusRemover } from '../eventbus/types';
3
3
  import { TOperationData } from '../operation/types';
4
4
  import { TResultCallback } from '../types';
5
5
  import { LabelController } from './label-controller';
@@ -16,7 +16,7 @@ export declare class NavigationController implements IController<INavigationCont
16
16
  ctrlLookup: Record<string, LabelController>;
17
17
  activeNavigationPoint: any | null;
18
18
  labelControllers: LabelController[];
19
- eventhandlers: TEventHandlerRemover[];
19
+ eventhandlers: TEventbusRemover[];
20
20
  eventbus: IEventbus | null;
21
21
  container: JQuery | null;
22
22
  constructor();
@@ -1,5 +1,5 @@
1
1
  /// <reference types="jquery" />
2
- import { IEventbus, TEventHandlerRemover } from '../eventbus/types';
2
+ import { IEventbus, TEventbusRemover } from '../eventbus/types';
3
3
  import { TOperationData } from '../operation/types';
4
4
  import { IController } from './types';
5
5
  export interface IProgressbarControllerOperationData {
@@ -10,7 +10,7 @@ export declare class ProgressbarController implements IController<IProgressbarCo
10
10
  name: string;
11
11
  selectedElement: JQuery | null;
12
12
  textElement: JQuery | null;
13
- detachers: TEventHandlerRemover[];
13
+ detachers: TEventbusRemover[];
14
14
  init(operationData: TOperationData): void;
15
15
  attach(eventbus: IEventbus): void;
16
16
  detach(_eventbus: IEventbus): void;
@@ -1,4 +1,4 @@
1
- import { IEventbus, TEventHandlerRemover } from '../eventbus/types';
1
+ import { IEventbus, TEventbusRemover } from '../eventbus/types';
2
2
  import { TOperationData } from '../operation/types';
3
3
  import { IController } from './types';
4
4
  export interface IRoutingControllerOperationData {
@@ -9,7 +9,7 @@ export declare class RoutingController implements IController<IRoutingController
9
9
  navLookup: Record<string, any>;
10
10
  navVidIdLookup: Record<string, any>;
11
11
  navigation: any;
12
- eventhandlers: TEventHandlerRemover[];
12
+ eventhandlers: TEventbusRemover[];
13
13
  eventbus: IEventbus | null;
14
14
  constructor();
15
15
  init(operationData: TOperationData): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="jquery" />
2
- import { IEventbus, TEventHandlerRemover } from '../eventbus/types';
2
+ import { IEventbus, TEventbusRemover } from '../eventbus/types';
3
3
  import { TOperationData } from '../operation/types';
4
4
  import { IController } from './types';
5
5
  export interface ISubtitlesControllerOperationData {
@@ -14,7 +14,7 @@ export declare class SubtitlesController implements IController<ISubtitlesContro
14
14
  name: string;
15
15
  attach(eventbus: IEventbus): void;
16
16
  detach(_eventbus: IEventbus): void;
17
- internalDetach(detachMethods?: TEventHandlerRemover[]): void;
17
+ internalDetach(detachMethods?: TEventbusRemover[]): void;
18
18
  languageChangeHandler(newLanguage: string): void;
19
19
  removeTitle(container?: JQuery): void;
20
20
  onTimeHandler(arg: any): void;
@@ -1,8 +1,28 @@
1
+ export declare type TDevToolsEventSubscriber = (event: TEventData) => void;
2
+ export declare type TPlayControlEventKind = 'play' | 'stop' | 'pause' | 'seek';
3
+ export declare const DEV_TOOLS_KEY = "__ELIGIUS_DEV_TOOLS__";
4
+ export declare type TWindowWithDevtools = Window & {
5
+ [DEV_TOOLS_KEY]: IDiagnosticsInfo | undefined;
6
+ };
7
+ export declare type TDevToolsMessage = {
8
+ source: 'eligius-inspect-devtools';
9
+ name: 'event';
10
+ data: TEventData;
11
+ };
12
+ export declare type TEventData = {
13
+ type: 'playcontrol';
14
+ data: IPlayControlEvent;
15
+ };
16
+ export interface IPlayControlEvent {
17
+ kind: TPlayControlEventKind;
18
+ args?: any[];
19
+ }
1
20
  export interface IDiagnosticsAgent {
2
- postMessage(name: TDiagnosticType, data: any): void;
21
+ postMessage(name: TDiagnosticType, messageData: any): void;
22
+ subscribe(subscriber: TDevToolsEventSubscriber): () => void;
3
23
  }
4
24
  export interface IDiagnosticsInfo {
5
25
  get agent(): IDiagnosticsAgent;
6
26
  }
7
27
  export declare type TDiagnosticType = 'eligius-diagnostics-factory' | 'eligius-diagnostics-engine' | 'eligius-diagnostics-event' | 'eligius-diagnostics-action' | 'eligius-diagnostics-action-error' | 'eligius-diagnostics-operation';
8
- export declare const DEV_TOOLS_KEY = "__ELIGIUS_DEV_TOOLS__";
28
+ export declare type TDiagnosticsMessageSource = 'eligius-inspect-agent' | 'eligius-inspect-devtools';
@@ -4,26 +4,38 @@ import { LanguageManager } from './language-manager';
4
4
  import { ITimelineProvider } from './timelineproviders/types';
5
5
  import { IEligiusEngine, ITimelineProviderInfo, TimelineTypes } from './types';
6
6
  /**
7
- * EligiusEngine, 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 it.
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;
13
12
  private eventbus;
14
13
  private timelineProviders;
15
- private _languageManager;
14
+ private languageManager;
16
15
  private _timeLineActionsLookup;
17
- private _eventbusListeners;
16
+ private _eventbusRemovers;
18
17
  private _currentTimelineUri;
19
18
  private _activeTimelineProvider;
20
19
  private _lastPosition;
21
- constructor(configuration: IResolvedEngineConfiguration, eventbus: IEventbus, timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>, _languageManager: LanguageManager);
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>;
38
+ private _addEventListener;
27
39
  private _addInitialisationListeners;
28
40
  private _createTimelineLookup;
29
41
  private _addTimelineAction;
@@ -31,7 +43,7 @@ export declare class EligiusEngine implements IEligiusEngine {
31
43
  private _initializeTimelinePosition;
32
44
  private _executeActions;
33
45
  private _handleRequestEngineRoot;
34
- _handleRequestTimelineUri(uri: string, position?: number, previousVideoPosition?: number): Promise<void>;
46
+ private _handleRequestTimelineUri;
35
47
  private _cleanUpTimeline;
36
48
  private _executeStartActions;
37
49
  private _getActionsForPosition;