Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(FEC-13371): fix TS types CSS export issue #829

Merged
merged 44 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
499376f
upgrade webpack deps and the coorsponding conf
Nov 13, 2023
bede944
all dirs exept componebts
Nov 14, 2023
66f131c
add scss suppurt and some components
Nov 15, 2023
3eebe4b
40% fix event classes dups
Nov 16, 2023
320bc54
icon
Nov 16, 2023
7c052bf
live tag and ineractive
Nov 16, 2023
ce21961
more comps
Nov 19, 2023
603052a
seekbar comps
Nov 20, 2023
ce54073
coms complete
Nov 20, 2023
c8e0619
index to ts
Nov 20, 2023
2736a8c
complete
Nov 21, 2023
cd8010b
remove redundent alias webpack
Nov 21, 2023
5a6dab4
state types
Nov 22, 2023
5e32b45
fix webpakc - react settings
Nov 22, 2023
12a7965
fix tests
Nov 26, 2023
52f7a4c
lint + types generate + ci cd
Nov 27, 2023
4f0ea77
reomve api extractor files
Nov 27, 2023
80923c9
add them to gitignore
Nov 27, 2023
bb00741
Merge remote-tracking branch 'origin/master' into FEC-13371
Nov 27, 2023
bd858b3
fix lint
Nov 27, 2023
526f824
ci cd concurrency improvement
Nov 27, 2023
fdef0da
fix invalid yaml
Nov 27, 2023
d0f2309
fix
Dec 11, 2023
9631096
webpack preact
Dec 11, 2023
96248ed
fix jsx error - missing config & and fix style broken error - missing…
Dec 12, 2023
5df9bac
fix
Dec 19, 2023
8434acd
update yarn and set webpack
Dec 19, 2023
96f1e56
Merge branch 'master' into FEC-13371
Dec 19, 2023
00c3cb3
fix merge master
Dec 19, 2023
cff480e
fix css sourc map
Dec 20, 2023
5439799
Review
Dec 21, 2023
fa5f236
fix types
Dec 24, 2023
c4e8cf0
Addressing Sivan comments & add browserlist
Dec 26, 2023
67ec818
upgrade playkit to the latest canary, and use temp local .tgz file fo…
Dec 27, 2023
6e771d1
fix
Dec 27, 2023
8d56eb8
fix
Dec 27, 2023
5afd46b
fix
Dec 27, 2023
476e3a1
fix
Dec 27, 2023
f04965e
fix
Dec 27, 2023
0e46c5f
fix
Dec 27, 2023
e20dcd3
fix(FEC-13371): fix TS types CSS export issue
Dec 28, 2023
50ba8a8
Merge remote-tracking branch 'origin/master' into FEC-13371
Dec 28, 2023
baef7a9
fix template
Dec 28, 2023
d8497ca
fix temlate
Dec 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Please add a detailed description of the change, whether it's an enhancement or a bugfix.
If the PR is related to an open issue please link to it.

### CheckLists
**Issue:**

**Fix:**

#### Resolves FEC-[Please add the ticket reference here]


- [ ] changes have been done against master branch, and PR does not conflict
- [ ] new unit / functional tests have been added (whenever applicable)
- [ ] test are passing in local environment
- [ ] Travis tests are passing (or test results are not worse than on master branch :))
- [ ] Docs have been updated
301 changes: 154 additions & 147 deletions kaltura-player-js.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { TrackType } from '@playkit-js/playkit-js';
import { TrackTypes } from '@playkit-js/playkit-js';
import * as ui from '@playkit-js/playkit-js-ui';
import { UIEventType } from '@playkit-js/playkit-js-ui';
import { UIOptionsObject } from '@playkit-js/playkit-js-ui';

