@playkit-js/transcript 3.5.21-canary.0-cf3ec21 → 3.5.21-canary.0-5b355b8

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.21-canary.0-cf3ec21",
3
+ "version": "3.5.21-canary.0-5b355b8",
4
4
  "main": "dist/playkit-transcript.js",
5
5
  "license": "AGPL-3.0",
6
6
  "private": false,
@@ -1,14 +1,18 @@
1
1
  @import '~@playkit-js/playkit-js-ui';
2
+ @import '../../variables.scss';
2
3
 
3
4
  .attach-placeholder-container {
4
5
  position: absolute;
5
- top: 50%;
6
- left: 50%;
7
- transform: translate(-50%, -50%);
6
+ width: 100%;
7
+ height: 100%;
8
+ top: 0;
9
+ left: 0;
8
10
  display: flex;
9
11
  flex-direction: column;
10
12
  justify-content: center;
11
13
  align-items: center;
14
+ background: $plugin-background;
15
+
12
16
  .attach-text {
13
17
  line-height: 20px;
14
18
  font-weight: 700;
@@ -12,10 +12,11 @@
12
12
  height: 100%;
13
13
  width: 100%;
14
14
  position: absolute;
15
- background: rgba(0, 0, 0, 0.6);
15
+ background: $plugin-background;
16
16
  backdrop-filter: blur(8px);
17
17
  -webkit-backdrop-filter: blur(8px);
18
18
  z-index: 1;
19
+ cursor: default;
19
20
  .skip-transcript-button {
20
21
  position: absolute;
21
22
  top: -1000px;
@@ -64,6 +64,7 @@ export interface TranscriptProps {
64
64
  onDetach: () => void;
65
65
  onAttach: () => void;
66
66
  kitchenSinkDetached: boolean;
67
+ isMobile?: boolean;
67
68
  }
68
69
 
69
70
  interface TranscriptState {
@@ -88,7 +89,8 @@ const SEARCHBAR_HEIGHT = 38; // height of search bar with margins
88
89
  const smallScreen = PLAYER_BREAK_POINTS?.SMALL || 480;
89
90
 
90
91
  const mapStateToProps = (state: any, ownProps: Pick<TranscriptProps, 'expandMode'>) => ({
91
- smallScreen: ownProps.expandMode === SidePanelModes.ALONGSIDE && state.shell.playerClientRect?.width < smallScreen
92
+ smallScreen: ownProps.expandMode === SidePanelModes.ALONGSIDE && state.shell.playerClientRect?.width < smallScreen,
93
+ isMobile: state.shell.isMobile
92
94
  });
93
95
 
94
96
  // @ts-ignore
@@ -157,6 +159,25 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
157
159
  );
158
160
  };
159
161
 
162
+ private _renderDetachButton = () => {
163
+ const {onAttach, onDetach, attachTranscript, detachTranscript, kitchenSinkDetached, isMobile} = this.props;
164
+ if (isMobile) {
165
+ return null;
166
+ }
167
+ return (
168
+ <div data-testid="transcriptDetachAttachButton">
169
+ <Button
170
+ type={ButtonType.borderless}
171
+ size={ButtonSize.medium}
172
+ onClick={kitchenSinkDetached ? onAttach : onDetach}
173
+ icon={kitchenSinkDetached ? 'attach' : 'detach'}
174
+ ariaLabel={kitchenSinkDetached ? attachTranscript : detachTranscript}
175
+ tooltip={{label: kitchenSinkDetached ? attachTranscript! : detachTranscript!}}
176
+ />
177
+ </div>
178
+ );
179
+ };
180
+
160
181
  private _onSearch = (search: string) => {
161
182
  this.setState({search});
162
183
  };
@@ -217,20 +238,7 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
217
238
  };
218
239
 
219
240
  private _renderHeader = () => {
220
- const {
221
- toggledWithEnter,
222
- kitchenSinkActive,
223
- kitchenSinkDetached,
224
- downloadDisabled,
225
- onDownload,
226
- printDisabled,
227
- onPrint,
228
- isLoading,
229
- onAttach,
230
- onDetach,
231
- attachTranscript,
232
- detachTranscript
233
- } = this.props;
241
+ const {toggledWithEnter, kitchenSinkActive, kitchenSinkDetached, downloadDisabled, onDownload, printDisabled, onPrint, isLoading} = this.props;
234
242
  const {search, activeSearchIndex, totalSearchResults} = this.state;
235
243
  return (
236
244
  <div className={[styles.header, this._getHeaderStyles()].join(' ')} data-testid="transcript_header">
@@ -244,16 +252,7 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
244
252
  kitchenSinkActive={kitchenSinkActive}
245
253
  />
246
254
  <TranscriptMenu {...{downloadDisabled, onDownload, printDisabled, onPrint, isLoading}} />
247
- <div data-testid="transcriptDetachAttachButton">
248
- <Button
249
- type={ButtonType.borderless}
250
- size={ButtonSize.medium}
251
- onClick={kitchenSinkDetached ? onAttach : onDetach}
252
- icon={kitchenSinkDetached ? 'attach' : 'detach'}
253
- ariaLabel={kitchenSinkDetached ? attachTranscript : detachTranscript}
254
- tooltip={{label: kitchenSinkDetached ? attachTranscript! : detachTranscript!}}
255
- />
256
- </div>
255
+ {this._renderDetachButton()}
257
256
  {!kitchenSinkDetached && (
258
257
  <div data-testid="transcriptCloseButton">
259
258
  <Button
@@ -429,7 +428,7 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
429
428
  this._widgetRootRef = node;
430
429
  }}
431
430
  data-testid="transcript_root">
432
- {smallScreen ? (
431
+ {smallScreen && !kitchenSinkDetached ? (
433
432
  <SmallScreenSlate onClose={this.props.onClose} toggledWithEnter={toggledWithEnter} />
434
433
  ) : (
435
434
  <div className={styles.globalContainer}>
@@ -4,6 +4,8 @@
4
4
  $roundness-1: 4px;
5
5
  $roundness-3: 16px;
6
6
 
7
+ $plugin-background: rgba(0, 0, 0, 0.6);
8
+
7
9
  @mixin plugin-scrollbar {
8
10
  &::-webkit-scrollbar {
9
11
  width: 4px;