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-12735): Player v7| More plugins| Plugins inside the more plugins are not accessible #16

Merged
merged 2 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion demo/uppar-bar-manager/plugin-A.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const ICON_PATH = 'M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.12

class IconComponent extends preact.Component {
render() {
return h('div', { className: 'icon' + ' ' + ui.style.upperBarIcon }, 'A');
return h('div', { className: 'icon' + ' ' + ui.style.upperBarIcon, tabIndex: 0 }, 'A');
}
}

Expand Down
2 changes: 1 addition & 1 deletion demo/uppar-bar-manager/plugin-B.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const ICON_PATH = 'M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.12

class IconComponent extends preact.Component {
render() {
return h('div', { className: 'icon' + ' ' + ui.style.upperBarIcon }, 'B');
return h('div', { className: 'icon' + ' ' + ui.style.upperBarIcon, tabIndex: 0 }, 'B');
}
}

Expand Down
2 changes: 1 addition & 1 deletion demo/uppar-bar-manager/plugin-C.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const ICON_PATH = 'M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.12

class IconComponent extends preact.Component {
render() {
return h('div', { className: 'icon' + ' ' + ui.style.upperBarIcon }, 'C');
return h('div', { className: 'icon' + ' ' + ui.style.upperBarIcon, tabIndex: 0 }, 'C');
}
}

Expand Down
2 changes: 1 addition & 1 deletion demo/uppar-bar-manager/plugin-D.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const ICON_PATH = 'M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.12

class IconComponent extends preact.Component {
render() {
return h('div', { className: 'icon' + ' ' + ui.style.upperBarIcon }, 'D');
return h('div', { className: 'icon' + ' ' + ui.style.upperBarIcon, tabIndex: 0 }, 'D');
}
}

Expand Down
2 changes: 1 addition & 1 deletion demo/uppar-bar-manager/plugin-E.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const ICON_PATH = 'M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.12

class IconComponent extends preact.Component {
render() {
return h('div', { className: 'icon' + ' ' + ui.style.upperBarIcon }, 'E');
return h('div', { className: 'icon' + ' ' + ui.style.upperBarIcon, tabIndex: 0 }, 'E');
}
}

Expand Down
2 changes: 1 addition & 1 deletion demo/uppar-bar-manager/plugin-F.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const ICON_PATH = 'M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.12

class IconComponent extends preact.Component {
render() {
return h('div', { className: 'icon' + ' ' + ui.style.upperBarIcon }, 'F');
return h('div', { className: 'icon' + ' ' + ui.style.upperBarIcon, tabIndex: 0 }, 'F');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,31 @@ import * as styles from './dropdown-bar.component.scss';
import { IconModel } from '../../models/icon-model';
import { ui } from 'kaltura-player-js';
const { Icon } = ui.Components;
const { KeyMap } = ui.utils;

type DropdownBarProps = {
controls: IconModel[];
};

export class DropdownBar extends Component<DropdownBarProps> {
private handleOnKeyDown(event: KeyboardEvent, onClick: () => void): void {
if (event.keyCode === KeyMap.ENTER || event.keyCode === KeyMap.SPACE) {
event.preventDefault();
onClick();
}
}
render(): ComponentChild {
return (
<div className={styles.moreDropdown}>
{this.props.controls.map(({ id, label, svgIcon, onClick }, index) => {
return (
<div key={id} className={styles.dropdownItem} onClick={onClick} tabIndex={0}>
<div
key={id}
className={styles.dropdownItem}
onClick={onClick}
tabIndex={0}
onKeyDown={(event): void => this.handleOnKeyDown(event, onClick)}
>
<div className={styles.icon}>
<Icon id={`icon${index}`} path={svgIcon.path} viewBox={svgIcon.viewBox} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { pluginName } from '../../../../ui-managers';
const { Icon, Tooltip } = ui.Components;
const { withEventManager } = ui.Event;
const { withText } = ui.preacti18n;
const { KeyMap } = ui.utils;
const ICON_PATH =
// eslint-disable-next-line max-len
'M16 22a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 2a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm0-11a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 2a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm0-11a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 2a1 1 0 1 0 0 2 1 1 0 0 0 0-2z';
Expand Down Expand Up @@ -49,9 +50,9 @@ export class MoreIcon extends Component<MoreIconProps, MoreIconState> {
}

private handleOnKeyDown(event: KeyboardEvent): void {
if (event.key === 'Enter') {
if (event.keyCode === KeyMap.ENTER || event.keyCode === KeyMap.SPACE) {
event.preventDefault();
this.setState({ toggle: true });
this.setState((prevState) => ({ toggle: !prevState.toggle }));
}
}

Expand Down