-
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Channel): Support PageHeader being used on user channels (#577)
- Loading branch information
Showing
7 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { YTNode } from '../helpers.js'; | ||
import type { RawNode } from '../index.js'; | ||
import Text from './misc/Text.js'; | ||
|
||
export default class AttributionView extends YTNode { | ||
static type = 'AttributionView'; | ||
|
||
text: Text; | ||
suffix: Text; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
|
||
this.text = Text.fromAttributed(data.text); | ||
this.suffix = Text.fromAttributed(data.suffix); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { YTNode } from '../helpers.js'; | ||
import type { RawNode } from '../index.js'; | ||
import Text from './misc/Text.js'; | ||
|
||
export default class DescriptionPreviewView extends YTNode { | ||
static type = 'DescriptionPreviewView'; | ||
|
||
description: Text; | ||
max_lines: number; | ||
truncation_text: Text; | ||
always_show_truncation_text: boolean; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
|
||
this.description = Text.fromAttributed(data.description); | ||
this.max_lines = parseInt(data.maxLines); | ||
this.truncation_text = Text.fromAttributed(data.truncationText); | ||
this.always_show_truncation_text = !!data.alwaysShowTruncationText; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import { YTNode } from '../helpers.js'; | ||
import type { RawNode } from '../index.js'; | ||
import Text from './misc/Text.js'; | ||
|
||
export default class DynamicTextView extends YTNode { | ||
static type = 'DynamicTextView'; | ||
|
||
text: string; | ||
text: Text; | ||
max_lines: number; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.text = data.text.content; | ||
this.text = Text.fromAttributed(data.text); | ||
this.max_lines = parseInt(data.maxLines); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { YTNode } from '../helpers.js'; | ||
import { Parser, type RawNode } from '../index.js'; | ||
import Button from './Button.js'; | ||
import Text from './misc/Text.js'; | ||
|
||
export default class ModalWithTitleAndButton extends YTNode { | ||
static type = 'ModalWithTitleAndButton'; | ||
|
||
title: Text; | ||
content: Text; | ||
button: Button | null; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.title = new Text(data.title); | ||
this.content = new Text(data.content); | ||
this.button = Parser.parseItem(data.button, Button); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters