eligius 2.0.0 → 2.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/dist/index.d.mts +152 -10
- package/dist/index.mjs +284 -49
- package/dist/index.mjs.map +1 -1
- package/jsonschema/eligius-configuration.json +101 -47
- package/jsonschema/endable-action-template.json +4 -2
- package/jsonschema/endable-action.json +3 -1
- package/jsonschema/event-action.json +3 -1
- package/jsonschema/mediaplayer-timeline-provider-settings.json +85 -30
- package/jsonschema/raf-timeline-provider-settings.json +132 -20
- package/jsonschema/timeline-action.json +4 -2
- package/jsonschema/timeline-provider-settings.json +6 -3
- package/jsonschema/timeline.json +31 -10
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4618,7 +4618,7 @@ declare class EndableActionEditor<T extends IEndableActionConfiguration = IEndab
|
|
|
4618
4618
|
* @param operationData
|
|
4619
4619
|
* @returns
|
|
4620
4620
|
*/
|
|
4621
|
-
addEndOperation<T extends TOperationName, O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>>(systemName: TOperationName, operationData: O): OperationEditor<this, TOperation<IAddClassOperationData, Omit<IAddClassOperationData, "className">> | TOperation<IAddControllerToElementOperationData<TOperationData>> | TOperation<IAddGlobalsToOperationData, Omit<IAddGlobalsToOperationData, "globalProperties">> | TOperation<IAnimateOperationData, Omit<IAnimateOperationData, "animationEasing" | "animationProperties" | "animationDuration">> | TOperation<IAnimateWithClassOperationData, Promise<IAnimateWithClassOperationData>> | TOperation<IAnnounceToScreenReaderOperationData, Omit<IAnnounceToScreenReaderOperationData, "message" | "priority">> | TOperation<TOperationData> | TOperation<IBroadcastEventOperationData, Omit<IBroadcastEventOperationData, "eventArgs" | "eventTopic" | "eventName">> | TOperation<ICalcOperationData, Omit<ICalcOperationData, "left" | "right" | "operator">> | TOperation<IClearElementOperationData> | TOperation<IClearOperationDataOperationData, Omit<IClearOperationDataOperationData, "properties">> | TOperation<IClearStorageOperationData, Omit<IClearStorageOperationData, "key" | "storageType">> | TOperation<ICompareDateOperationData, Omit<ICompareDateOperationData, "date1" | "date2">> | TOperation<IConcatenateStringsOperationData, Omit<IConcatenateStringsOperationData, "strings" | "separator">> | TOperation<ICreateElementOperationData<keyof HTMLElementTagNameMap>, Omit<RequireKeys<ICreateElementOperationData<keyof HTMLElementTagNameMap>, "template">, "elementName" | "text" | "attributes">> | TOperation<ICustomFunctionOperationData, Omit<ICustomFunctionOperationData, "systemName">> | TOperation<IEndActionOperationData, Omit<IEndActionOperationData, "actionOperationData">> | TOperation<Record<string, unknown>> | TOperation<IExtendControllerOperationData, Omit<IExtendControllerOperationData, "controllerExtension">> | TOperation<IFilterArrayOperationData, Omit<IFilterArrayOperationData, "filterProperty" | "filterValue" | "filterPredicate">> | TOperation<IFindInArrayOperationData, Omit<IFindInArrayOperationData, "findProperty" | "findValue" | "findPredicate">> | TOperation<IForEachOperationData> | TOperation<IFormatDateOperationData, Omit<IFormatDateOperationData, "format">> | TOperation<IFormatTextOperationData, Omit<IFormatTextOperationData, "transformation">> | TOperation<IGetAttributesFromElementOperationData, Omit<IGetAttributesFromElementOperationData, "attributeNames">> | TOperation<IGetControllerFromElementOperationData, Omit<IGetControllerFromElementOperationData, "controllerName">> | TOperation<IGetControllerInstanceOperationData, Omit<IGetControllerInstanceOperationData, "systemName">> | TOperation<IGetCurrentTimeOperationData, IGetCurrentTimeOperationData> | TOperation<IGetElementDimensionsOperationData, Omit<IGetElementDimensionsOperationData, "modifier">> | TOperation<IGetFocusedElementOperationData, IGetFocusedElementOperationData> | TOperation<IGetFormDataOperationData, IGetFormDataOperationData> | TOperation<IGetImportOperationData, Omit<RequireKeys<IGetImportOperationData, "importedInstance">, "systemName">> | TOperation<IGetQueryParamsOperationData, Omit<IGetQueryParamsOperationData, "defaultValues">> | TOperation<IGetScrollPositionOperationData, IGetScrollPositionOperationData> | TOperation<IGetTextContentOperationData, IGetTextContentOperationData> | TOperation<IHttpDeleteOperationData, Omit<IHttpDeleteOperationData, "url" | "headers">> | TOperation<IHttpPostOperationData, Omit<IHttpPostOperationData, "body" | "url" | "headers">> | TOperation<IHttpPutOperationData, Omit<IHttpPutOperationData, "body" | "url" | "headers">> | TOperation<IInvokeObjectMethodOperationData, Omit<IInvokeObjectMethodOperationData, "methodName" | "methodArguments">> | TOperation<IIsElementInViewportOperationData, IIsElementInViewportOperationData> | TOperation<ILoadFromStorageOperationData, Omit<ILoadFromStorageOperationData, "storageType">> | TOperation<ILoadJSONOperationData, Omit<ILoadJSONOperationData, "url" | "cache">> | TOperation<ILogOperationData, Omit<ILogOperationData, "logValue" | "logName">> | TOperation<IMapArrayOperationData, Omit<IMapArrayOperationData, "mapFunction">> | TOperation<IMathOperationData, Omit<IMathOperationData, "args" | "functionName">> | TOperation<IRemoveClassOperationData, Omit<IRemoveClassOperationData, "className">> | TOperation<IRemoveControllerFromElementOperationData, Omit<IRemoveControllerFromElementOperationData, "controllerName">> | TOperation<IRemoveElementOperationData> | TOperation<IRemovePropertiesFromOperationDataOperationData, Omit<IRemovePropertiesFromOperationDataOperationData, "propertyNames">> | TOperation<IReparentElementOperationData, Omit<IReparentElementOperationData, "newParentSelector">> | TOperation<IReplaceStringOperationData, Omit<IReplaceStringOperationData, "pattern" | "replacement">> | TOperation<IReplaceTextOperationData, Omit<IReplaceTextOperationData, "replacement" | "searchPattern">> | TOperation<IRequestActionOperationData, Omit<Required<IRequestActionOperationData>, "systemName">> | TOperation<ISaveToStorageOperationData, Omit<ISaveToStorageOperationData, "storageType" | "value">> | TOperation<IScrollToElementOperationData, Omit<IScrollToElementOperationData, "behavior" | "block" | "inline">> | TOperation<IScrollToPositionOperationData, Omit<IScrollToPositionOperationData, "behavior" | "x" | "y">> | TOperation<ISelectElementOperationData, Omit<ISelectElementOperationData, "selector" | "useSelectedElementAsRoot">> | TOperation<ISetDataOperationData, Omit<ISetDataOperationData, "properties">> | TOperation<ISetElementAttributesOperationData, Omit<ISetElementAttributesOperationData, "attributes">> | TOperation<ISetElementContentOperationData, Omit<ISetElementContentOperationData, "template" | "insertionType">> | TOperation<ISetFocusOperationData, ISetFocusOperationData> | TOperation<ISetFormValueOperationData, Omit<ISetFormValueOperationData, "value">> | TOperation<ISetGlobalDataOperationData, Omit<ISetGlobalDataOperationData, "propertyNames">> | TOperation<ISetOperationData, Omit<ISetOperationData, "properties" | "override">> | TOperation<ISetStyleOperationData, Omit<ISetStyleOperationData, "properties">> | TOperation<ISetVariableOperationData, Omit<ISetVariableOperationData, "
|
|
4621
|
+
addEndOperation<T extends TOperationName, O extends Partial<ExtractOperationDataType<GetOperationByName<T>>>>(systemName: TOperationName, operationData: O): OperationEditor<this, TOperation<IAddClassOperationData, Omit<IAddClassOperationData, "className">> | TOperation<IAddControllerToElementOperationData<TOperationData>> | TOperation<IAddGlobalsToOperationData, Omit<IAddGlobalsToOperationData, "globalProperties">> | TOperation<IAnimateOperationData, Omit<IAnimateOperationData, "animationEasing" | "animationProperties" | "animationDuration">> | TOperation<IAnimateWithClassOperationData, Promise<IAnimateWithClassOperationData>> | TOperation<IAnnounceToScreenReaderOperationData, Omit<IAnnounceToScreenReaderOperationData, "message" | "priority">> | TOperation<TOperationData> | TOperation<IBroadcastEventOperationData, Omit<IBroadcastEventOperationData, "eventArgs" | "eventTopic" | "eventName">> | TOperation<ICalcOperationData, Omit<ICalcOperationData, "left" | "right" | "operator">> | TOperation<IClearElementOperationData> | TOperation<IClearOperationDataOperationData, Omit<IClearOperationDataOperationData, "properties">> | TOperation<IClearStorageOperationData, Omit<IClearStorageOperationData, "key" | "storageType">> | TOperation<ICompareDateOperationData, Omit<ICompareDateOperationData, "date1" | "date2">> | TOperation<IConcatenateStringsOperationData, Omit<IConcatenateStringsOperationData, "strings" | "separator">> | TOperation<ICreateElementOperationData<keyof HTMLElementTagNameMap>, Omit<RequireKeys<ICreateElementOperationData<keyof HTMLElementTagNameMap>, "template">, "elementName" | "text" | "attributes">> | TOperation<ICustomFunctionOperationData, Omit<ICustomFunctionOperationData, "systemName">> | TOperation<IEndActionOperationData, Omit<IEndActionOperationData, "actionOperationData">> | TOperation<Record<string, unknown>> | TOperation<IExtendControllerOperationData, Omit<IExtendControllerOperationData, "controllerExtension">> | TOperation<IFilterArrayOperationData, Omit<IFilterArrayOperationData, "filterProperty" | "filterValue" | "filterPredicate">> | TOperation<IFindInArrayOperationData, Omit<IFindInArrayOperationData, "findProperty" | "findValue" | "findPredicate">> | TOperation<IForEachOperationData> | TOperation<IFormatDateOperationData, Omit<IFormatDateOperationData, "format">> | TOperation<IFormatTextOperationData, Omit<IFormatTextOperationData, "transformation">> | TOperation<IGetAttributesFromElementOperationData, Omit<IGetAttributesFromElementOperationData, "attributeNames">> | TOperation<IGetControllerFromElementOperationData, Omit<IGetControllerFromElementOperationData, "controllerName">> | TOperation<IGetControllerInstanceOperationData, Omit<IGetControllerInstanceOperationData, "systemName">> | TOperation<IGetCurrentTimeOperationData, IGetCurrentTimeOperationData> | TOperation<IGetElementDimensionsOperationData, Omit<IGetElementDimensionsOperationData, "modifier">> | TOperation<IGetFocusedElementOperationData, IGetFocusedElementOperationData> | TOperation<IGetFormDataOperationData, IGetFormDataOperationData> | TOperation<IGetImportOperationData, Omit<RequireKeys<IGetImportOperationData, "importedInstance">, "systemName">> | TOperation<IGetQueryParamsOperationData, Omit<IGetQueryParamsOperationData, "defaultValues">> | TOperation<IGetScrollPositionOperationData, IGetScrollPositionOperationData> | TOperation<IGetTextContentOperationData, IGetTextContentOperationData> | TOperation<IHttpDeleteOperationData, Omit<IHttpDeleteOperationData, "url" | "headers">> | TOperation<IHttpPostOperationData, Omit<IHttpPostOperationData, "body" | "url" | "headers">> | TOperation<IHttpPutOperationData, Omit<IHttpPutOperationData, "body" | "url" | "headers">> | TOperation<IInvokeObjectMethodOperationData, Omit<IInvokeObjectMethodOperationData, "methodName" | "methodArguments">> | TOperation<IIsElementInViewportOperationData, IIsElementInViewportOperationData> | TOperation<ILoadFromStorageOperationData, Omit<ILoadFromStorageOperationData, "storageType">> | TOperation<ILoadJSONOperationData, Omit<ILoadJSONOperationData, "url" | "cache">> | TOperation<ILogOperationData, Omit<ILogOperationData, "logValue" | "logName">> | TOperation<IMapArrayOperationData, Omit<IMapArrayOperationData, "mapFunction">> | TOperation<IMathOperationData, Omit<IMathOperationData, "args" | "functionName">> | TOperation<IRemoveClassOperationData, Omit<IRemoveClassOperationData, "className">> | TOperation<IRemoveControllerFromElementOperationData, Omit<IRemoveControllerFromElementOperationData, "controllerName">> | TOperation<IRemoveElementOperationData> | TOperation<IRemovePropertiesFromOperationDataOperationData, Omit<IRemovePropertiesFromOperationDataOperationData, "propertyNames">> | TOperation<IReparentElementOperationData, Omit<IReparentElementOperationData, "newParentSelector">> | TOperation<IReplaceStringOperationData, Omit<IReplaceStringOperationData, "pattern" | "replacement">> | TOperation<IReplaceTextOperationData, Omit<IReplaceTextOperationData, "replacement" | "searchPattern">> | TOperation<IRequestActionOperationData, Omit<Required<IRequestActionOperationData>, "systemName">> | TOperation<ISaveToStorageOperationData, Omit<ISaveToStorageOperationData, "storageType" | "value">> | TOperation<IScrollToElementOperationData, Omit<IScrollToElementOperationData, "behavior" | "block" | "inline">> | TOperation<IScrollToPositionOperationData, Omit<IScrollToPositionOperationData, "behavior" | "x" | "y">> | TOperation<ISelectElementOperationData, Omit<ISelectElementOperationData, "selector" | "useSelectedElementAsRoot">> | TOperation<ISetDataOperationData, Omit<ISetDataOperationData, "properties">> | TOperation<ISetElementAttributesOperationData, Omit<ISetElementAttributesOperationData, "attributes">> | TOperation<ISetElementContentOperationData, Omit<ISetElementContentOperationData, "template" | "insertionType">> | TOperation<ISetFocusOperationData, ISetFocusOperationData> | TOperation<ISetFormValueOperationData, Omit<ISetFormValueOperationData, "value">> | TOperation<ISetGlobalDataOperationData, Omit<ISetGlobalDataOperationData, "propertyNames">> | TOperation<ISetOperationData, Omit<ISetOperationData, "properties" | "override">> | TOperation<ISetStyleOperationData, Omit<ISetStyleOperationData, "properties">> | TOperation<ISetVariableOperationData, Omit<ISetVariableOperationData, "value" | "name">> | TOperation<ISortArrayOperationData, Omit<ISortArrayOperationData, "sortProperty" | "sortOrder" | "sortComparator">> | TOperation<ISplitStringOperationData, Omit<ISplitStringOperationData, "delimiter" | "limit">> | TOperation<IStartActionOperationData, Omit<IStartActionOperationData, "actionOperationData">> | TOperation<ISubstringTextOperationData, Omit<ISubstringTextOperationData, "start" | "end">> | TOperation<IToggleClassOperationData, Omit<IToggleClassOperationData, "className">> | TOperation<IToggleElementOperationData> | TOperation<IToggleFormElementOperationData, Omit<IToggleFormElementOperationData, "enabled">> | TOperation<IValidateFormOperationData, Omit<IValidateFormOperationData, "validationRules">> | TOperation<IWaitOperationData, Omit<IWaitOperationData, "milliseconds">> | TOperation<IWhenOperationData, Omit<IWhenOperationData, "expression">>>;
|
|
4622
4622
|
/**
|
|
4623
4623
|
*
|
|
4624
4624
|
* Starts an editor for the end operation associated with the given id
|
|
@@ -5661,14 +5661,6 @@ declare class ControllerNamesProvider {
|
|
|
5661
5661
|
declare class OperationMetadataProvider {
|
|
5662
5662
|
getOperationMetadata(operationName: TOperationName): IOperationMetadata<TOperationData>;
|
|
5663
5663
|
}
|
|
5664
|
-
/**
|
|
5665
|
-
*
|
|
5666
|
-
* Provider for all the available event names
|
|
5667
|
-
*
|
|
5668
|
-
*/
|
|
5669
|
-
declare class TimeLineEventNamesProvider {
|
|
5670
|
-
getEventNames(): EventName[];
|
|
5671
|
-
}
|
|
5672
5664
|
//#endregion
|
|
5673
5665
|
//#region src/configuration/api/subtitle-converter.d.ts
|
|
5674
5666
|
/**
|
|
@@ -6010,6 +6002,156 @@ declare abstract class BasePositionSource implements IPositionSource {
|
|
|
6010
6002
|
protected abstract stopTicking(): void;
|
|
6011
6003
|
}
|
|
6012
6004
|
//#endregion
|
|
6005
|
+
//#region src/timelineproviders/position-sources/keyboard-step-source.d.ts
|
|
6006
|
+
/**
|
|
6007
|
+
* Vertical axis mode for keyboard navigation.
|
|
6008
|
+
*
|
|
6009
|
+
* - `timeline-switch`: Up/Down arrows emit timeline change requests
|
|
6010
|
+
* - `chapter-navigation`: Up/Down arrows jump between markers
|
|
6011
|
+
* - `disabled`: Up/Down arrows do nothing
|
|
6012
|
+
*/
|
|
6013
|
+
type TVerticalMode = 'timeline-switch' | 'chapter-navigation' | 'disabled';
|
|
6014
|
+
/**
|
|
6015
|
+
* Configuration for KeyboardStepSource.
|
|
6016
|
+
*/
|
|
6017
|
+
interface KeyboardStepSourceConfig {
|
|
6018
|
+
/**
|
|
6019
|
+
* Total duration in seconds.
|
|
6020
|
+
*/
|
|
6021
|
+
duration: number;
|
|
6022
|
+
/**
|
|
6023
|
+
* Vertical axis behavior.
|
|
6024
|
+
*/
|
|
6025
|
+
verticalMode: TVerticalMode;
|
|
6026
|
+
/**
|
|
6027
|
+
* Step size for Left/Right arrows in seconds.
|
|
6028
|
+
* @default 1
|
|
6029
|
+
*/
|
|
6030
|
+
stepSize?: number;
|
|
6031
|
+
/**
|
|
6032
|
+
* Large step size for Shift+Left/Right arrows in seconds.
|
|
6033
|
+
* @default 10
|
|
6034
|
+
*/
|
|
6035
|
+
largeStepSize?: number;
|
|
6036
|
+
/**
|
|
6037
|
+
* Marker positions for chapter navigation mode (in seconds).
|
|
6038
|
+
* Will be auto-sorted ascending on init.
|
|
6039
|
+
*/
|
|
6040
|
+
markers?: number[];
|
|
6041
|
+
/**
|
|
6042
|
+
* Target element to scope keyboard bindings.
|
|
6043
|
+
* Can be an HTMLElement or a CSS selector string.
|
|
6044
|
+
* If not provided, bindings are global (document).
|
|
6045
|
+
*/
|
|
6046
|
+
targetElement?: HTMLElement | string;
|
|
6047
|
+
/**
|
|
6048
|
+
* Whether navigation wraps at boundaries.
|
|
6049
|
+
* @default true
|
|
6050
|
+
*/
|
|
6051
|
+
wrapNavigation?: boolean;
|
|
6052
|
+
}
|
|
6053
|
+
/**
|
|
6054
|
+
* Keyboard-based position source for stepping through a timeline.
|
|
6055
|
+
*
|
|
6056
|
+
* Supports:
|
|
6057
|
+
* - Left/Right arrows: step by `stepSize` (default 1s)
|
|
6058
|
+
* - Shift+Left/Right: large step by `largeStepSize` (default 10s)
|
|
6059
|
+
* - Home/End: jump to start/end
|
|
6060
|
+
* - Up/Down: configurable (timeline switch, chapter navigation, or disabled)
|
|
6061
|
+
*
|
|
6062
|
+
* @example
|
|
6063
|
+
* ```typescript
|
|
6064
|
+
* const source = new KeyboardStepSource({
|
|
6065
|
+
* duration: 60,
|
|
6066
|
+
* verticalMode: 'chapter-navigation',
|
|
6067
|
+
* markers: [0, 10, 20, 30, 40, 50],
|
|
6068
|
+
* });
|
|
6069
|
+
*
|
|
6070
|
+
* await source.init();
|
|
6071
|
+
*
|
|
6072
|
+
* source.onPosition((position) => {
|
|
6073
|
+
* console.log(`Position: ${position}s`);
|
|
6074
|
+
* });
|
|
6075
|
+
*
|
|
6076
|
+
* source.onMarkerJump((index, position) => {
|
|
6077
|
+
* console.log(`Jumped to marker ${index} at ${position}s`);
|
|
6078
|
+
* });
|
|
6079
|
+
*
|
|
6080
|
+
* await source.activate();
|
|
6081
|
+
* ```
|
|
6082
|
+
*/
|
|
6083
|
+
declare class KeyboardStepSource extends BasePositionSource implements ISeekable {
|
|
6084
|
+
private readonly _stepSize;
|
|
6085
|
+
private readonly _largeStepSize;
|
|
6086
|
+
private readonly _verticalMode;
|
|
6087
|
+
private readonly _wrapNavigation;
|
|
6088
|
+
private _markers;
|
|
6089
|
+
private readonly _targetElementConfig?;
|
|
6090
|
+
private _targetElement?;
|
|
6091
|
+
private readonly _scopeId;
|
|
6092
|
+
private readonly _timelineChangeCallbacks;
|
|
6093
|
+
private readonly _markerJumpCallbacks;
|
|
6094
|
+
/**
|
|
6095
|
+
* Create a new keyboard-based position source.
|
|
6096
|
+
*
|
|
6097
|
+
* @param config - Configuration options
|
|
6098
|
+
*/
|
|
6099
|
+
constructor(config: KeyboardStepSourceConfig);
|
|
6100
|
+
protected doInit(): Promise<void>;
|
|
6101
|
+
protected doDestroy(): void;
|
|
6102
|
+
protected startTicking(): void;
|
|
6103
|
+
protected stopTicking(): void;
|
|
6104
|
+
/**
|
|
6105
|
+
* Seek to a specific position.
|
|
6106
|
+
*
|
|
6107
|
+
* Position is clamped to the valid range [0, duration].
|
|
6108
|
+
*
|
|
6109
|
+
* @param position - Target position in seconds
|
|
6110
|
+
* @returns Actual position after seek (may be clamped)
|
|
6111
|
+
*/
|
|
6112
|
+
seek(position: number): Promise<number>;
|
|
6113
|
+
/**
|
|
6114
|
+
* Register callback for timeline change requests (timeline-switch mode).
|
|
6115
|
+
*
|
|
6116
|
+
* @param callback - Called with 'prev' or 'next' when Up/Down is pressed
|
|
6117
|
+
*/
|
|
6118
|
+
onTimelineChangeRequest(callback: (direction: 'prev' | 'next') => void): void;
|
|
6119
|
+
/**
|
|
6120
|
+
* Register callback for marker jumps (chapter-navigation mode).
|
|
6121
|
+
*
|
|
6122
|
+
* @param callback - Called with marker index and position when jumping
|
|
6123
|
+
*/
|
|
6124
|
+
onMarkerJump(callback: (markerIndex: number, position: number) => void): void;
|
|
6125
|
+
/**
|
|
6126
|
+
* Bind all keyboard handlers.
|
|
6127
|
+
*/
|
|
6128
|
+
private _bindKeys;
|
|
6129
|
+
/**
|
|
6130
|
+
* Unbind all keyboard handlers.
|
|
6131
|
+
*/
|
|
6132
|
+
private _unbindKeys;
|
|
6133
|
+
private _handleStepForward;
|
|
6134
|
+
private _handleStepBackward;
|
|
6135
|
+
private _handleLargeStepForward;
|
|
6136
|
+
private _handleLargeStepBackward;
|
|
6137
|
+
private _handleJumpToStart;
|
|
6138
|
+
private _handleJumpToEnd;
|
|
6139
|
+
private _handleVerticalPrev;
|
|
6140
|
+
private _handleVerticalNext;
|
|
6141
|
+
private _emitTimelineChange;
|
|
6142
|
+
private _jumpToPreviousMarker;
|
|
6143
|
+
private _jumpToNextMarker;
|
|
6144
|
+
/**
|
|
6145
|
+
* Find the index of the current or previous marker.
|
|
6146
|
+
*
|
|
6147
|
+
* If position matches a marker exactly, returns that marker's index.
|
|
6148
|
+
* Otherwise, returns the index of the marker before the current position.
|
|
6149
|
+
* Returns 0 if before first marker.
|
|
6150
|
+
*/
|
|
6151
|
+
private _findCurrentMarkerIndex;
|
|
6152
|
+
private _emitMarkerJump;
|
|
6153
|
+
}
|
|
6154
|
+
//#endregion
|
|
6013
6155
|
//#region src/timelineproviders/position-sources/raf-position-source.d.ts
|
|
6014
6156
|
/**
|
|
6015
6157
|
* Configuration for RafPositionSource.
|
|
@@ -6888,5 +7030,5 @@ declare class EngineFactory implements IEngineFactory {
|
|
|
6888
7030
|
createTimelineProvidersForConfig(configuration: IResolvedEngineConfiguration): Record<TimelineTypes, ITimelineProviderInfo>;
|
|
6889
7031
|
}
|
|
6890
7032
|
//#endregion
|
|
6891
|
-
export { Action, ActionCreator, ActionCreatorFactory, ActionEditor, ActionRegistryEventbusListener, AllEvents, BasePositionSource, BeforeRequestTimelineUriEvent, CompleteEvent, ConfigurationFactory, ConfigurationResolver, ContainerRequestEvent, ControllerNamesProvider, Controllers, CurrentTimelineChangeEvent, DOMEventListenerController, DomContainerProvider, DomContainerProviderConfig, DomMutationEvent, DurationEvent, DurationRequestEvent, EligiusEngine, EligiusResourceImporter, EndableAction, EndableActionCreator, EndableActionEditor, EngineEventbusAdapter, EngineEvents, EngineFactory, EngineInputAdapter, EventHandler, type EventMap, type EventName, Eventbus, ExtractOperationData, ExtractOperationDataType, ExtractReturnedOperationData, FirstFrameEvent, GetControllerByName, GetOperationByName, IAction, IActionConfiguration, IAdapter, type IAddClassOperationData, type IAddControllerToElementOperationData, type IAnimateOperationData, type IAnimateWithClassOperationData, type IAnnounceToScreenReaderOperationData, type IBroadcastEventOperationData, type ICalcOperationData, type IClearElementOperationData, type IClearOperationDataOperationData, type IClearStorageOperationData, type ICompareDateOperationData, type IConcatenateStringsOperationData, IConfigurationResolver, IContainerProvider, IContainerProviderConfig, IController, IControllerMetadata, type ICreateElementOperationData, type ICustomFunctionOperationData, type IDOMEventListenerControllerOperationData, IDimensions, IDuration, IEligiusEngine, type IEndActionOperationData, IEndableAction, IEndableActionConfiguration, IEngineConfiguration, IEngineFactory, IEngineFactoryOptions, IEngineFactoryResult, IEngineInfo, IEventActionConfiguration, IEventMetadata, IEventbus, IEventbusInterceptor, IEventbusListener, type IExtendControllerOperationData, type IFilterArrayOperationData, type IFindInArrayOperationData, type IForEachOperationData, type IFormatDateOperationData, type IFormatTextOperationData, type IGetAttributesFromElementOperationData, type IGetControllerFromElementOperationData, type IGetControllerInstanceOperationData, type IGetCurrentTimeOperationData, type IGetElementDimensionsOperationData, type IGetFocusedElementOperationData, type IGetFormDataOperationData, type IGetImportOperationData, type IGetQueryParamsOperationData, type IGetScrollPositionOperationData, type IGetTextContentOperationData, type IHttpDeleteOperationData, type IHttpPostOperationData, type IHttpPutOperationData, type IInvokeObjectMethodOperationData, type IIsElementInViewportOperationData, ILabel, type ILabelControllerMetadata, ILanguageLabel, ILanguageManager, type ILoadFromStorageOperationData, type ILoadJSONOperationData, type ILogOperationData, type ILottieControllerMetadata, type IMapArrayOperationData, type IMathOperationData, type IMutationEventPayload, type IMutationObserverControllerMetadata, type INavigationControllerOperationData, IOperationConfiguration, IOperationMetadata, IOperationScope, IPlaylist, IPlaylistConfig, IPositionSource, IPositionSourceConfig, type IProgressbarControllerOperationData, type IRemoveClassOperationData, type IRemoveControllerFromElementOperationData, type IRemoveElementOperationData, type IRemovePropertiesFromOperationDataOperationData, type IReparentElementOperationData, type IReplaceStringOperationData, type IReplaceTextOperationData, type IRequestActionOperationData, IResolvedActionConfiguration, IResolvedEndableActionConfiguration, IResolvedEngineConfiguration, IResolvedOperation, IResolvedTimelineConfiguration, IResourceImporter, type IRoutingControllerOperationData, type ISaveToStorageOperationData, type IScrollToElementOperationData, type IScrollToPositionOperationData, ISeekable, type ISelectElementOperationData, type ISetDataOperationData, type ISetElementAttributesOperationData, type ISetElementContentOperationData, type ISetFocusOperationData, type ISetFormValueOperationData, type ISetGlobalDataOperationData, type ISetOperationData, type ISetStyleOperationData, type ISetVariableOperationData, ISimpleResourceImporter, type ISortArrayOperationData, type ISplitStringOperationData, type IStartActionOperationData, IStrictDuration, type ISubstringTextOperationData, ISubtitle, ISubtitleCollection, type ISubtitlesControllerOperationData, ITimelineAction, ITimelineActionConfiguration, ITimelineConfiguration, ITimelineFlow, ITimelineProviderInfo, ITimelineProviderSettings, type IToggleClassOperationData, type IToggleElementOperationData, type IToggleFormElementOperationData, ITypedEventEmitter, type IValidateFormOperationData, type IWaitOperationData, type IWhenOperationData, KeysOfType, LabelController, LanguageChangeEvent, LanguageEventbusAdapter, LanguageEvents, LanguageManager, LottieController, MutationObserverController, NavigationController, OperationEditor, OperationMetadataProvider, OperationNamesProvider, Operations, PauseEvent, PauseRequestEvent, PlayEvent, PlayRequestEvent, PlayToggleRequestEvent, ProgressbarController, RafPositionSource, RafPositionSourceConfig, RequestActionEvent, RequestCurrentLanguageEvent, RequestCurrentTimelineEvent, RequestCurrentTimelinePositionEvent, RequestEngineRootEvent, RequestFunctionEvent, RequestInstanceEvent, RequestLabelCollectionEvent, RequestLabelCollectionsEvent, RequestTimelineCleanupEvent, RequestTimelineUriEvent, RequestVideoUriInterceptor, RequireKeys, ResizeEvent, ResizeRequestEvent, RestartEvent, RoutingController, ScrollPositionSource, ScrollPositionSourceConfig, SeekEvent, SeekRequestEvent, SeekedEvent, SimplePlaylist, SimplePlaylistConfig, StopEvent, StopRequestEvent, type StorageType, SubtitleEditor, SubtitleImporter, SubtitlesController, TArrayProperyMetadata, TBoundary, TComplexPropertyMetadata, TConstantParametersTypes, TControllerName, TControllerType, TEngineConfigurationLists, TEventHandler, TEventbusRemover, THasDescription, THasErased, THasRequired, TLanguageCode, TOperation, TOperationCategory, TOperationData, TOperationName, TOperationResult, TOperationType, TParameterTypes, TParameterTypesDelimited, TPropertiesMetadata, TPropertyMetadata, TRequestResponder, TResultCallback, TSourceState, TTimelineProviderSettings,
|
|
7033
|
+
export { Action, ActionCreator, ActionCreatorFactory, ActionEditor, ActionRegistryEventbusListener, AllEvents, BasePositionSource, BeforeRequestTimelineUriEvent, CompleteEvent, ConfigurationFactory, ConfigurationResolver, ContainerRequestEvent, ControllerNamesProvider, Controllers, CurrentTimelineChangeEvent, DOMEventListenerController, DomContainerProvider, DomContainerProviderConfig, DomMutationEvent, DurationEvent, DurationRequestEvent, EligiusEngine, EligiusResourceImporter, EndableAction, EndableActionCreator, EndableActionEditor, EngineEventbusAdapter, EngineEvents, EngineFactory, EngineInputAdapter, EventHandler, type EventMap, type EventName, Eventbus, ExtractOperationData, ExtractOperationDataType, ExtractReturnedOperationData, FirstFrameEvent, GetControllerByName, GetOperationByName, IAction, IActionConfiguration, IAdapter, type IAddClassOperationData, type IAddControllerToElementOperationData, type IAnimateOperationData, type IAnimateWithClassOperationData, type IAnnounceToScreenReaderOperationData, type IBroadcastEventOperationData, type ICalcOperationData, type IClearElementOperationData, type IClearOperationDataOperationData, type IClearStorageOperationData, type ICompareDateOperationData, type IConcatenateStringsOperationData, IConfigurationResolver, IContainerProvider, IContainerProviderConfig, IController, IControllerMetadata, type ICreateElementOperationData, type ICustomFunctionOperationData, type IDOMEventListenerControllerOperationData, IDimensions, IDuration, IEligiusEngine, type IEndActionOperationData, IEndableAction, IEndableActionConfiguration, IEngineConfiguration, IEngineFactory, IEngineFactoryOptions, IEngineFactoryResult, IEngineInfo, IEventActionConfiguration, IEventMetadata, IEventbus, IEventbusInterceptor, IEventbusListener, type IExtendControllerOperationData, type IFilterArrayOperationData, type IFindInArrayOperationData, type IForEachOperationData, type IFormatDateOperationData, type IFormatTextOperationData, type IGetAttributesFromElementOperationData, type IGetControllerFromElementOperationData, type IGetControllerInstanceOperationData, type IGetCurrentTimeOperationData, type IGetElementDimensionsOperationData, type IGetFocusedElementOperationData, type IGetFormDataOperationData, type IGetImportOperationData, type IGetQueryParamsOperationData, type IGetScrollPositionOperationData, type IGetTextContentOperationData, type IHttpDeleteOperationData, type IHttpPostOperationData, type IHttpPutOperationData, type IInvokeObjectMethodOperationData, type IIsElementInViewportOperationData, ILabel, type ILabelControllerMetadata, ILanguageLabel, ILanguageManager, type ILoadFromStorageOperationData, type ILoadJSONOperationData, type ILogOperationData, type ILottieControllerMetadata, type IMapArrayOperationData, type IMathOperationData, type IMutationEventPayload, type IMutationObserverControllerMetadata, type INavigationControllerOperationData, IOperationConfiguration, IOperationMetadata, IOperationScope, IPlaylist, IPlaylistConfig, IPositionSource, IPositionSourceConfig, type IProgressbarControllerOperationData, type IRemoveClassOperationData, type IRemoveControllerFromElementOperationData, type IRemoveElementOperationData, type IRemovePropertiesFromOperationDataOperationData, type IReparentElementOperationData, type IReplaceStringOperationData, type IReplaceTextOperationData, type IRequestActionOperationData, IResolvedActionConfiguration, IResolvedEndableActionConfiguration, IResolvedEngineConfiguration, IResolvedOperation, IResolvedTimelineConfiguration, IResourceImporter, type IRoutingControllerOperationData, type ISaveToStorageOperationData, type IScrollToElementOperationData, type IScrollToPositionOperationData, ISeekable, type ISelectElementOperationData, type ISetDataOperationData, type ISetElementAttributesOperationData, type ISetElementContentOperationData, type ISetFocusOperationData, type ISetFormValueOperationData, type ISetGlobalDataOperationData, type ISetOperationData, type ISetStyleOperationData, type ISetVariableOperationData, ISimpleResourceImporter, type ISortArrayOperationData, type ISplitStringOperationData, type IStartActionOperationData, IStrictDuration, type ISubstringTextOperationData, ISubtitle, ISubtitleCollection, type ISubtitlesControllerOperationData, ITimelineAction, ITimelineActionConfiguration, ITimelineConfiguration, ITimelineFlow, ITimelineProviderInfo, ITimelineProviderSettings, type IToggleClassOperationData, type IToggleElementOperationData, type IToggleFormElementOperationData, ITypedEventEmitter, type IValidateFormOperationData, type IWaitOperationData, type IWhenOperationData, KeyboardStepSource, KeyboardStepSourceConfig, KeysOfType, LabelController, LanguageChangeEvent, LanguageEventbusAdapter, LanguageEvents, LanguageManager, LottieController, MutationObserverController, NavigationController, OperationEditor, OperationMetadataProvider, OperationNamesProvider, Operations, PauseEvent, PauseRequestEvent, PlayEvent, PlayRequestEvent, PlayToggleRequestEvent, ProgressbarController, RafPositionSource, RafPositionSourceConfig, RequestActionEvent, RequestCurrentLanguageEvent, RequestCurrentTimelineEvent, RequestCurrentTimelinePositionEvent, RequestEngineRootEvent, RequestFunctionEvent, RequestInstanceEvent, RequestLabelCollectionEvent, RequestLabelCollectionsEvent, RequestTimelineCleanupEvent, RequestTimelineUriEvent, RequestVideoUriInterceptor, RequireKeys, ResizeEvent, ResizeRequestEvent, RestartEvent, RoutingController, ScrollPositionSource, ScrollPositionSourceConfig, SeekEvent, SeekRequestEvent, SeekedEvent, SimplePlaylist, SimplePlaylistConfig, StopEvent, StopRequestEvent, type StorageType, SubtitleEditor, SubtitleImporter, SubtitlesController, TArrayProperyMetadata, TBoundary, TComplexPropertyMetadata, TConstantParametersTypes, TControllerName, TControllerType, TEngineConfigurationLists, TEventHandler, TEventbusRemover, THasDescription, THasErased, THasRequired, TLanguageCode, TOperation, TOperationCategory, TOperationData, TOperationName, TOperationResult, TOperationType, TParameterTypes, TParameterTypesDelimited, TPropertiesMetadata, TPropertyMetadata, TRequestResponder, TResultCallback, TSourceState, TTimelineProviderSettings, TVerticalMode, TimeEvent, TimelineAction, TimelineActionCreator, TimelineActionEditor, TimelineProviderSettingsEditor, TimelineProvidersSettingsEditor, TimelineTypes, TypedEventEmitter, VideoPositionSource, VideoPositionSourceConfig, VideoSource, addClass, addControllerToElement, addGlobalsToOperation, animate, animateWithClass, announceToScreenReader, breakForEach, broadcastEvent, calc, clearElement, clearOperationData, clearStorage, compareDate, concatenateStrings, continueForEach, createElement, index_d_exports as ctrlmetadata, customFunction, endAction, endForEach, endWhen, index_d_exports$1 as eventmetadata, extendController, filterArray, findInArray, forEach, formatDate, formatText, getAttributesFromElement, getControllerFromElement, getControllerInstance, getCurrentTime, getElementDimensions, getFocusedElement, getFormData, getImport, getQueryParams, getScrollPosition, getTextContent, httpDelete, httpPost, httpPut, invokeObjectMethod, isElementInViewport, isSeekable, loadFromStorage, loadJson, log, mapArray, math, index_d_exports$2 as metadata, otherwise, removeClass, removeControllerFromElement, removeElement, removePropertiesFromOperationData, reparentElement, replaceString, replaceText, requestAction, saveToStorage, scrollToElement, scrollToPosition, selectElement, setData, setElementAttributes, setElementContent, setFocus, setFormValue, setGlobalData, setOperationData, setStyle, setVariable, sortArray, splitString, startAction, substringText, toggleClass, toggleElement, toggleFormElement, validateForm, wait, when };
|
|
6892
7034
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -546,7 +546,7 @@ var EngineEventbusAdapter = class {
|
|
|
546
546
|
|
|
547
547
|
//#endregion
|
|
548
548
|
//#region src/adapters/engine-input-adapter.ts
|
|
549
|
-
const hotkeys = hk.default || hk;
|
|
549
|
+
const hotkeys$1 = hk.default || hk;
|
|
550
550
|
/**
|
|
551
551
|
* Handles external input sources (hotkeys, resize).
|
|
552
552
|
*
|
|
@@ -583,8 +583,8 @@ var EngineInputAdapter = class {
|
|
|
583
583
|
}
|
|
584
584
|
_registerHotkeys() {
|
|
585
585
|
const handleSpaceBound = this._handleSpacePress.bind(this);
|
|
586
|
-
hotkeys("space", handleSpaceBound);
|
|
587
|
-
this._removers.push(() => hotkeys.unbind("space", handleSpaceBound));
|
|
586
|
+
hotkeys$1("space", handleSpaceBound);
|
|
587
|
+
this._removers.push(() => hotkeys$1.unbind("space", handleSpaceBound));
|
|
588
588
|
}
|
|
589
589
|
_handleSpacePress(keyboardEvent, _hotkeysEvent) {
|
|
590
590
|
keyboardEvent.preventDefault();
|
|
@@ -6943,51 +6943,6 @@ var OperationMetadataProvider = class {
|
|
|
6943
6943
|
return getMetadata();
|
|
6944
6944
|
}
|
|
6945
6945
|
};
|
|
6946
|
-
/**
|
|
6947
|
-
*
|
|
6948
|
-
* Provider for all the available event names
|
|
6949
|
-
*
|
|
6950
|
-
*/
|
|
6951
|
-
var TimeLineEventNamesProvider = class {
|
|
6952
|
-
getEventNames() {
|
|
6953
|
-
return [
|
|
6954
|
-
"timeline-play-toggle-request",
|
|
6955
|
-
"timeline-play-request",
|
|
6956
|
-
"timeline-stop-request",
|
|
6957
|
-
"timeline-pause-request",
|
|
6958
|
-
"timeline-seek-request",
|
|
6959
|
-
"timeline-resize-request",
|
|
6960
|
-
"timeline-container-request",
|
|
6961
|
-
"timeline-duration-request",
|
|
6962
|
-
"timeline-request-current-timeline",
|
|
6963
|
-
"timeline-duration",
|
|
6964
|
-
"timeline-time",
|
|
6965
|
-
"timeline-seeked",
|
|
6966
|
-
"timeline-complete",
|
|
6967
|
-
"timeline-restart",
|
|
6968
|
-
"timeline-play",
|
|
6969
|
-
"timeline-stop",
|
|
6970
|
-
"timeline-pause",
|
|
6971
|
-
"timeline-seek",
|
|
6972
|
-
"timeline-resize",
|
|
6973
|
-
"timeline-current-timeline-change",
|
|
6974
|
-
"timeline-firstframe",
|
|
6975
|
-
"request-instance",
|
|
6976
|
-
"request-action",
|
|
6977
|
-
"request-function",
|
|
6978
|
-
"request-timeline-uri",
|
|
6979
|
-
"before-request-timeline-uri",
|
|
6980
|
-
"request-engine-root",
|
|
6981
|
-
"request-current-timeline-position",
|
|
6982
|
-
"request-timeline-cleanup",
|
|
6983
|
-
"request-label-collection",
|
|
6984
|
-
"request-label-collections",
|
|
6985
|
-
"request-current-language",
|
|
6986
|
-
"language-change",
|
|
6987
|
-
"dom-mutation"
|
|
6988
|
-
];
|
|
6989
|
-
}
|
|
6990
|
-
};
|
|
6991
6946
|
|
|
6992
6947
|
//#endregion
|
|
6993
6948
|
//#region src/configuration/api/subtitle-converter.ts
|
|
@@ -8358,6 +8313,285 @@ var BasePositionSource = class {
|
|
|
8358
8313
|
}
|
|
8359
8314
|
};
|
|
8360
8315
|
|
|
8316
|
+
//#endregion
|
|
8317
|
+
//#region src/timelineproviders/position-sources/keyboard-step-source.ts
|
|
8318
|
+
const hotkeys = hk.default || hk;
|
|
8319
|
+
/**
|
|
8320
|
+
* Key bindings used by KeyboardStepSource.
|
|
8321
|
+
*/
|
|
8322
|
+
const KEY_BINDINGS = {
|
|
8323
|
+
stepForward: "right",
|
|
8324
|
+
stepBackward: "left",
|
|
8325
|
+
largeStepForward: "shift+right",
|
|
8326
|
+
largeStepBackward: "shift+left",
|
|
8327
|
+
jumpToStart: "home",
|
|
8328
|
+
jumpToEnd: "end",
|
|
8329
|
+
verticalPrev: "up",
|
|
8330
|
+
verticalNext: "down"
|
|
8331
|
+
};
|
|
8332
|
+
/**
|
|
8333
|
+
* Keyboard-based position source for stepping through a timeline.
|
|
8334
|
+
*
|
|
8335
|
+
* Supports:
|
|
8336
|
+
* - Left/Right arrows: step by `stepSize` (default 1s)
|
|
8337
|
+
* - Shift+Left/Right: large step by `largeStepSize` (default 10s)
|
|
8338
|
+
* - Home/End: jump to start/end
|
|
8339
|
+
* - Up/Down: configurable (timeline switch, chapter navigation, or disabled)
|
|
8340
|
+
*
|
|
8341
|
+
* @example
|
|
8342
|
+
* ```typescript
|
|
8343
|
+
* const source = new KeyboardStepSource({
|
|
8344
|
+
* duration: 60,
|
|
8345
|
+
* verticalMode: 'chapter-navigation',
|
|
8346
|
+
* markers: [0, 10, 20, 30, 40, 50],
|
|
8347
|
+
* });
|
|
8348
|
+
*
|
|
8349
|
+
* await source.init();
|
|
8350
|
+
*
|
|
8351
|
+
* source.onPosition((position) => {
|
|
8352
|
+
* console.log(`Position: ${position}s`);
|
|
8353
|
+
* });
|
|
8354
|
+
*
|
|
8355
|
+
* source.onMarkerJump((index, position) => {
|
|
8356
|
+
* console.log(`Jumped to marker ${index} at ${position}s`);
|
|
8357
|
+
* });
|
|
8358
|
+
*
|
|
8359
|
+
* await source.activate();
|
|
8360
|
+
* ```
|
|
8361
|
+
*/
|
|
8362
|
+
var KeyboardStepSource = class extends BasePositionSource {
|
|
8363
|
+
_stepSize;
|
|
8364
|
+
_largeStepSize;
|
|
8365
|
+
_verticalMode;
|
|
8366
|
+
_wrapNavigation;
|
|
8367
|
+
_markers;
|
|
8368
|
+
_targetElementConfig;
|
|
8369
|
+
_targetElement;
|
|
8370
|
+
_scopeId;
|
|
8371
|
+
_timelineChangeCallbacks = [];
|
|
8372
|
+
_markerJumpCallbacks = [];
|
|
8373
|
+
/**
|
|
8374
|
+
* Create a new keyboard-based position source.
|
|
8375
|
+
*
|
|
8376
|
+
* @param config - Configuration options
|
|
8377
|
+
*/
|
|
8378
|
+
constructor(config) {
|
|
8379
|
+
super(config.duration);
|
|
8380
|
+
this._stepSize = config.stepSize ?? 1;
|
|
8381
|
+
this._largeStepSize = config.largeStepSize ?? 10;
|
|
8382
|
+
this._verticalMode = config.verticalMode;
|
|
8383
|
+
this._wrapNavigation = config.wrapNavigation ?? true;
|
|
8384
|
+
this._markers = config.markers ? [...config.markers] : [];
|
|
8385
|
+
this._targetElementConfig = config.targetElement;
|
|
8386
|
+
this._scopeId = `keyboard-step-source-${v4()}`;
|
|
8387
|
+
}
|
|
8388
|
+
doInit() {
|
|
8389
|
+
this._markers.sort((a, b) => a - b);
|
|
8390
|
+
if (typeof this._targetElementConfig === "string") {
|
|
8391
|
+
const element = document.querySelector(this._targetElementConfig);
|
|
8392
|
+
if (element instanceof HTMLElement) this._targetElement = element;
|
|
8393
|
+
} else if (this._targetElementConfig instanceof HTMLElement) this._targetElement = this._targetElementConfig;
|
|
8394
|
+
return Promise.resolve();
|
|
8395
|
+
}
|
|
8396
|
+
doDestroy() {
|
|
8397
|
+
this._unbindKeys();
|
|
8398
|
+
}
|
|
8399
|
+
startTicking() {
|
|
8400
|
+
this._bindKeys();
|
|
8401
|
+
}
|
|
8402
|
+
stopTicking() {
|
|
8403
|
+
this._unbindKeys();
|
|
8404
|
+
}
|
|
8405
|
+
/**
|
|
8406
|
+
* Seek to a specific position.
|
|
8407
|
+
*
|
|
8408
|
+
* Position is clamped to the valid range [0, duration].
|
|
8409
|
+
*
|
|
8410
|
+
* @param position - Target position in seconds
|
|
8411
|
+
* @returns Actual position after seek (may be clamped)
|
|
8412
|
+
*/
|
|
8413
|
+
async seek(position) {
|
|
8414
|
+
const clampedPosition = Math.max(0, Math.min(position, this.getDuration()));
|
|
8415
|
+
this.setPosition(clampedPosition);
|
|
8416
|
+
return clampedPosition;
|
|
8417
|
+
}
|
|
8418
|
+
/**
|
|
8419
|
+
* Register callback for timeline change requests (timeline-switch mode).
|
|
8420
|
+
*
|
|
8421
|
+
* @param callback - Called with 'prev' or 'next' when Up/Down is pressed
|
|
8422
|
+
*/
|
|
8423
|
+
onTimelineChangeRequest(callback) {
|
|
8424
|
+
this._timelineChangeCallbacks.push(callback);
|
|
8425
|
+
}
|
|
8426
|
+
/**
|
|
8427
|
+
* Register callback for marker jumps (chapter-navigation mode).
|
|
8428
|
+
*
|
|
8429
|
+
* @param callback - Called with marker index and position when jumping
|
|
8430
|
+
*/
|
|
8431
|
+
onMarkerJump(callback) {
|
|
8432
|
+
this._markerJumpCallbacks.push(callback);
|
|
8433
|
+
}
|
|
8434
|
+
/**
|
|
8435
|
+
* Bind all keyboard handlers.
|
|
8436
|
+
*/
|
|
8437
|
+
_bindKeys() {
|
|
8438
|
+
const options = { scope: this._scopeId };
|
|
8439
|
+
if (this._targetElement) options.element = this._targetElement;
|
|
8440
|
+
hotkeys.setScope(this._scopeId);
|
|
8441
|
+
hotkeys(KEY_BINDINGS.stepForward, options, (event) => {
|
|
8442
|
+
event.preventDefault();
|
|
8443
|
+
this._handleStepForward();
|
|
8444
|
+
});
|
|
8445
|
+
hotkeys(KEY_BINDINGS.stepBackward, options, (event) => {
|
|
8446
|
+
event.preventDefault();
|
|
8447
|
+
this._handleStepBackward();
|
|
8448
|
+
});
|
|
8449
|
+
hotkeys(KEY_BINDINGS.largeStepForward, options, (event) => {
|
|
8450
|
+
event.preventDefault();
|
|
8451
|
+
this._handleLargeStepForward();
|
|
8452
|
+
});
|
|
8453
|
+
hotkeys(KEY_BINDINGS.largeStepBackward, options, (event) => {
|
|
8454
|
+
event.preventDefault();
|
|
8455
|
+
this._handleLargeStepBackward();
|
|
8456
|
+
});
|
|
8457
|
+
hotkeys(KEY_BINDINGS.jumpToStart, options, (event) => {
|
|
8458
|
+
event.preventDefault();
|
|
8459
|
+
this._handleJumpToStart();
|
|
8460
|
+
});
|
|
8461
|
+
hotkeys(KEY_BINDINGS.jumpToEnd, options, (event) => {
|
|
8462
|
+
event.preventDefault();
|
|
8463
|
+
this._handleJumpToEnd();
|
|
8464
|
+
});
|
|
8465
|
+
if (this._verticalMode !== "disabled") {
|
|
8466
|
+
hotkeys(KEY_BINDINGS.verticalPrev, options, (event) => {
|
|
8467
|
+
event.preventDefault();
|
|
8468
|
+
this._handleVerticalPrev();
|
|
8469
|
+
});
|
|
8470
|
+
hotkeys(KEY_BINDINGS.verticalNext, options, (event) => {
|
|
8471
|
+
event.preventDefault();
|
|
8472
|
+
this._handleVerticalNext();
|
|
8473
|
+
});
|
|
8474
|
+
}
|
|
8475
|
+
}
|
|
8476
|
+
/**
|
|
8477
|
+
* Unbind all keyboard handlers.
|
|
8478
|
+
*/
|
|
8479
|
+
_unbindKeys() {
|
|
8480
|
+
hotkeys.deleteScope(this._scopeId);
|
|
8481
|
+
}
|
|
8482
|
+
_handleStepForward() {
|
|
8483
|
+
const currentPosition = this.getPosition();
|
|
8484
|
+
const duration = this.getDuration();
|
|
8485
|
+
let newPosition = currentPosition + this._stepSize;
|
|
8486
|
+
if (newPosition > duration) {
|
|
8487
|
+
if (this._wrapNavigation) {
|
|
8488
|
+
newPosition = 0;
|
|
8489
|
+
this.setPosition(newPosition);
|
|
8490
|
+
this.emitBoundary("start");
|
|
8491
|
+
}
|
|
8492
|
+
} else this.setPosition(newPosition);
|
|
8493
|
+
}
|
|
8494
|
+
_handleStepBackward() {
|
|
8495
|
+
const currentPosition = this.getPosition();
|
|
8496
|
+
const duration = this.getDuration();
|
|
8497
|
+
let newPosition = currentPosition - this._stepSize;
|
|
8498
|
+
if (newPosition < 0) {
|
|
8499
|
+
if (this._wrapNavigation) {
|
|
8500
|
+
newPosition = duration;
|
|
8501
|
+
this.setPosition(newPosition);
|
|
8502
|
+
this.emitBoundary("end");
|
|
8503
|
+
}
|
|
8504
|
+
} else this.setPosition(newPosition);
|
|
8505
|
+
}
|
|
8506
|
+
_handleLargeStepForward() {
|
|
8507
|
+
const currentPosition = this.getPosition();
|
|
8508
|
+
const duration = this.getDuration();
|
|
8509
|
+
let newPosition = currentPosition + this._largeStepSize;
|
|
8510
|
+
if (newPosition > duration) if (this._wrapNavigation) {
|
|
8511
|
+
newPosition = 0;
|
|
8512
|
+
this.setPosition(newPosition);
|
|
8513
|
+
this.emitBoundary("start");
|
|
8514
|
+
} else {
|
|
8515
|
+
newPosition = duration;
|
|
8516
|
+
this.setPosition(newPosition);
|
|
8517
|
+
}
|
|
8518
|
+
else this.setPosition(newPosition);
|
|
8519
|
+
}
|
|
8520
|
+
_handleLargeStepBackward() {
|
|
8521
|
+
const currentPosition = this.getPosition();
|
|
8522
|
+
const duration = this.getDuration();
|
|
8523
|
+
let newPosition = currentPosition - this._largeStepSize;
|
|
8524
|
+
if (newPosition < 0) if (this._wrapNavigation) {
|
|
8525
|
+
newPosition = duration;
|
|
8526
|
+
this.setPosition(newPosition);
|
|
8527
|
+
this.emitBoundary("end");
|
|
8528
|
+
} else {
|
|
8529
|
+
newPosition = 0;
|
|
8530
|
+
this.setPosition(newPosition);
|
|
8531
|
+
}
|
|
8532
|
+
else this.setPosition(newPosition);
|
|
8533
|
+
}
|
|
8534
|
+
_handleJumpToStart() {
|
|
8535
|
+
this.setPosition(0);
|
|
8536
|
+
this.emitBoundary("start");
|
|
8537
|
+
}
|
|
8538
|
+
_handleJumpToEnd() {
|
|
8539
|
+
this.setPosition(this.getDuration());
|
|
8540
|
+
this.emitBoundary("end");
|
|
8541
|
+
}
|
|
8542
|
+
_handleVerticalPrev() {
|
|
8543
|
+
if (this._verticalMode === "timeline-switch") this._emitTimelineChange("prev");
|
|
8544
|
+
else if (this._verticalMode === "chapter-navigation") this._jumpToPreviousMarker();
|
|
8545
|
+
}
|
|
8546
|
+
_handleVerticalNext() {
|
|
8547
|
+
if (this._verticalMode === "timeline-switch") this._emitTimelineChange("next");
|
|
8548
|
+
else if (this._verticalMode === "chapter-navigation") this._jumpToNextMarker();
|
|
8549
|
+
}
|
|
8550
|
+
_emitTimelineChange(direction) {
|
|
8551
|
+
for (const callback of this._timelineChangeCallbacks) callback(direction);
|
|
8552
|
+
}
|
|
8553
|
+
_jumpToPreviousMarker() {
|
|
8554
|
+
if (this._markers.length === 0) return;
|
|
8555
|
+
const currentPosition = this.getPosition();
|
|
8556
|
+
const currentMarkerIndex = this._findCurrentMarkerIndex(currentPosition);
|
|
8557
|
+
let targetIndex;
|
|
8558
|
+
if (this._markers[currentMarkerIndex] === currentPosition) if (currentMarkerIndex <= 0) if (this._wrapNavigation) targetIndex = this._markers.length - 1;
|
|
8559
|
+
else return;
|
|
8560
|
+
else targetIndex = currentMarkerIndex - 1;
|
|
8561
|
+
else targetIndex = currentMarkerIndex;
|
|
8562
|
+
const targetPosition = this._markers[targetIndex];
|
|
8563
|
+
this.setPosition(targetPosition);
|
|
8564
|
+
this._emitMarkerJump(targetIndex, targetPosition);
|
|
8565
|
+
}
|
|
8566
|
+
_jumpToNextMarker() {
|
|
8567
|
+
if (this._markers.length === 0) return;
|
|
8568
|
+
const currentPosition = this.getPosition();
|
|
8569
|
+
const currentMarkerIndex = this._findCurrentMarkerIndex(currentPosition);
|
|
8570
|
+
let targetIndex;
|
|
8571
|
+
if (currentMarkerIndex >= this._markers.length - 1) if (this._wrapNavigation) targetIndex = 0;
|
|
8572
|
+
else return;
|
|
8573
|
+
else targetIndex = currentMarkerIndex + 1;
|
|
8574
|
+
const targetPosition = this._markers[targetIndex];
|
|
8575
|
+
this.setPosition(targetPosition);
|
|
8576
|
+
this._emitMarkerJump(targetIndex, targetPosition);
|
|
8577
|
+
}
|
|
8578
|
+
/**
|
|
8579
|
+
* Find the index of the current or previous marker.
|
|
8580
|
+
*
|
|
8581
|
+
* If position matches a marker exactly, returns that marker's index.
|
|
8582
|
+
* Otherwise, returns the index of the marker before the current position.
|
|
8583
|
+
* Returns 0 if before first marker.
|
|
8584
|
+
*/
|
|
8585
|
+
_findCurrentMarkerIndex(position) {
|
|
8586
|
+
if (this._markers.length === 0) return -1;
|
|
8587
|
+
for (let i = this._markers.length - 1; i >= 0; i--) if (position >= this._markers[i]) return i;
|
|
8588
|
+
return 0;
|
|
8589
|
+
}
|
|
8590
|
+
_emitMarkerJump(markerIndex, position) {
|
|
8591
|
+
for (const callback of this._markerJumpCallbacks) callback(markerIndex, position);
|
|
8592
|
+
}
|
|
8593
|
+
};
|
|
8594
|
+
|
|
8361
8595
|
//#endregion
|
|
8362
8596
|
//#region src/util/animation-interval.ts
|
|
8363
8597
|
function animationInterval(ms, signal, callback) {
|
|
@@ -9005,6 +9239,7 @@ var SimplePlaylist = class {
|
|
|
9005
9239
|
var timelineproviders_exports = /* @__PURE__ */ __export({
|
|
9006
9240
|
BasePositionSource: () => BasePositionSource,
|
|
9007
9241
|
DomContainerProvider: () => DomContainerProvider,
|
|
9242
|
+
KeyboardStepSource: () => KeyboardStepSource,
|
|
9008
9243
|
RafPositionSource: () => RafPositionSource,
|
|
9009
9244
|
ScrollPositionSource: () => ScrollPositionSource,
|
|
9010
9245
|
SimplePlaylist: () => SimplePlaylist,
|
|
@@ -9847,5 +10082,5 @@ var EngineFactory = class {
|
|
|
9847
10082
|
};
|
|
9848
10083
|
|
|
9849
10084
|
//#endregion
|
|
9850
|
-
export { Action, ActionCreator, ActionCreatorFactory, ActionEditor, ActionRegistryEventbusListener, BasePositionSource, ConfigurationFactory, ConfigurationResolver, ControllerNamesProvider, DOMEventListenerController, DomContainerProvider, EligiusEngine, EligiusResourceImporter, EndableAction, EndableActionCreator, EndableActionEditor, EngineEventbusAdapter, EngineFactory, EngineInputAdapter, Eventbus, LabelController, LanguageEventbusAdapter, LanguageManager, LottieController, MutationObserverController, NavigationController, OperationEditor, OperationMetadataProvider, OperationNamesProvider, ProgressbarController, RafPositionSource, RequestVideoUriInterceptor, RoutingController, ScrollPositionSource, SimplePlaylist, SubtitleEditor, SubtitleImporter, SubtitlesController,
|
|
10085
|
+
export { Action, ActionCreator, ActionCreatorFactory, ActionEditor, ActionRegistryEventbusListener, BasePositionSource, ConfigurationFactory, ConfigurationResolver, ControllerNamesProvider, DOMEventListenerController, DomContainerProvider, EligiusEngine, EligiusResourceImporter, EndableAction, EndableActionCreator, EndableActionEditor, EngineEventbusAdapter, EngineFactory, EngineInputAdapter, Eventbus, KeyboardStepSource, LabelController, LanguageEventbusAdapter, LanguageManager, LottieController, MutationObserverController, NavigationController, OperationEditor, OperationMetadataProvider, OperationNamesProvider, ProgressbarController, RafPositionSource, RequestVideoUriInterceptor, RoutingController, ScrollPositionSource, SimplePlaylist, SubtitleEditor, SubtitleImporter, SubtitlesController, TimelineAction, TimelineActionCreator, TimelineActionEditor, TimelineProviderSettingsEditor, TimelineProvidersSettingsEditor, TypedEventEmitter, VideoPositionSource, addClass, addControllerToElement, addGlobalsToOperation, animate, animateWithClass, announceToScreenReader, breakForEach, broadcastEvent, calc, clearElement, clearOperationData, clearStorage, compareDate, concatenateStrings, continueForEach, createElement, metadata_exports as ctrlmetadata, customFunction, endAction, endForEach, endWhen, metadata_exports$1 as eventmetadata, extendController, filterArray, findInArray, forEach, formatDate, formatText, getAttributesFromElement, getControllerFromElement, getControllerInstance, getCurrentTime, getElementDimensions, getFocusedElement, getFormData, getImport, getQueryParams, getScrollPosition, getTextContent, httpDelete, httpPost, httpPut, invokeObjectMethod, isElementInViewport, isSeekable, loadFromStorage, loadJson, log, mapArray, math, metadata_exports$2 as metadata, otherwise, removeClass, removeControllerFromElement, removeElement, removePropertiesFromOperationData, reparentElement, replaceString, replaceText, requestAction, saveToStorage, scrollToElement, scrollToPosition, selectElement, setData, setElementAttributes, setElementContent, setFocus, setFormValue, setGlobalData, setOperationData, setStyle, setVariable, sortArray, splitString, startAction, substringText, toggleClass, toggleElement, toggleFormElement, validateForm, wait, when };
|
|
9851
10086
|
//# sourceMappingURL=index.mjs.map
|