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/dist/operation/calc.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface ICalcOperationData {
|
|
|
4
4
|
left: string | number;
|
|
5
5
|
right: string | number;
|
|
6
6
|
operator: TCalculationOperator;
|
|
7
|
-
|
|
7
|
+
calculationResult?: number;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* This operation calculates the given left and right hand sides using the specified operator.
|
|
@@ -4,13 +4,11 @@ import { TOperation } from './types';
|
|
|
4
4
|
declare type TSystemName = keyof typeof controllers;
|
|
5
5
|
export interface IGetControllerInstanceOperationData {
|
|
6
6
|
systemName: TSystemName;
|
|
7
|
-
propertyName?: string;
|
|
8
7
|
controllerInstance?: IController<unknown>;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
10
|
* This operation retrieves an instance of the given controller name.
|
|
12
|
-
* It assigns this instance to the property on the current operation data
|
|
13
|
-
* defined by the propertyName property which defaults to 'controllerInstance'.
|
|
11
|
+
* It assigns this instance to the `controllerInstance` property on the current operation data
|
|
14
12
|
*
|
|
15
13
|
* @param operationData
|
|
16
14
|
* @returns
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TOperation } from './types';
|
|
2
|
+
export interface IGetQueryParamsOperationData {
|
|
3
|
+
/**
|
|
4
|
+
* The query params will be added as property/values to this object.
|
|
5
|
+
* So, the query string `?foo=bar&bar=foo` will result in:
|
|
6
|
+
* ```json
|
|
7
|
+
* {
|
|
8
|
+
* foo: "bar",
|
|
9
|
+
* bar: "foo"
|
|
10
|
+
* }
|
|
11
|
+
* ```
|
|
12
|
+
* This object will be assigned to the `queryParams` property.
|
|
13
|
+
*/
|
|
14
|
+
queryParams?: Record<string, string>;
|
|
15
|
+
/**
|
|
16
|
+
* The properties on this object will be assigned to the queryParams result
|
|
17
|
+
* when the given property name is not part of the query string.
|
|
18
|
+
*/
|
|
19
|
+
defaultValues?: Record<string, string>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* This operation retrieves the current query parameters from the browser's address bar and places
|
|
23
|
+
* them on the returned operation data.
|
|
24
|
+
*
|
|
25
|
+
* @param operationData
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export declare const getQueryParams: TOperation<IGetQueryParamsOperationData>;
|
|
@@ -15,6 +15,8 @@ export { getControllerFromElement } from './get-controller-from-element';
|
|
|
15
15
|
export { getControllerInstance } from './get-controller-instance';
|
|
16
16
|
export { getElementDimensions } from './get-element-dimensions';
|
|
17
17
|
export { getImport } from './get-import';
|
|
18
|
+
export { getQueryParams } from './get-query-params';
|
|
19
|
+
export { invokeObjectMethod } from './invoke-object-method';
|
|
18
20
|
export { loadJSON } from './load-json';
|
|
19
21
|
export { log } from './log';
|
|
20
22
|
export { math } from './math';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TOperation } from './types';
|
|
2
|
+
export interface IInvokeObjectMethodOperationData {
|
|
3
|
+
instance: any;
|
|
4
|
+
methodName: string;
|
|
5
|
+
methodArguments?: any[];
|
|
6
|
+
methodResult?: any;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* This operation invokes the specified method on the given object with the optional specified arguments
|
|
10
|
+
* and assigns the result to the `methodResult` property.
|
|
11
|
+
*
|
|
12
|
+
* @param operationData
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare const invokeObjectMethod: TOperation<IInvokeObjectMethodOperationData>;
|
|
@@ -2,14 +2,13 @@ import { TOperation } from './types';
|
|
|
2
2
|
export interface ILoadJSONOperationData {
|
|
3
3
|
url: string;
|
|
4
4
|
cache: boolean;
|
|
5
|
-
propertyName?: string;
|
|
6
5
|
json?: any;
|
|
7
6
|
}
|
|
8
7
|
export declare const clearCache: () => void;
|
|
9
8
|
export declare const addToCache: (key: string, value: any) => void;
|
|
10
9
|
/**
|
|
11
|
-
* This operation loads a JSON file from the specified url and assigns it to the
|
|
12
|
-
* property
|
|
10
|
+
* This operation loads a JSON file from the specified url and assigns it to the json
|
|
11
|
+
* property on the current operation data.
|
|
13
12
|
*
|
|
14
13
|
* If the cache property is set to true and a cached value already exists, this is assigned
|
|
15
14
|
* instead of re-retrieving it from the url.
|
package/dist/operation/math.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { TOperation } from './types';
|
|
|
2
2
|
export interface IMathOperationData {
|
|
3
3
|
args: (number | string | keyof Math)[];
|
|
4
4
|
functionName: keyof Math;
|
|
5
|
-
|
|
5
|
+
mathResult?: number;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* This operation performs the given math function of the specified arguments.
|
|
@@ -15,6 +15,8 @@ export { default as getControllerFromElement } from './get-controller-from-eleme
|
|
|
15
15
|
export { default as getControllerInstance } from './get-controller-instance';
|
|
16
16
|
export { default as getElementDimensions } from './get-element-dimensions';
|
|
17
17
|
export { default as getImport } from './get-import';
|
|
18
|
+
export { default as getQueryParams } from './get-query-params';
|
|
19
|
+
export { default as invokeObjectMethod } from './invoke-object-method';
|
|
18
20
|
export { default as loadJSON } from './load-json';
|
|
19
21
|
export { default as log } from './log';
|
|
20
22
|
export { default as math } from './math';
|
|
@@ -26,4 +26,4 @@ export interface IOperationMetadata<T> {
|
|
|
26
26
|
properties?: TPropertiesMetadata<T>;
|
|
27
27
|
outputProperties?: TPropertiesMetadata<T>;
|
|
28
28
|
}
|
|
29
|
-
export declare type TParameterTypes = 'ParameterType:htmlElementName' | 'ParameterType:className' | 'ParameterType:selector' | 'ParameterType:string' | 'ParameterType:
|
|
29
|
+
export declare type TParameterTypes = 'ParameterType:htmlElementName' | 'ParameterType:className' | 'ParameterType:selector' | 'ParameterType:string' | 'ParameterType:number' | 'ParameterType:object' | 'ParameterType:boolean' | 'ParameterType:array' | 'ParameterType:eventTopic' | 'ParameterType:eventName' | 'ParameterType:systemName' | 'ParameterType:actionName' | 'ParameterType:controllerName' | 'ParameterType:dimensions' | 'ParameterType:dimensionsModifier' | 'ParameterType:url' | 'ParameterType:htmlContent' | 'ParameterType:labelId' | 'ParameterType:ImagePath' | 'ParameterType:QuadrantPosition' | 'ParameterType:jQuery';
|
|
@@ -4,6 +4,7 @@ export interface IRemovePropertiesFromOperationDataOperationData {
|
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* This operation removes the given list of properties from the current operation data.
|
|
7
|
+
* It will also omit the property 'propertyNames' from the result.
|
|
7
8
|
*
|
|
8
9
|
* @param operationData
|
|
9
10
|
* @returns
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { TOperation } from './types';
|
|
3
3
|
export interface ISelectElementOperationData {
|
|
4
4
|
selector: string;
|
|
5
|
-
propertyName?: string;
|
|
6
5
|
useSelectedElementAsRoot?: boolean;
|
|
7
6
|
selectedElement?: JQuery;
|
|
8
7
|
}
|
|
@@ -10,8 +9,8 @@ export interface ISelectElementOperationData {
|
|
|
10
9
|
* This operation selects one or more elements using the specified selector.
|
|
11
10
|
*
|
|
12
11
|
* If useSelectedElementAsRoot is set to true and a valid DOM element is assigned
|
|
13
|
-
* to the current operation data
|
|
14
|
-
* then the element will be looked for only in the
|
|
12
|
+
* to the current operation data's `selectedElement` property
|
|
13
|
+
* then the element will be looked for only in the descendant elements of this DOM element.
|
|
15
14
|
*
|
|
16
15
|
* @param operationData
|
|
17
16
|
* @returns
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
/// <reference types="jquery" />
|
|
1
2
|
import { TOperation } from './types';
|
|
2
3
|
export interface ISetStyleOperationData {
|
|
3
|
-
properties:
|
|
4
|
-
|
|
4
|
+
properties: Record<string, unknown>;
|
|
5
|
+
selectedElement: JQuery;
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
7
8
|
* This operation assigns the specified CSS style properties to the
|
|
8
9
|
* specified selected element. The selected element is assigned to
|
|
9
|
-
* the
|
|
10
|
-
* to 'selectedElement'.
|
|
10
|
+
* the `selectedElement` property.
|
|
11
11
|
*
|
|
12
12
|
* @param operationData
|
|
13
13
|
* @returns
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { TOperation } from './types';
|
|
2
2
|
export declare type TStartLoopOperationData = {
|
|
3
3
|
collection: any[] | string;
|
|
4
|
-
|
|
4
|
+
currentItem: any;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* This operation starts a loop using the given collection.
|
|
8
8
|
*
|
|
9
9
|
* Each iteration the current item from the specified collection is
|
|
10
|
-
* assigned to the property on the current operation data
|
|
11
|
-
* by the propertyName property which defaults to 'currentItem'.
|
|
10
|
+
* assigned to the `currentItem` property on the current operation data.
|
|
12
11
|
*
|
|
13
12
|
* @param operationData
|
|
14
13
|
* @returns
|
package/dist/types.d.ts
CHANGED
|
@@ -2,20 +2,49 @@ import { IAction } from './action/types';
|
|
|
2
2
|
import { IEngineConfiguration, IResolvedEngineConfiguration } from './configuration/types';
|
|
3
3
|
import { IEventbus, IEventbusListener } from './eventbus/types';
|
|
4
4
|
import { ITimelineProvider } from './timelineproviders/types';
|
|
5
|
+
export declare type KeysOfType<T, U, B = false> = {
|
|
6
|
+
[P in keyof T]: B extends true ? T[P] extends U ? U extends T[P] ? P : never : never : T[P] extends U ? P : never;
|
|
7
|
+
}[keyof T];
|
|
8
|
+
/**
|
|
9
|
+
* Describes an object that is capable of processing the given configuration and constructing an IEligiusEngine
|
|
10
|
+
* based on this configuration.
|
|
11
|
+
*/
|
|
5
12
|
export interface IEngineFactory {
|
|
13
|
+
/**
|
|
14
|
+
* Returns a fully configured IEligiusEngine instance.
|
|
15
|
+
*
|
|
16
|
+
* @param engineConfig The given configuration
|
|
17
|
+
* @param resolver An optional resolver to process the given IEngineConfiguration. When not provided the IEngineFactory is expected to create their own instance.
|
|
18
|
+
*/
|
|
6
19
|
createEngine(engineConfig: IEngineConfiguration, resolver?: IConfigurationResolver): IEligiusEngine;
|
|
7
20
|
}
|
|
8
21
|
export interface IEngineFactoryOptions {
|
|
9
22
|
eventbus?: IEventbus;
|
|
10
23
|
devtools?: boolean;
|
|
11
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Describes an object that is play one or more timelines, defined by a given set of ITimelineProviders.
|
|
27
|
+
*/
|
|
12
28
|
export interface IEligiusEngine {
|
|
29
|
+
/**
|
|
30
|
+
* Do the preparations needed in order to run the given timelines.
|
|
31
|
+
*/
|
|
13
32
|
init(): Promise<ITimelineProvider>;
|
|
33
|
+
/**
|
|
34
|
+
* Do the necessary cleanup before discarding this instance.
|
|
35
|
+
*/
|
|
14
36
|
destroy(): Promise<void>;
|
|
15
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Describes an object that acts as a registry for imported resources.
|
|
40
|
+
*/
|
|
16
41
|
export interface ISimpleResourceImporter {
|
|
17
42
|
import(name: string): Record<string, any>;
|
|
18
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Describes an object that acts as a registry for imported resources and
|
|
46
|
+
* is able to return all of the registered operation, controller and provider names.
|
|
47
|
+
*/
|
|
19
48
|
export interface IResourceImporter extends ISimpleResourceImporter {
|
|
20
49
|
getOperationNames(): string[];
|
|
21
50
|
getControllerNames(): string[];
|
|
@@ -25,15 +54,25 @@ export interface IConfigurationResolver {
|
|
|
25
54
|
process(configuration: IEngineConfiguration, actionRegistryListener?: IEventbusListener): [Record<string, IAction>, IResolvedEngineConfiguration];
|
|
26
55
|
}
|
|
27
56
|
export declare type TResultCallback = (result: any) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Describes a duration of time expressed in a start and an optional end range with a one second interval.
|
|
59
|
+
*/
|
|
28
60
|
export interface IDuration {
|
|
29
61
|
start: number;
|
|
30
62
|
end?: number;
|
|
31
63
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Describes a duration of time expressed in a start and an end range with a one second interval.
|
|
66
|
+
*/
|
|
67
|
+
export interface IStrictDuration extends Required<IDuration> {
|
|
35
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Describes the different kinds of timeline providers.
|
|
71
|
+
*/
|
|
36
72
|
export declare type TimelineTypes = 'animation' | 'mediaplayer';
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
37
76
|
export interface ITimelineProviderInfo {
|
|
38
77
|
id: string;
|
|
39
78
|
vendor: string;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.10",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"homepage": "https://rolandzwaga.github.io/eligius/",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"trailingComma": "es5"
|
|
32
32
|
},
|
|
33
33
|
"name": "eligius",
|
|
34
|
-
"author": "
|
|
34
|
+
"author": "Roland Zwaga <rbzwaga@gmail.com>",
|
|
35
35
|
"size-limit": [
|
|
36
36
|
{
|
|
37
37
|
"path": "dist/eligius.cjs.production.min.js",
|