@playkit-js/transcript 3.5.23-canary.0-f10827a → 3.5.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playkit-js/transcript",
3
- "version": "3.5.23-canary.0-f10827a",
3
+ "version": "3.5.23",
4
4
  "main": "dist/playkit-transcript.js",
5
5
  "license": "AGPL-3.0",
6
6
  "private": false,
@@ -77,7 +77,7 @@
77
77
  "html5 player"
78
78
  ],
79
79
  "dependencies": {
80
- "@playkit-js/common": "1.5.13",
80
+ "@playkit-js/common": "1.5.15-canary.0-e058c69",
81
81
  "sanitize-html": "^2.11.0",
82
82
  "stream-browserify": "^3.0.0"
83
83
  },
@@ -21,6 +21,7 @@ interface PopoverMenuProps {
21
21
  eventManager?: any;
22
22
  children?: VNode;
23
23
  items: Array<PopoverMenuItemData>;
24
+ kitchenSinkDetached: boolean;
24
25
  }
25
26
 
26
27
  interface PopoverMenuState {
@@ -86,18 +87,18 @@ class PopoverMenu extends Component<PopoverMenuProps, PopoverMenuState> {
86
87
  const isOpen = !this.state.isOpen;
87
88
 
88
89
  this.setState({isOpen}, () => {
89
- if (isOpen){
90
+ if (isOpen) {
90
91
  this._controlElementRef?.focus();
91
92
  this.props.eventManager?.listen(this._controlElementRef, 'keydown', (event: KeyboardEvent) => {
92
- if (event.keyCode === TAB){
93
+ if (event.keyCode === TAB) {
93
94
  const firstNonDisabledItem = this.props.items.findIndex((item: PopoverMenuItemData) => !item.isDisabled);
94
95
  if (firstNonDisabledItem !== -1) {
95
- this._getItemRef(firstNonDisabledItem -1)?.focus();
96
+ this._getItemRef(firstNonDisabledItem - 1)?.focus();
96
97
  }
97
98
  }
98
- })
99
+ });
99
100
  }
100
- })
101
+ });
101
102
  };
102
103
 
103
104
  private _getItemRef = (index: number) => {
@@ -109,14 +110,15 @@ class PopoverMenu extends Component<PopoverMenuProps, PopoverMenuState> {
109
110
  };
110
111
 
111
112
  render() {
112
- const {children, items} = this.props;
113
+ const {children, items, kitchenSinkDetached} = this.props;
113
114
 
114
115
  const popoverMenuContent = (
115
116
  <div className={styles.popoverContainer}>
116
- <A11yWrapper onClick={(e) => {
117
- e.stopPropagation();
118
- this.togglePopover();
119
- }}>
117
+ <A11yWrapper
118
+ onClick={e => {
119
+ e.stopPropagation();
120
+ this.togglePopover();
121
+ }}>
120
122
  <div
121
123
  aria-label={this.props.moreOptionsLabel!}
122
124
  tabIndex={0}
@@ -125,7 +127,7 @@ class PopoverMenu extends Component<PopoverMenuProps, PopoverMenuState> {
125
127
  aria-expanded={this.state.isOpen}
126
128
  aria-controls="popoverContent"
127
129
  ref={node => {
128
- if (node){
130
+ if (node) {
129
131
  this._controlElementRef = node;
130
132
  }
131
133
  }}>
@@ -186,7 +188,9 @@ class PopoverMenu extends Component<PopoverMenuProps, PopoverMenuState> {
186
188
  popoverMenuContent
187
189
  ) : (
188
190
  <div>
189
- <Tooltip label={this.props.moreOptionsLabel!}>{popoverMenuContent}</Tooltip>
191
+ <Tooltip label={this.props.moreOptionsLabel!} {...(kitchenSinkDetached ? {type: 'bottom-left', strictPosition: true} : {})}>
192
+ {popoverMenuContent}
193
+ </Tooltip>
190
194
  </div>
191
195
  );
192
196
  }
@@ -200,7 +200,10 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
200
200
  onClick={kitchenSinkDetached ? onAttach : onDetach}
201
201
  icon={kitchenSinkDetached ? 'attach' : 'detach'}
202
202
  ariaLabel={kitchenSinkDetached ? attachTranscript : detachTranscript}
203
- tooltip={{label: kitchenSinkDetached ? attachTranscript! : detachTranscript!}}
203
+ tooltip={{
204
+ label: kitchenSinkDetached ? attachTranscript! : detachTranscript!,
205
+ ...(kitchenSinkDetached ? {type: 'bottom-left', strictPosition: kitchenSinkDetached} : {})
206
+ }}
204
207
  />
205
208
  </div>
206
209
  );
@@ -303,7 +306,7 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
303
306
  toggledWithEnter={toggledWithEnter}
304
307
  kitchenSinkActive={kitchenSinkActive}
305
308
  />
306
- <TranscriptMenu {...{downloadDisabled, onDownload, printDisabled, onPrint, isLoading, detachMenuItem}} />
309
+ <TranscriptMenu {...{downloadDisabled, onDownload, printDisabled, onPrint, isLoading, detachMenuItem, kitchenSinkDetached}} />
307
310
  {!detachMenuItem && this._renderDetachButton()}
308
311
  {!kitchenSinkDetached && (
309
312
  <div data-testid="transcriptCloseButton">
@@ -13,6 +13,7 @@ interface TranscriptMenuProps {
13
13
  downloadDisabled?: boolean;
14
14
  printDisabled?: boolean;
15
15
  isLoading?: boolean;
16
+ kitchenSinkDetached: boolean;
16
17
  detachMenuItem?: {
17
18
  testId: string;
18
19
  label: string;
@@ -33,7 +34,17 @@ const translates = {
33
34
  @withText(translates)
34
35
  class TranscriptMenu extends Component<TranscriptMenuProps, TranscriptMenuState> {
35
36
  render() {
36
- const {downloadDisabled, onDownload, printDisabled, onPrint, printTranscript, downloadTranscript, isLoading, detachMenuItem} = this.props;
37
+ const {
38
+ downloadDisabled,
39
+ onDownload,
40
+ printDisabled,
41
+ onPrint,
42
+ printTranscript,
43
+ downloadTranscript,
44
+ isLoading,
45
+ detachMenuItem,
46
+ kitchenSinkDetached
47
+ } = this.props;
37
48
  const items = [];
38
49
 
39
50
  if (detachMenuItem) {
@@ -59,7 +70,7 @@ class TranscriptMenu extends Component<TranscriptMenuProps, TranscriptMenuState>
59
70
  }
60
71
 
61
72
  return items.length ? (
62
- <PopoverMenu items={items}>
73
+ <PopoverMenu items={items} kitchenSinkDetached={kitchenSinkDetached}>
63
74
  <Button type={ButtonType.borderless} icon={'more'} tabIndex={-1} />
64
75
  </PopoverMenu>
65
76
  ) : null;