@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/CHANGELOG.md +2 -2
- package/dist/playkit-transcript.js +1 -1
- package/dist/playkit-transcript.js.map +1 -1
- package/package.json +1 -1
- package/src/components/attach-placeholder/attach-placeholder.scss +7 -3
- package/src/components/transcript/transcript.scss +2 -1
- package/src/components/transcript/transcript.tsx +25 -26
- package/src/variables.scss +2 -0
package/package.json
CHANGED
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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:
|
|
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
|
-
|
|
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}>
|