eligius 1.0.81 → 1.1.0
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 +16 -7
- package/dist/action/action.d.ts +5 -1
- package/dist/action/endable-action.d.ts +1 -1
- package/dist/action/timeline-action.d.ts +1 -1
- package/dist/build/generate-importer-source-code.d.ts +1 -1
- package/dist/configuration/api/action-creator-factory.d.ts +1 -1
- package/dist/configuration/api/configuration-factory.d.ts +96 -3
- package/dist/configuration/configuration-resolver.d.ts +7 -0
- package/dist/configuration/types.d.ts +8 -0
- package/dist/controllers/event-listener-controller.d.ts +10 -3
- package/dist/controllers/label-controller.d.ts +12 -4
- package/dist/controllers/lottie-controller.d.ts +14 -8
- package/dist/controllers/navigation-controller.d.ts +13 -14
- package/dist/controllers/progressbar-controller.d.ts +9 -6
- package/dist/controllers/routing-controller.d.ts +9 -6
- package/dist/controllers/subtitles-controller.d.ts +1 -1
- package/dist/eligius-engine.d.ts +35 -7
- package/dist/eligius.cjs.development.js +5095 -3574
- 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 +5073 -3572
- package/dist/eligius.esm.js.map +1 -1
- package/dist/engine-factory.d.ts +17 -0
- package/dist/eventbus/actionregistry-eventbus-listener.d.ts +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/language-manager.d.ts +6 -0
- package/dist/operation/add-controller-to-element.d.ts +5 -5
- package/dist/operation/animate-with-class.d.ts +1 -1
- package/dist/operation/animate.d.ts +2 -2
- package/dist/operation/calc.d.ts +2 -2
- package/dist/operation/clear-element.d.ts +2 -1
- package/dist/operation/clear-operation-data.d.ts +1 -0
- package/dist/operation/create-element.d.ts +2 -4
- package/dist/operation/custom-function.d.ts +1 -1
- package/dist/operation/end-action.d.ts +5 -1
- package/dist/operation/end-loop.d.ts +1 -2
- package/dist/operation/end-when.d.ts +8 -0
- package/dist/operation/get-controller-from-element.d.ts +1 -1
- package/dist/operation/get-controller-instance.d.ts +3 -5
- package/dist/operation/get-element-dimensions.d.ts +2 -2
- package/dist/operation/get-query-params.d.ts +28 -0
- package/dist/operation/helper/find-matching-operation-index.d.ts +35 -0
- package/dist/operation/helper/get-property-chain-value.d.ts +24 -0
- package/dist/operation/helper/globals.d.ts +3 -0
- package/dist/operation/helper/remove-global.d.ts +1 -0
- package/dist/operation/helper/resolve-event-arguments.d.ts +2 -2
- package/dist/operation/helper/resolve-external-property-chain.d.ts +14 -0
- package/dist/operation/helper/resolve-property-chain.d.ts +23 -0
- package/dist/operation/helper/resolve-property-values.d.ts +11 -2
- package/dist/operation/index.d.ts +6 -0
- package/dist/operation/invoke-object-method.d.ts +28 -0
- package/dist/operation/load-json.d.ts +11 -3
- package/dist/operation/log.d.ts +3 -3
- package/dist/operation/math.d.ts +2 -2
- package/dist/operation/metadata/end-when.d.ts +3 -0
- package/dist/operation/metadata/get-query-params.d.ts +4 -0
- package/dist/operation/metadata/index.d.ts +6 -0
- package/dist/operation/metadata/invoke-object-method.d.ts +4 -0
- package/dist/operation/metadata/otherwise.d.ts +3 -0
- package/dist/operation/metadata/set-global-data.d.ts +4 -0
- package/dist/operation/metadata/start-loop.d.ts +2 -2
- package/dist/operation/metadata/types.d.ts +1 -1
- package/dist/operation/metadata/when.d.ts +4 -0
- package/dist/operation/otherwise.d.ts +9 -0
- package/dist/operation/remove-class.d.ts +1 -1
- package/dist/operation/remove-controller-from-element.d.ts +1 -1
- package/dist/operation/remove-element.d.ts +1 -1
- package/dist/operation/remove-properties-from-operation-data.d.ts +1 -0
- package/dist/operation/reparent-element.d.ts +2 -2
- package/dist/operation/request-action.d.ts +1 -1
- package/dist/operation/select-element.d.ts +3 -4
- package/dist/operation/set-element-attributes.d.ts +1 -1
- package/dist/operation/set-element-content.d.ts +4 -4
- package/dist/operation/set-global-data.d.ts +11 -0
- package/dist/operation/set-operation-data.d.ts +1 -1
- package/dist/operation/set-style.d.ts +4 -5
- package/dist/operation/start-action.d.ts +3 -3
- package/dist/operation/start-loop.d.ts +7 -6
- package/dist/operation/toggle-class.d.ts +10 -1
- package/dist/operation/toggle-element.d.ts +7 -1
- package/dist/operation/types.d.ts +45 -3
- package/dist/operation/wait.d.ts +3 -3
- package/dist/operation/when.d.ts +18 -0
- package/dist/timeline-event-names.d.ts +46 -2
- package/dist/timelineproviders/index.d.ts +0 -1
- package/dist/timelineproviders/media-element-timeline-provider.d.ts +20 -12
- package/dist/timelineproviders/request-animation-frame-timeline-provider.d.ts +19 -20
- package/dist/timelineproviders/types.d.ts +10 -2
- package/dist/{schema-tools/generate-operation-schemas.d.ts → tools/doc-tools/generate-readmes.d.ts} +0 -0
- package/dist/tools/schema-tools/generate-operation-schemas.d.ts +1 -0
- package/dist/{schema-tools → tools/schema-tools}/html-tag-names.d.ts +0 -0
- package/dist/types.d.ts +42 -3
- package/dist/util/guards/is-function.d.ts +1 -0
- package/dist/util/guards/is-object.d.ts +1 -0
- package/dist/util/guards/is-promise.d.ts +1 -0
- package/dist/util/guards/is-string.d.ts +1 -0
- package/package.json +18 -12
- package/dist/action/is-promise.d.ts +0 -1
- package/dist/operation/helper/extract-operation-data-argument-values.d.ts +0 -1
- package/dist/operation/helper/get-globals.d.ts +0 -1
- package/dist/operation/helper/get-nested-property-value.d.ts +0 -1
- package/dist/operation/helper/get-nested-value.d.ts +0 -1
- package/dist/timelineproviders/jwplayer-timeline-provider.d.ts +0 -42
package/dist/engine-factory.d.ts
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { IEngineConfiguration } from './configuration/types';
|
|
2
2
|
import { IConfigurationResolver, IEligiusEngine, IEngineFactory, IEngineFactoryOptions, ISimpleResourceImporter } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The EngineFactory is used to create and initialize an {@link IEligiusEngine} instance.
|
|
5
|
+
*
|
|
6
|
+
* It prepares a resolved configuration and creates the engine based on the class defined in the configuration.
|
|
7
|
+
*
|
|
8
|
+
* @example Loading a configuration and creating an IEligiusEngine instance
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { IEngineConfiguration, EngineFactory, WebpackResourceImporter } from 'eligius';
|
|
11
|
+
* import * as engineConfig from './my-eligius-config.json';
|
|
12
|
+
*
|
|
13
|
+
* const factory = new EngineFactory(new WebpackResourceImporter(), window);
|
|
14
|
+
*
|
|
15
|
+
* const engine = factory.createEngine((engineConfig as unknown) as IEngineConfiguration);
|
|
16
|
+
*
|
|
17
|
+
* engine.init().then(()=> {console.log('Eligius engine ready for business');});
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
3
20
|
export declare class EngineFactory implements IEngineFactory {
|
|
4
21
|
private _actionsLookup;
|
|
5
22
|
private _eventbus;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { IAction } from '../action/types';
|
|
2
2
|
import { IEventbusListener } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The `IEventbusListener` first registers a number of actions that are then
|
|
5
|
+
* executed when the specified event is broadcast.
|
|
6
|
+
*/
|
|
3
7
|
export declare class ActionRegistryEventbusListener implements IEventbusListener {
|
|
4
8
|
private _actionRegistry;
|
|
5
9
|
registerAction(action: IAction, eventName: string, eventTopic?: string): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './action';
|
|
2
2
|
export * from './action/types';
|
|
3
3
|
export * from './build';
|
|
4
|
+
export * from './configuration/api';
|
|
4
5
|
export { ConfigurationResolver } from './configuration/configuration-resolver';
|
|
5
6
|
export * from './configuration/types';
|
|
6
7
|
export * from './controllers';
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { IEventbus } from './eventbus/types';
|
|
2
2
|
import { ILabel, ILanguageLabel, TResultCallback } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* This class manages the labels for an {@link IEligiusEngine} instance.
|
|
5
|
+
*
|
|
6
|
+
* It handles the {@link TimelineEventNames.REQUEST_LABEL_COLLECTION}, {@link TimelineEventNames.REQUEST_LABEL_COLLECTIONS}, {@link TimelineEventNames.REQUEST_CURRENT_LANGUAGE} and {@link TimelineEventNames.LANGUAGE_CHANGE} events.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
3
9
|
export declare class LanguageManager {
|
|
4
10
|
private _currentLanguage;
|
|
5
11
|
private _eventbus;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="jquery" />
|
|
2
2
|
import { IController } from '../controllers/types';
|
|
3
|
-
import { TOperation } from './types';
|
|
4
|
-
export
|
|
3
|
+
import { TOperation, TOperationData } from './types';
|
|
4
|
+
export declare type IAddControllerToElementOperationData<T extends TOperationData = TOperationData> = {
|
|
5
5
|
selectedElement: JQuery;
|
|
6
|
-
controllerInstance: IController<
|
|
7
|
-
}
|
|
6
|
+
controllerInstance: IController<T>;
|
|
7
|
+
} & T;
|
|
8
8
|
/**
|
|
9
|
-
* This operation adds the specified controller instance to the
|
|
9
|
+
* This operation adds the specified controller instance to the given selected element.
|
|
10
10
|
*
|
|
11
11
|
* @param operationData
|
|
12
12
|
* @returns
|
|
@@ -8,7 +8,7 @@ export interface IAnimateWithClassOperationData {
|
|
|
8
8
|
/**
|
|
9
9
|
* This operation adds the specified class name to the specified selected element and assumes that this
|
|
10
10
|
* class triggers and animation on the selected element. It then waits for this animation to complete
|
|
11
|
-
*
|
|
11
|
+
* before it resolves.
|
|
12
12
|
*
|
|
13
13
|
* @param operationData
|
|
14
14
|
* @returns
|
|
@@ -4,10 +4,10 @@ export interface IAnimateOperationData {
|
|
|
4
4
|
animationEasing?: string;
|
|
5
5
|
selectedElement: JQuery;
|
|
6
6
|
animationProperties: any;
|
|
7
|
-
animationDuration:
|
|
7
|
+
animationDuration: JQuery.Duration;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* This operation animates the specified selected element with the given jQuery animation
|
|
10
|
+
* This operation animates the specified selected element with the given [jQuery animation](https://api.jquery.com/animate/) properties, duration and easing.
|
|
11
11
|
* It resolves after the animation completes.
|
|
12
12
|
*
|
|
13
13
|
* @param operationData
|
package/dist/operation/calc.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ 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
|
-
* This operation calculates the given left and right hand
|
|
10
|
+
* This operation calculates the given left and right hand operands using the specified operator.
|
|
11
11
|
*
|
|
12
12
|
* @param operationData
|
|
13
13
|
*/
|
|
@@ -4,6 +4,7 @@ export interface IClearElementOperationData {
|
|
|
4
4
|
selectedElement: JQuery;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* This operation removes all of the children from the
|
|
7
|
+
* This operation removes all of the children from the given selected element.
|
|
8
|
+
*
|
|
8
9
|
*/
|
|
9
10
|
export declare const clearElement: TOperation<IClearElementOperationData>;
|
|
@@ -5,5 +5,6 @@ export interface IClearOperationDataOperationData {
|
|
|
5
5
|
/**
|
|
6
6
|
* This operation removes all of the properties on the current operation date.
|
|
7
7
|
* Or, if the properties property is set only removes the properties defined by that list.
|
|
8
|
+
*
|
|
8
9
|
*/
|
|
9
10
|
export declare const clearOperationData: TOperation<IClearOperationDataOperationData>;
|
|
@@ -5,13 +5,11 @@ export interface ICreateElementOperationData<T extends TTagNames> {
|
|
|
5
5
|
elementName: T;
|
|
6
6
|
text?: string;
|
|
7
7
|
attributes?: Partial<HTMLElementTagNameMap[T]>;
|
|
8
|
-
propertyName?: string;
|
|
9
8
|
template?: JQuery;
|
|
10
9
|
}
|
|
11
10
|
/**
|
|
12
|
-
* This operation creates the DOM element
|
|
13
|
-
* the instance to the
|
|
14
|
-
* The property name defaults to 'template'.
|
|
11
|
+
* This operation creates the DOM element described by the given elementName and attributes and assigns
|
|
12
|
+
* the instance to the `template` property on the current operation data.
|
|
15
13
|
*
|
|
16
14
|
* @param operationData
|
|
17
15
|
* @returns
|
|
@@ -3,7 +3,7 @@ export interface ICustomFunctionOperationData {
|
|
|
3
3
|
systemName: string;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* This operation retrieves a custom function defined by the
|
|
6
|
+
* This operation retrieves a custom function defined by the given system name
|
|
7
7
|
* and invokes it with the current operation data and eventbus.
|
|
8
8
|
*
|
|
9
9
|
* @param operationData
|
|
@@ -5,7 +5,11 @@ export interface IEndActionOperationData {
|
|
|
5
5
|
actionOperationData: any;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* This operation invokes the end
|
|
8
|
+
* This operation invokes the {@link EndableAction.end} method on the specified action instance.
|
|
9
|
+
*
|
|
10
|
+
* The action operation data is first merged with the current operation data before it is
|
|
11
|
+
* passed on to the action. After the action has completed the action operation data properties
|
|
12
|
+
* are removed from the current operation data.
|
|
9
13
|
*
|
|
10
14
|
* @param operationData
|
|
11
15
|
* @returns
|
|
@@ -7,7 +7,7 @@ export interface IGetControllerFromElementOperationData {
|
|
|
7
7
|
controllerInstance?: IController<any>;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* This operation retrieves the controller instance with the specified name
|
|
10
|
+
* This operation retrieves the controller instance with the specified name that is assigned to the given selected element.
|
|
11
11
|
*
|
|
12
12
|
* @param operationData
|
|
13
13
|
* @returns
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import * as controllers from '../controllers';
|
|
2
2
|
import { IController } from '../controllers/types';
|
|
3
|
-
import { TOperation } from './types';
|
|
3
|
+
import { TOperation, TOperationData } from './types';
|
|
4
4
|
declare type TSystemName = keyof typeof controllers;
|
|
5
5
|
export interface IGetControllerInstanceOperationData {
|
|
6
6
|
systemName: TSystemName;
|
|
7
|
-
|
|
8
|
-
controllerInstance?: IController<unknown>;
|
|
7
|
+
controllerInstance?: IController<TOperationData>;
|
|
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
|
|
@@ -9,9 +9,9 @@ export interface IGetElementDimensionsOperationData {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* This operation calculates the width and height of the
|
|
12
|
+
* This operation calculates the width and height of the given selected element.
|
|
13
13
|
* It assigns this struct to the dimensions property on the current operation data.
|
|
14
|
-
* Optionally the width and height can be
|
|
14
|
+
* Optionally the width and height can be modified using the given modifier string.
|
|
15
15
|
*
|
|
16
16
|
* The modifier string is formatted in the following way:
|
|
17
17
|
*
|
|
@@ -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>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IResolvedOperation } from '../../configuration/types';
|
|
2
|
+
/**
|
|
3
|
+
* This function can be used to find the index of a matching operation within a list of operations.
|
|
4
|
+
*
|
|
5
|
+
* Given the array of operations:
|
|
6
|
+
* ```ts
|
|
7
|
+
* [
|
|
8
|
+
* {systemName:'name1'}, // index 0
|
|
9
|
+
* {systemName:'startLoop'}, // index 1
|
|
10
|
+
* {systemName:'name2'}, // index 2
|
|
11
|
+
* {systemName:'startLoop'} // index 3
|
|
12
|
+
* {systemName:'name3'} // index 4
|
|
13
|
+
* {systemName:'endLoop'} // index 5
|
|
14
|
+
* {systemName:'endLoop'} // index 6
|
|
15
|
+
* {systemName:'name3'} // index 7
|
|
16
|
+
* ]
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Given the startLoop instance at index 1, this function will return index 6. Given the startLoop at index 3, it will yield index 5.
|
|
20
|
+
*
|
|
21
|
+
* Returns true when the given operation.systemName equals the specified matchingName and the current counter value is zero.
|
|
22
|
+
*
|
|
23
|
+
* If the matchingName matches operation.systemName but the counter is greater than zero, the counter is decremented.
|
|
24
|
+
*
|
|
25
|
+
* If the operation.systemName equal self (the name of the operation that requires to find its match), then counter is incremented.
|
|
26
|
+
*
|
|
27
|
+
* @param this
|
|
28
|
+
* @param operation
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
export declare function findMatchingOperationIndex(this: {
|
|
32
|
+
counter: number;
|
|
33
|
+
self: string;
|
|
34
|
+
matchingName: string;
|
|
35
|
+
}, operation: IResolvedOperation): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
/**
|
|
3
|
+
* Gets the value for the given property chain. A property chain is defined by a string array.
|
|
4
|
+
*
|
|
5
|
+
* For example, this property chain: `[mySource, subSource, element, value]` should be extracted from an object of this shape:
|
|
6
|
+
* ```ts
|
|
7
|
+
* const foo = {
|
|
8
|
+
* mySource: {
|
|
9
|
+
* subSource: {
|
|
10
|
+
* element: {
|
|
11
|
+
* value: 'bar'
|
|
12
|
+
* }
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* The result of the invocation `getPropertyChainValue([mySource, subSource, element, value], foo)` would then yield the value `bar`.
|
|
19
|
+
*
|
|
20
|
+
* @param propertyChain
|
|
21
|
+
* @param sourceObject
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare function getPropertyChainValue(propertyChain: string[], sourceObject: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function removeGlobal(name: string): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TOperationData } from '../../operation/types';
|
|
2
|
-
export declare function resolveEventArguments(operationData: TOperationData, eventArgs?: any[]): any[] | undefined;
|
|
1
|
+
import { IOperationContext, TOperationData } from '../../operation/types';
|
|
2
|
+
export declare function resolveEventArguments(operationData: TOperationData, operationContext: IOperationContext, eventArgs?: any[]): any[] | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IOperationContext } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves operation and global data property chains.
|
|
4
|
+
*
|
|
5
|
+
* An operation data property chain is designated by a `operationdata.` suffix, followed by an arbitrary property chain.
|
|
6
|
+
* For global data the suffix should be `globaldata.`
|
|
7
|
+
*
|
|
8
|
+
* If the propertyChainOrRegularObject is not a property chain, this value is returned instead.
|
|
9
|
+
*
|
|
10
|
+
* @param sourceObject The object that represents the operation data
|
|
11
|
+
* @param propertyChainOrRegularObject A period delimited string, or just a regular object
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveExternalPropertyChain(sourceObject: any, operationContext: IOperationContext, propertyChainOrRegularObject: any): any;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets the value for the given property chain. A property chain is defined by a period delimited string.
|
|
3
|
+
*
|
|
4
|
+
* For example, this property chain: `mySource.subSource.element.value` should be extracted from an object of this shape:
|
|
5
|
+
* ```ts
|
|
6
|
+
* const foo = {
|
|
7
|
+
* mySource: {
|
|
8
|
+
* subSource: {
|
|
9
|
+
* element: {
|
|
10
|
+
* value: 'bar'
|
|
11
|
+
* }
|
|
12
|
+
* }
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* The result of the invocation `resolvePropertyChain('mySource.subSource.element.value', foo)` would then yield the value `bar`.
|
|
18
|
+
*
|
|
19
|
+
* @param propertyChain the specified property chain
|
|
20
|
+
* @param sourceObject the given source object
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolvePropertyChain(propertyChain: string, sourceObject: any): any;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import { TOperationData } from '../../operation/types';
|
|
2
|
-
|
|
1
|
+
import { IOperationContext, TOperationData } from '../../operation/types';
|
|
2
|
+
/**
|
|
3
|
+
* This takes a `newProperties` instance, resolves all of the properties on this object and then
|
|
4
|
+
* assigns these properties to the given operationData.
|
|
5
|
+
*
|
|
6
|
+
* @param operationData
|
|
7
|
+
* @param operationContext
|
|
8
|
+
* @param newProperties
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolvePropertyValues<T extends TOperationData>(operationData: T, operationContext: IOperationContext, newProperties: Record<string, any>): T;
|
|
@@ -10,14 +10,18 @@ export { createElement } from './create-element';
|
|
|
10
10
|
export { customFunction } from './custom-function';
|
|
11
11
|
export { endAction } from './end-action';
|
|
12
12
|
export { endLoop } from './end-loop';
|
|
13
|
+
export { endWhen } from './end-when';
|
|
13
14
|
export { extendController } from './extend-controller';
|
|
14
15
|
export { getControllerFromElement } from './get-controller-from-element';
|
|
15
16
|
export { getControllerInstance } from './get-controller-instance';
|
|
16
17
|
export { getElementDimensions } from './get-element-dimensions';
|
|
17
18
|
export { getImport } from './get-import';
|
|
19
|
+
export { getQueryParams } from './get-query-params';
|
|
20
|
+
export { invokeObjectMethod } from './invoke-object-method';
|
|
18
21
|
export { loadJSON } from './load-json';
|
|
19
22
|
export { log } from './log';
|
|
20
23
|
export { math } from './math';
|
|
24
|
+
export { otherwise } from './otherwise';
|
|
21
25
|
export { removeClass } from './remove-class';
|
|
22
26
|
export { removeControllerFromElement } from './remove-controller-from-element';
|
|
23
27
|
export { removeElement } from './remove-element';
|
|
@@ -28,6 +32,7 @@ export { resizeAction } from './resize-action';
|
|
|
28
32
|
export { selectElement } from './select-element';
|
|
29
33
|
export { setElementAttributes } from './set-element-attributes';
|
|
30
34
|
export { setElementContent } from './set-element-content';
|
|
35
|
+
export { setGlobalData } from './set-global-data';
|
|
31
36
|
export { setOperationData } from './set-operation-data';
|
|
32
37
|
export { setStyle } from './set-style';
|
|
33
38
|
export { startAction } from './start-action';
|
|
@@ -36,3 +41,4 @@ export { toggleClass } from './toggle-class';
|
|
|
36
41
|
export { toggleElement } from './toggle-element';
|
|
37
42
|
export * from './types';
|
|
38
43
|
export { wait } from './wait';
|
|
44
|
+
export { when } from './when';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TOperation } from './types';
|
|
2
|
+
export interface IInvokeObjectMethodOperationData {
|
|
3
|
+
/**
|
|
4
|
+
* The given object instance
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
instance: any;
|
|
8
|
+
/**
|
|
9
|
+
* The method name on the given object that will be invoked
|
|
10
|
+
*/
|
|
11
|
+
methodName: string;
|
|
12
|
+
/**
|
|
13
|
+
* Arguments that will be passed to the specified method
|
|
14
|
+
*/
|
|
15
|
+
methodArguments?: any[];
|
|
16
|
+
/**
|
|
17
|
+
* If any, the results of the method invocation are assigned to the property
|
|
18
|
+
*/
|
|
19
|
+
methodResult?: any;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* This operation invokes the specified method on the given object with the given optional arguments
|
|
23
|
+
* and assigns the result to the `methodResult` operationdata property.
|
|
24
|
+
*
|
|
25
|
+
* @param operationData
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export declare const invokeObjectMethod: TOperation<IInvokeObjectMethodOperationData>;
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { TOperation } from './types';
|
|
2
2
|
export interface ILoadJSONOperationData {
|
|
3
|
+
/**
|
|
4
|
+
* The URL where the JSON will be retrieved from
|
|
5
|
+
*/
|
|
3
6
|
url: string;
|
|
7
|
+
/**
|
|
8
|
+
* If true, the results will be added to the cache and any subsequent call will use this cache
|
|
9
|
+
*/
|
|
4
10
|
cache: boolean;
|
|
5
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The JSON retrieved from the given URL
|
|
13
|
+
*/
|
|
6
14
|
json?: any;
|
|
7
15
|
}
|
|
8
16
|
export declare const clearCache: () => void;
|
|
9
17
|
export declare const addToCache: (key: string, value: any) => void;
|
|
10
18
|
/**
|
|
11
|
-
* This operation loads a JSON file from the specified url and assigns it to the
|
|
12
|
-
* property
|
|
19
|
+
* This operation loads a JSON file from the specified url and assigns it to the json
|
|
20
|
+
* property on the current operation data.
|
|
13
21
|
*
|
|
14
22
|
* If the cache property is set to true and a cached value already exists, this is assigned
|
|
15
23
|
* instead of re-retrieving it from the url.
|
package/dist/operation/log.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TOperation } from './types';
|
|
1
|
+
import { TOperation, TOperationData } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* This operation logs the current operation data and context.
|
|
3
|
+
* This operation logs the current operation data and context to the console.
|
|
4
4
|
*
|
|
5
5
|
* @param operationData
|
|
6
6
|
* @returns
|
|
7
7
|
*/
|
|
8
|
-
export declare const log: TOperation
|
|
8
|
+
export declare const log: TOperation<TOperationData>;
|
package/dist/operation/math.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ 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
|
-
* This operation performs the given math function
|
|
8
|
+
* This operation performs the given math function with the specified arguments.
|
|
9
9
|
*
|
|
10
10
|
* @param operationData
|
|
11
11
|
*/
|
|
@@ -10,14 +10,18 @@ export { default as createElement } from './create-element';
|
|
|
10
10
|
export { default as customFunction } from './custom-function';
|
|
11
11
|
export { default as endAction } from './end-action';
|
|
12
12
|
export { default as endLoop } from './end-loop';
|
|
13
|
+
export { default as endWhen } from './end-when';
|
|
13
14
|
export { default as extendController } from './extend-controller';
|
|
14
15
|
export { default as getControllerFromElement } from './get-controller-from-element';
|
|
15
16
|
export { default as getControllerInstance } from './get-controller-instance';
|
|
16
17
|
export { default as getElementDimensions } from './get-element-dimensions';
|
|
17
18
|
export { default as getImport } from './get-import';
|
|
19
|
+
export { default as getQueryParams } from './get-query-params';
|
|
20
|
+
export { default as invokeObjectMethod } from './invoke-object-method';
|
|
18
21
|
export { default as loadJSON } from './load-json';
|
|
19
22
|
export { default as log } from './log';
|
|
20
23
|
export { default as math } from './math';
|
|
24
|
+
export { default as otherwise } from './otherwise';
|
|
21
25
|
export { default as removeClass } from './remove-class';
|
|
22
26
|
export { default as removeControllerFromElement } from './remove-controller-from-element';
|
|
23
27
|
export { default as removeElement } from './remove-element';
|
|
@@ -28,6 +32,7 @@ export { default as resizeAction } from './resize-action';
|
|
|
28
32
|
export { default as selectElement } from './select-element';
|
|
29
33
|
export { default as setElementAttributes } from './set-element-attributes';
|
|
30
34
|
export { default as setElementContent } from './set-element-content';
|
|
35
|
+
export { default as setGlobalData } from './set-global-data';
|
|
31
36
|
export { default as setOperationData } from './set-operation-data';
|
|
32
37
|
export { default as setStyle } from './set-style';
|
|
33
38
|
export { default as startAction } from './start-action';
|
|
@@ -35,3 +40,4 @@ export { default as startLoop } from './start-loop';
|
|
|
35
40
|
export { default as toggleClass } from './toggle-class';
|
|
36
41
|
export { default as toggleElement } from './toggle-element';
|
|
37
42
|
export { default as wait } from './wait';
|
|
43
|
+
export { default as when } from './when';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IStartLoopOperationData } from '../../operation/start-loop';
|
|
2
2
|
import { IOperationMetadata } from './types';
|
|
3
|
-
declare function startLoop(): IOperationMetadata<
|
|
3
|
+
declare function startLoop(): IOperationMetadata<IStartLoopOperationData>;
|
|
4
4
|
export default startLoop;
|
|
@@ -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' | 'ParameterType:expression';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TOperation } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* If the preceeding {@link when} operation evaluates to `true` subsequent operations will
|
|
4
|
+
* be skipped until an {@link endWhen} operation is encountered.
|
|
5
|
+
*
|
|
6
|
+
* @param operationData
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare const otherwise: TOperation<{}>;
|
|
@@ -5,7 +5,7 @@ export interface IRemoveClassOperationData {
|
|
|
5
5
|
className: string;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* This operation removes the spcified class name from the
|
|
8
|
+
* This operation removes the spcified class name from the given selected element.
|
|
9
9
|
*
|
|
10
10
|
* @param operationData
|
|
11
11
|
* @returns
|
|
@@ -5,7 +5,7 @@ export interface IRemoveControllerFromElementOperationData {
|
|
|
5
5
|
controllerName: string;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* This operation removes the controller with the specified name from the
|
|
8
|
+
* This operation removes the controller with the specified name from the given selected element.
|
|
9
9
|
*
|
|
10
10
|
* @param operationData
|
|
11
11
|
* @returns
|