mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-18 20:12:12 +00:00
fix(InfoPanelContainer): Use new attributed text prop
+ And update other related nodes.
This commit is contained in:
@@ -3,6 +3,7 @@ import { Parser, type RawNode } from '../index.js';
|
||||
import InfoPanelContent from './InfoPanelContent.js';
|
||||
import Menu from './menus/Menu.js';
|
||||
import Text from './misc/Text.js';
|
||||
import NavigationEndpoint from './NavigationEndpoint.js';
|
||||
|
||||
export default class InfoPanelContainer extends YTNode {
|
||||
static type = 'InfoPanelContainer';
|
||||
@@ -10,7 +11,9 @@ export default class InfoPanelContainer extends YTNode {
|
||||
title: Text;
|
||||
menu: Menu | null;
|
||||
content: InfoPanelContent | null;
|
||||
header_endpoint?: NavigationEndpoint;
|
||||
background: string;
|
||||
title_style?: string;
|
||||
icon_type?: string;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
@@ -18,7 +21,12 @@ export default class InfoPanelContainer extends YTNode {
|
||||
this.title = new Text(data.title);
|
||||
this.menu = Parser.parseItem(data.menu, Menu);
|
||||
this.content = Parser.parseItem(data.content, InfoPanelContent);
|
||||
|
||||
if (data.headerEndpoint)
|
||||
this.header_endpoint = new NavigationEndpoint(data.headerEndpoint);
|
||||
|
||||
this.background = data.background;
|
||||
this.title_style = data.titleStyle;
|
||||
|
||||
if (Reflect.has(data, 'icon')) {
|
||||
this.icon_type = data.icon?.iconType;
|
||||
|
||||
Reference in New Issue
Block a user