Skip to content

Merge bbc/react-transcript-editor@master in #2

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

Merged
merged 43 commits into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2fac517
moved ToolTip next to settings icon
Jan 3, 2019
8e365d1
layout change refactor
Jan 4, 2019
461d2bb
added option to hide and resize preview window in settings
Jan 4, 2019
cf9fbca
adjusted settings panel height
Jan 4, 2019
688cd28
initial setup for mobile responsive
Jan 4, 2019
9790671
Removed separate style file for video element
Jan 4, 2019
57458ec
made fast ward and rewind btn accessible with tab and enter
Jan 4, 2019
e9b3245
cleaned up some comments
Jan 4, 2019
69b1e24
reabsed with master
Feb 2, 2019
eb53feb
Merge branch 'help-box-spike' of github.com:bbc/react-transcript-edit…
Feb 2, 2019
89a06ad
Adding some css to player control
Feb 2, 2019
ee20146
adjusted Select
Feb 19, 2019
6e53d73
Merge branch 'master' into layout-change
pietrop Feb 19, 2019
2c6a9dd
UI Tweaks
Feb 19, 2019
4e10bbd
Merge branch 'layout-change' of github.com:bbc/react-transcript-edito…
Feb 19, 2019
9c05aae
Revert "UI Tweaks"
Feb 19, 2019
ccbe700
player control fix
Feb 19, 2019
8f45a2e
fixed unsuccesful merge
Feb 19, 2019
b4ab381
moved title outside of player control
Feb 19, 2019
37de921
Removed Volume
Feb 19, 2019
8af3b78
first pass at making it responsive
Feb 19, 2019
5233619
first pass at making speakers and timecodes responsive in Timed Text …
Feb 19, 2019
a4f0ee7
fixed CSS for ipad :crossed_fingers:
Feb 20, 2019
b42d1c2
responsive text in timed text editor for ipad and mobile view
Feb 20, 2019
9b1e659
cleared out filename title overlap + updated README
Feb 22, 2019
61f8d0c
mend
Feb 22, 2019
b37d1d5
various fixes
Mar 1, 2019
361012c
+ Changing layout styles (using CSS grid)
Mar 12, 2019
723a49e
+ More style changes.
Mar 13, 2019
da64b38
Browser compatibility fixes
Mar 14, 2019
cf1ff2c
Accessibility improvements
Mar 14, 2019
e6784ad
save readme
Mar 14, 2019
89b5d16
Multiple layout/CSS fixes
Mar 15, 2019
2ca41df
Fix: breakpoint tweaks
jamesdools Mar 15, 2019
a36cfa9
Fix: shortcuts panel width
jamesdools Mar 15, 2019
16ef569
Task: Add css-modules support to eslint, clean modules
jamesdools Mar 15, 2019
a48ada9
Feature: Added stylelintrc and cleaned css modules
jamesdools Mar 15, 2019
cb9c6e0
Feature: styling to design - Making progress bar sit between controls…
jamesdools Mar 18, 2019
f5661fd
Fix: hide keyboard shortcuts icon on mobile
jamesdools Mar 18, 2019
f2e3ddd
Fix: remove mozilla focus outline on range input
jamesdools Mar 18, 2019
442a7ad
Merge branch 'master' into layout-changes-accessibility-review
jamesdools Mar 18, 2019
ad9526f
Merge pull request #115 from bbc/layout-changes-accessibility-review
jamesdools Mar 18, 2019
7e1e3bd
Stt adapter aws transcribe - Gribbs (#120)
pietrop Mar 18, 2019
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
10 changes: 8 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
{
"parser": "babel-eslint",
"plugins": [
"react"
"react",
"css-modules"
],
"extends": [
"plugin:react/recommended"
"plugin:react/recommended",
"plugin:css-modules/recommended"
],
"env": {
"browser": true,
"jest": true
},
"rules": {
"no-unused-expressions": "error",
"no-trailing-spaces": "error",
"no-nested-ternary": "error",
"space-infix-ops": "error",
"indent": ["warn", 2],
"arrow-spacing": ["error", { "before": true, "after": true }],
"space-in-parens": [ 0, "never" ],
Expand Down Expand Up @@ -40,6 +45,7 @@
"camelcase": [ 1 ],
"no-underscore-dangle" : [0, "always"],
"keyword-spacing": ["error", { "before": true, "after": true }],
"key-spacing": ["error", { "afterColon": true }],
"newline-before-return": "error",
"space-before-blocks": "error",
"no-unused-vars": "error",
Expand Down
18 changes: 18 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "stylelint-config-standard",
"rules": {
"indentation": 2,
"string-quotes": "single",
"color-named": "always-where-possible",
"selector-combinator-space-after": "always",
"selector-attribute-quotes": "always",
"selector-attribute-operator-space-before": "always",
"selector-attribute-operator-space-after": "always",
"declaration-colon-space-before": "never",
"declaration-colon-space-after": "always",
"rule-empty-line-before": "always",
"media-feature-range-operator-space-before": "always",
"media-feature-range-operator-space-after": "always",
"media-feature-colon-space-after": "always"
}
}
54 changes: 26 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# React Transcript Editor

<!-- _One liner_ -->

A React component to make transcribing audio and video easier and faster.

[![install size](https://packagephobia.now.sh/badge?p=@bbc/react-transcript-editor)](https://packagephobia.now.sh/result?p=@bbc/react-transcript-editor)

The project uses [this github project board to organise and the co-ordinate development](https://github.com/bbc/react-transcript-editor/projects/1).

_--> Work in progress <--_
_--> Work in progress <--_

<!-- _Screenshot of UI - optional_ -->

Expand All @@ -24,13 +25,12 @@ Node version is set in node version manager [`.nvmrc`](https://github.com/creati

<!-- _Linting, github pre-push hook - optional_ -->


## Setup

<!-- _stack - optional_ -->
<!-- _How to build and run the code/app_ -->

Fork this repository + git clone + cd into folder
Fork this repository + git clone + cd into folder

## Usage - development

Expand All @@ -44,7 +44,6 @@ npm start

Visit [http://localhost:3000](http://localhost:3000)


## Usage - production

<!-- npm install react-transcript-editor -->
Expand All @@ -61,14 +60,18 @@ npm install @bbc/react-transcript-editor
```js
import { TranscriptEditor } from '@bbc/react-transcript-editor';

<TranscriptEditor
transcriptData=// Transcript json
mediaUrl=// string url to media file - audio or video
isEditable={true}// se to true if you want to be able to edit the text
sttJsonType={ 'bbckaldi' }// the type of STT Json transcript supported.
fileName={ this.state.fileName }// optional*
/>
<TranscriptEditor
transcriptData=// Transcript json
mediaUrl=// string url to media file - audio or video
isEditable={true}// se to true if you want to be able to edit the text
sttJsonType={ 'bbckaldi' }// the type of STT Json transcript supported.
handleAnalyticsEvents={ this.handleAnalyticsEvents } // optional - if you want to collect analytics events.
fileName=// optional - used for saving and retrieving local storage blob files
title=// optional - defaults to ''
ref= // optional - if you want to have access to internal functions such as retrieving content from the editor. eg to save to a server/db.
/>
```
See [`./src/index.js` demo](./src/index.js) as a more detailed example usage of the component.

_Note: `fileName` it is optional but it's needed if working with user uploaded local media in the browser, to be able to save and retrieve from local storage. For instance if you are passing a blob url to `mediaUrl` using `createObjectURL` this url is randomly re-generated on every page refresh so you wouldn't be able to restore a session, as `mediaUrl` is used as the local storage key. See demo app for more detail example of this[`./src/index.js`](./src/index.js)_

Expand All @@ -78,10 +81,9 @@ If using in a parent project where [typescript](https://www.typescriptlang.org/)

```js
//@ts-ignore
import {TranscriptEditor} from "@bbc/react-transcript-editor";
import { TranscriptEditor } from "@bbc/react-transcript-editor";
```


## System Architecture

<!-- _High level overview of system architecture_ -->
Expand All @@ -90,13 +92,13 @@ Uses [`create-component-lib`](https://www.npmjs.com/package/create-component-lib

This uses [Create React App 2.0](https://reactjs.org/blog/2018/10/01/create-react-app-v2.html) so we are using [CSS Modules](https://github.com/css-modules/css-modules) to contain the scope of the css for this component.

> Place everything you want to publish to npm inside `src/lib`.
> Place everything you want to publish to npm inside `src/lib`.

> Outside `src/lib` (but inside src/), you can create example web pages to test or demonstrate the usage of your components.

## Documentation
## Documentation

There's a [docs](./docs) folder in this repository.
There's a [docs](./docs) folder in this repository.

[docs/notes](./docs/notes) contains dev notes on various aspects of the project.

Expand All @@ -118,15 +120,14 @@ We are using [this template for ADR](https://gist.github.com/iaincollins/92923cc
npm run build:component
```

## Demo
## Demo

Demo can be viewed at [https://bbc.github.io/react-transcript-editor](https://bbc.github.io/react-transcript-editor)

<!-- https://github.com/gitname/react-gh-pages
<!-- https://github.com/gitname/react-gh-pages
-->


## Build - demo
## Build - demo

This github repository uses [github pages](https://pages.github.com/) to host a demo of the component, in [docs/demo](./docs/demo)

Expand All @@ -150,15 +151,15 @@ npm run build:example

Test coverage using [`jest`](https://jestjs.io/), to run tests

```
npm run test
```
```
npm run test
```

## Deployment

<!-- _How to deploy the code/app into test/staging/production_ -->

To push to [npm - `@bbc/react-transcript-editor`](https://www.npmjs.com/package/@bbc/react-transcript-editor)
To push to [npm - `@bbc/react-transcript-editor`](https://www.npmjs.com/package/@bbc/react-transcript-editor)

```
npm publish:public
Expand All @@ -168,17 +169,14 @@ This runs `npm run build:component` and `npm publish --access public` under the

> Note that only `README.md` and the `dist` folders are published to npm.


## Contributing
## Contributing

See [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines and [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) guidelines.


## Licence

See [LICENCE.md](./LICENCE.md)


## Legal Disclaimer

Despite using React and DraftJs, the BBC is not promoting any Facebook products or other commercial interest.
1 change: 1 addition & 0 deletions docs/features-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Import Transcript Json - Adapters
- [x] BBC Kaldi
- [x] News Labs API - BBC Kaldi
- [x] autoEdit 2
- [x] AWS Transcriber
- [ ] Gentle Transcription
- [ ] Gentle Alignment Json
- [ ] IBM Watson STT
Expand Down
4 changes: 3 additions & 1 deletion docs/guides/adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ checkout [a quick side note on how the DraftJS `block`, `entityRanges` and `enti
In your branch

- [ ] Create a folder with the name of the STT service - eg `speechmatics`
- [ ] add a `adapters/${sttServiceName}/sample` folder
- [ ] add a `src/lib/Util/adapters/${sttServiceName}/sample` folder
- [ ] add a sample json file from the STT service in this last folder - this will be useful for testing. Name it `${name of the stt service}.sample.json`
<!-- TODO: we should check these json are excluded from the bundle -->
- [ ] add option in [adapters/index.js](adapters/index.js)
Expand Down Expand Up @@ -107,6 +107,8 @@ This project uses jest. and once you submit the PR the tests are run by TravisCI

In order to write your tests, you want to have a `sample` folder with transcript data from stt and expected draftJs data output with file extensions `.sample.json` and `.sample.js` - see `bbc-kaldi` and `autoEdit2` example. This is so that those stub/example files are not bundled with the component when packaging for npm.

You can create and run your `example-usage.js` file and save the output json. This can be used to create the `.sample.js` file for the main test.

_If you don't have much experience with automated testing don't let this put you off tho, feel free to raise it as an issue and we can help out._

**top tip**: the draftJs block key attributes are randomly generated, and therefore cannot be tested in a deterministic way. However there is a well established workaround, you can replace them in the json with a type definition. eg instead of expecting it to be a specific number, you just expect it to be a string.
Expand Down
Loading