/**
* @class Ad
Expand Down Expand Up @@ -1130,7 +1131,7 @@ export declare type DeferredPromise = {
* @property {number} isDRMSupported - Specifies DRM supported option by the browser
* @property {Array<string>} supportedDRMs - List of supported DRMs (optional values: widevine; playready; fairplay)
*/
declare type DRMSupportedObject = {
export declare type DRMSupportedObject = {
isDRMSupported: number;
supportedDRMs: Array<string>;
};
Expand Down Expand Up @@ -1159,7 +1160,7 @@ export declare function getPlayers(): Record<string, KalturaPlayer>;
* @property {number} bitrate - Optional number of bits used to encode a second of video
* @property {number} framerate - Optional number of frames used in one second
*/
declare type HEVCConfigObject = {
export declare type HEVCConfigObject = {
width?: number;
height?: number;
bitrate?: number;
Expand All @@ -1171,7 +1172,7 @@ declare type HEVCConfigObject = {
* @property {number} isHEVCSupported - Specifies HEVC supported option by the browser
* @property {number} isPowerEfficient - Specifies power efficiency supported option
*/
declare type HEVCSupportedObject = {
export declare type HEVCSupportedObject = {
isHEVCSupported: number;
isPowerEfficient: number;
};
Expand Down Expand Up @@ -1949,7 +1950,7 @@ export declare type KPThumbnailConfig = {
};

export declare interface KPUIAddComponent extends KPUIComponentOptions {
get: () => any;
get: (() => any) | string;
props?: {};
}

Expand Down Expand Up @@ -1995,7 +1996,7 @@ export declare interface LogConfig {
/**
* @typedef {Object} MediaCapabilitiesObject
*/
declare type MediaCapabilitiesObject = HEVCSupportedObject & DRMSupportedObject;
export declare type MediaCapabilitiesObject = HEVCSupportedObject & DRMSupportedObject;

export declare interface MediaSourceOptionsObject {
forceRedirectExternalStreams: boolean;
Expand Down Expand Up @@ -2744,146 +2745,152 @@ export declare interface SourcesConfig extends Omit<ProviderMediaConfigSourcesOb
poster?: string;
}

declare class _TargetObserveredBinding {
lastVisible: boolean;
lastIntersectionRatio: number;
threshold: number;
listener: ListenerType;
constructor(threshold: number, listener: ListenerType);
}

declare class TextStyleConverter {
static toCastTextStyle(playerTextStyle: TextStyle): any;
static toPlayerTextStyle(castTextStyle: any): TextStyle;
static rgbToHex(rgb: Array<number>): string;
static hexToRGB(hex: string): [number, number, number];
}

export { ui }

export declare interface UiConfig {
disable?: boolean;
css?: string;
customPreset?: {
template: () => any;
condition: () => any;
}[];
targetId: string;
}

declare class UIPreset {
}

/**
* The logger of the UIWrapper class.
* @private
* @const
*/
declare class UIWrapper {
private static _logger;
private _uiManager;
private readonly _disabled;
private _player;
constructor(player: KalturaPlayer, options: KalturaPlayerConfig);
destroy(): void;
reset(): void;
setConfig(config: any, componentAlias?: string): void;
/**
* Add a component dynamically
*
* @param {KPUIAddComponent} component - The component to add
* @returns {Function} - Removal function
*/
addComponent(component: KPUIAddComponent): () => void;
/**
* Remove a component dynamically
*
* @param {KPUIRemoveComponent} component - The component to remove
* @returns {Function} - Undo removal function
*/
removeComponent(component: KPUIRemoveComponent): () => void;
get store(): any;
/**
* Deprecated - left for backward compatibility - use instead registerService in KalturaPlayer
* @param {string} name - the manager name
* @param {Object} manager - the manager object
* @returns {void}
*/
registerManager(name: string, manager: any): void;
/**
* Deprecated - left for backward compatibility - use instead getService in KalturaPlayer
* @param {string} name - the manager name
* @returns {Object} - the manager object
*/
getManager(name: string): any | void;
/**
* Deprecated - left for backward compatibility - use instead hasService in KalturaPlayer
* @param {string} name - the manager name
* @returns {boolean} - if the manager exist
*/
hasManager(name: string): boolean;
setLoadingSpinnerState(show: boolean): void;
private _resetErrorState;
private _handleExternalCSS;
private _handleVr;
private _setStereoConfig;
}

export declare const VERSION: string;

export declare interface ViewabilityConfig {
observedThresholds: Array<number>;
playerThreshold: number;
}

/**
* A service class to observe viewability of elements in the view port.
*/
declare class ViewabilityManager {
private readonly _observer;
private _targetsObserved;
private _config;
private _eventManager;
private _visibilityTabChangeEventName;
private _visibilityTabHiddenAttr;
/**
* Whether the player browser tab is active or not
* @type {boolean}
* @private
*/
private _isTabVisible;
/**
* @param {number} viewabilityConfig - the configuration needed to create the manager
* @constructor
*/
constructor(viewabilityConfig?: ViewabilityConfig);
private _intersectionChangedHandler;
private _handleTabVisibilityChange;
private _initTabVisibility;
/**
* @param {HTMLElement} target - the targeted element to check its visibility
* @param {Function} listener - the callback to be invoked when visibility is changed (and when starting to observe). The callback is called with a boolean param representing the visibility state
* @param {?number} optionalThreshold - a number between 0 to 100 that represents the minimum visible percentage considered as visible
* @returns {void}
*/
observe(target: HTMLElement, listener: ListenerType, optionalThreshold?: number): void;
/**
* Remove the listener from the target
* @param {HTMLElement} target - the targeted element to remove the listener
* @param {Function} listener - the callback function to be removed
* @returns {void}
*/
unObserve(target: HTMLElement, listener: _TargetObserveredBinding): void;
/**
* cleans all memory allocations.
* @override
*/
destroy(): void;
}

declare const ViewabilityType: {
readonly VIEWPORT: "viewport";
readonly TAB: "tab";
};

export { }
* @typedef {Object.<string; number>} SupportedOptionsType
*/
export declare type SupportedOptionsType = {
[supportedOption: string]: number;
};

declare class _TargetObserveredBinding {
lastVisible: boolean;
lastIntersectionRatio: number;
threshold: number;
listener: ListenerType;
constructor(threshold: number, listener: ListenerType);
}

declare class TextStyleConverter {
static toCastTextStyle(playerTextStyle: TextStyle): any;
static toPlayerTextStyle(castTextStyle: any): TextStyle;
static rgbToHex(rgb: Array<number>): string;
static hexToRGB(hex: string): [number, number, number];
}

export { ui }

export declare interface UiConfig extends UIOptionsObject {
disable?: boolean;
css?: string;
customPreset?: {
template: () => any;
condition: () => any;
}[];
}

declare class UIPreset {
}

/**
* The logger of the UIWrapper class.
* @private
* @const
*/
declare class UIWrapper {
private static _logger;
private _uiManager;
private readonly _disabled;
private _player;
constructor(player: KalturaPlayer, options: KalturaPlayerConfig);
destroy(): void;
reset(): void;
setConfig(config: any, componentAlias?: string): void;
/**
* Add a component dynamically
*
* @param {KPUIAddComponent} component - The component to add
* @returns {Function} - Removal function
*/
addComponent(component: KPUIAddComponent): () => void;
/**
* Remove a component dynamically
*
* @param {KPUIRemoveComponent} component - The component to remove
* @returns {Function} - Undo removal function
*/
removeComponent(component: KPUIRemoveComponent): () => void;
get store(): any;
/**
* Deprecated - left for backward compatibility - use instead registerService in KalturaPlayer
* @param {string} name - the manager name
* @param {Object} manager - the manager object
* @returns {void}
*/
registerManager(name: string, manager: any): void;
/**
* Deprecated - left for backward compatibility - use instead getService in KalturaPlayer
* @param {string} name - the manager name
* @returns {Object} - the manager object
*/
getManager(name: string): any | void;
/**
* Deprecated - left for backward compatibility - use instead hasService in KalturaPlayer
* @param {string} name - the manager name
* @returns {boolean} - if the manager exist
*/
hasManager(name: string): boolean;
setLoadingSpinnerState(show: boolean): void;
private _resetErrorState;
private _handleExternalCSS;
private _handleVr;
private _setStereoConfig;
}

export declare const VERSION: string;

export declare interface ViewabilityConfig {
observedThresholds: Array<number>;
playerThreshold: number;
}

/**
* A service class to observe viewability of elements in the view port.
*/
declare class ViewabilityManager {
private readonly _observer;
private _targetsObserved;
private _config;
private _eventManager;
private _visibilityTabChangeEventName;
private _visibilityTabHiddenAttr;
/**
* Whether the player browser tab is active or not
* @type {boolean}
* @private
*/
private _isTabVisible;
/**
* @param {number} viewabilityConfig - the configuration needed to create the manager
* @constructor
*/
constructor(viewabilityConfig?: ViewabilityConfig);
private _intersectionChangedHandler;
private _handleTabVisibilityChange;
private _initTabVisibility;
/**
* @param {HTMLElement} target - the targeted element to check its visibility
* @param {Function} listener - the callback to be invoked when visibility is changed (and when starting to observe). The callback is called with a boolean param representing the visibility state
* @param {?number} optionalThreshold - a number between 0 to 100 that represents the minimum visible percentage considered as visible
* @returns {void}
*/
observe(target: HTMLElement, listener: ListenerType, optionalThreshold?: number): void;
/**
* Remove the listener from the target
* @param {HTMLElement} target - the targeted element to remove the listener
* @param {Function} listener - the callback function to be removed
* @returns {void}
*/
unObserve(target: HTMLElement, listener: _TargetObserveredBinding): void;
/**
* cleans all memory allocations.
* @override
*/
destroy(): void;
}

declare const ViewabilityType: {
readonly VIEWPORT: "viewport";
readonly TAB: "tab";
};

export { }
5 changes: 4 additions & 1 deletion src/components/keyboard/keyboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const UNHANDLED_KEYBOARD_EVENT_RESULT: KeyboardEventResult = {preventDefault: fa
@withPlayer
@withLogger(COMPONENT_NAME)
@withEventDispatcher(COMPONENT_NAME)
//@ts-ignore
class Keyboard extends Component<any, any> {
_lastActiveTextLanguage: string = '';
_hoverTimeout: number | null = null;
Expand Down Expand Up @@ -287,6 +286,10 @@ class Keyboard extends Component<any, any> {
return {preventDefault: true, payload: null};
}
};

render(): undefined {
return undefined;
}
}

export {Keyboard};
2 changes: 1 addition & 1 deletion src/components/player-area/player-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class PlayerArea extends Component<any, any> {
return null;
}

return h(uiComponent.get, uiComponent.props!);
return h(uiComponent.get as () => any, uiComponent.props!);
}

/**
Expand Down
Loading