Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 91 unnecessary resizing #92

Merged
merged 8 commits into from
Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8,122 changes: 5,136 additions & 2,986 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"dependencies": {
"@bbc/aes31-adl-composer": "^1.0.1",
"@bbc/digital-paper-edit-react-components": "^1.2.13",
"@bbc/digital-paper-edit-react-components": "^1.3.2",
"@bbc/fcpx-xml-composer": "^1.0.0",
"@bbc/react-transcript-editor": "^1.4.0",
"@fortawesome/fontawesome-svg-core": "^1.2.15",
Expand All @@ -21,16 +21,15 @@
"express": "^4.17.1",
"node-sass": "^4.13.0",
"randomcolor": "^0.5.4",
"react": "^16.10.2",
"react-bootstrap": "^1.0.0-beta.14",
"react-color": "^2.17.1",
"react-dom": "^16.10.2",
"react-fetch-progressbar": "^1.0.0",
"react-router-bootstrap": "^0.24.4",
"react-router-dom": "^5.1.2",
"react-scripts": "3.0.1",
"react-scripts": "^3.3.0",
"react-select": "^2.4.3",
"react-sortable-hoc": "^1.9.1",
"react-transcript-editor": "^1.3.1-alpha.3",
"videocontext": "^0.53.1"
},
"author": "Pietro Passarelli CC0 BBC 2019",
Expand Down Expand Up @@ -77,6 +76,8 @@
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^2.1.2",
"gh-pages": "^2.0.1",
"react": "^16.12.0",
"react-router-dom": "^5.1.2",
"speculate": "^2.0.0"
},
"spec": {
Expand Down
5 changes: 4 additions & 1 deletion src/Components/PaperEditor/ProgrammeScript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ class ProgrammeScript extends Component {
}

updateVideoContextWidth = () => {
const maxScreenSizeForResponsivness = 350;
const newOffset = this.card.offsetWidth - 10;
const newOffsetAdjustedForLargeScreen = newOffset >= maxScreenSizeForResponsivness? maxScreenSizeForResponsivness : newOffset;
this.setState({
width: this.card.offsetWidth - 10
width:newOffsetAdjustedForLargeScreen
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
import { shortTimecode } from '@bbc/react-transcript-editor/timecodeConverter';
import { shortTimecode } from 'react-transcript-editor/timecodeConverter';
import styles from './index.module.css';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* TODO: remove this and export from @bbc/react-transcript-editor digital-paper-edit STT import draftJs converter
* TODO: remove this and export from react-transcript-editor digital-paper-edit STT import draftJs converter

edge cases
- more segments then words - not an issue if you start by matching words with segment
Expand Down
3 changes: 3 additions & 0 deletions src/Components/PaperEditor/Transcripts/Transcript.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ class Transcript extends Component {
onTimeUpdate={ (e) => {this.setState({ currentTime: e.target.currentTime });} }
style={ {
width: '100%',
height: '200px',
backgroundColor: 'black'
} }
controls/>
Expand All @@ -347,7 +348,9 @@ class Transcript extends Component {
ref={ this.videoRef }
onTimeUpdate={ (e) => {this.setState({ currentTime: e.target.currentTime });} }
style={ {
marginTop: '0',
width: '100%',
height: '200px',
backgroundColor: 'black'
} }
controls/>
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Workspace/Transcripts/TranscriptEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ class TranscriptEditor extends Component {
alert('save to server');

// TODO: decide how to deal with transcript corrections
// exporting digitalpaperedit in @bbc/react-transcript-editor@latest doesn't give you
// exporting digitalpaperedit in react-transcript-editor@latest doesn't give you
// corrected text with timecodes, only "original" uncorrected text even if transcript might
// have been corrected, because of outstandin PR in bbc/react-transcript-editor
// have been corrected, because of outstandin PR in react-transcript-editor
// https://github.com/bbc/react-transcript-editor/pull/144
// which should be addressed after https://github.com/bbc/react-transcript-editor/pull/160
//
Expand Down
7 changes: 4 additions & 3 deletions src/Util/which-js-env/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
* @returns - 'browser', 'electron', 'cep'. where cep stands for adobe CEP panel
*/
function whichJsEnv() {
if (window.process.versions.electron !== undefined) {
return 'electron';
}
// Is browser Eg client side app or locally testing (Node)
if (
window.process === undefined ||
Expand All @@ -18,6 +15,10 @@ function whichJsEnv() {
return 'browser';
}

if (window.process.versions.electron !== undefined) {
return 'electron';
}

if (window.process.versions.cep !== undefined) {
// console.debug('In Adobe CEP Environment');
// console.info('In Chromium v: ', window.process.versions.chromium);
Expand Down