You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* got storybook working
tests not working yet
* fixed tests
using jest, and removed CRA dependency, updated babel config for babel 7 and stubbed css files for jest tests for css node modules
* Added support for demo app in storybook
* fixed eslint
CRA had it's own linter internally, so added linting + dependencies
* cleaned up export scripts in package.json
* updated README
* finalised refactor
see PR description for more details
* rename demo app editor to demoTranscript
* bringing back style lint, and fixing lint in storybook config
* updated with current master AWS adapter
* linting
* fix#132 playtime displaied double
playtime on display is double of actual total playtime
* temporary fix#73 monospace duration and current time
in media player to stop moving while playing
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,8 @@
3
3
This project has a [Code of Conduct](./CODE_OF_CONDUCT.md) that we expect all of our contributors to abide by, please check it out before contributing.
4
4
5
5
## Contributor license agreement
6
-
7
6
By submitting code as an individual or as an entity you agree that your code is licensed the same as the [React Transcript Editor](./LICENCE.md).
8
7
9
-
10
8
## Pull requests and branching
11
9
12
10
1.[Feel free to start by raising an issue](https://github.com/bbc/react-transcript-editor/issues/new?template=feature_request.md) so that others can be aware of areas where there is active development, and if needed we can synchronies the effort.
**Is your Pull Request request related to another [issue](https://github.com/bbc/react-transcript-editor/issues) in this repository ?**
2
-
_If so please link to other issues and PRs as appropriate_
2
+
<!--_If so please link to other issues and PRs as appropriate_-->
3
3
4
4
**Describe what the PR does**
5
-
_A clear and concise description of what the PR does. Feel free to use bulletpoints and checkboxes if needed [...]_
5
+
<!--_A clear and concise description of what the PR does. Feel free to use bulletpoints and checkboxes if needed [...]_-->
6
6
7
7
8
8
**State whether the PR is ready for review or whether it needs extra work**
9
-
_If you are still working on it and just setting it up for later review, or if it's ready to be reviewed for merging_
9
+
<!--_If you are still working on it and just setting it up for later review, or if it's ready to be reviewed for merging_-->
10
10
11
11
**Additional context**
12
-
Add any other context or screenshots about the PR.
12
+
<!--Add any other context or screenshots about the PR.-->
The project uses [this github project board to organise and the co-ordinate development](https://github.com/bbc/react-transcript-editor/projects/1).
9
+
The project uses [this github project boards to organise and the co-ordinate development](https://github.com/bbc/react-transcript-editor/projects).
10
10
11
11
_--> Work in progress <--_
12
12
13
13
<!-- _Screenshot of UI - optional_ -->
14
14
15
+
-[You can see a demo by clicking here ](https://bbc.github.io/react-transcript-editor/iframe.html?id=demo--default) (and then click the `load demo` button)
16
+
-[And you can see a list of features here](./docs/features-list.md).
17
+
15
18
## Development env
16
19
17
20
<!-- _How to run the development environment_ -->
@@ -34,32 +37,29 @@ Fork this repository + git clone + cd into folder
mediaUrl=// string url to media file - audio or video
@@ -71,7 +71,7 @@ import { TranscriptEditor } from '@bbc/react-transcript-editor';
71
71
ref={ this.transcriptEditorRef } // optional - if you want to have access to internal functions such as retrieving content from the editor. eg to save to a server/db.
72
72
/>
73
73
```
74
-
See [`./src/index.js` demo](./src/index.js) as a more detailed example usage of the component.
74
+
See [`./demo/app.js` demo](./demo/app.js) as a more detailed example usage of the component.
75
75
76
76
_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)_
77
77
@@ -84,19 +84,54 @@ If using in a parent project where [typescript](https://www.typescriptlang.org/)
<!-- _High level overview of system architecture_ -->
89
+
You can also import some of the underlying React components directly.
90
+
91
+
-`TranscriptEditor`
92
+
-`TimedTextEditor`
93
+
-`VideoPlayer`
94
+
-`Settings`
95
+
-`KeyboardShortcuts`
90
96
91
-
uses [`create-component-lib`](https://www.npmjs.com/package/create-component-lib) as explaied in this [blog post](https://hackernoon.com/creating-a-library-of-react-components-using-create-react-app-without-ejecting-d182df690c6b) to setup the environment to develop this React.
However if you are not using `TranscriptEditor` it is recommended to follow the second option and import individual components like: `@bbc/react-transcript-editor/TimedTextEditor` rather than the entire library. Doing so pulls in only the specific components that you use, which can significantly reduce the amount of code you end up sending to the client. (Similarly to how [`react-bootstrap`](https://react-bootstrap.github.io/getting-started/introduction) works)
105
+
106
+
See the storybook for for each component details on optional and required attributes.
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`.
127
+
<!-- _High level overview of system architecture_ -->
128
+
- uses [`storybook`](https://storybook.js.org) with the setup as [explained in their docs](https://storybook.js.org/docs/guides/guide-react/) to develop this React.
129
+
- This uses [CSS Modules](https://github.com/css-modules/css-modules) to contain the scope of the css for this component.
130
+
-[`.storybook/webpack.config.js](./.storybook/webpack.config.js) enanches the storybook webpack config to add support for css modules.
131
+
- The parts of the component are inside [`./packages`](./packages)
132
+
-[babel.config.js](./babel.config.js) provides root level system config for [babel 7](https://babeljs.io/docs/en/next/config-files#project-wide-configuration).
98
133
99
-
> Outside `src/lib` (but inside src/), you can create example web pages to test or demonstrate the usage of your components.
134
+
<!-- - for build, packaging, and deployment of the npm module, we use webpack with babel 7 -->
100
135
101
136
## Documentation
102
137
@@ -116,22 +151,35 @@ We are using [this template for ADR](https://gist.github.com/iaincollins/92923cc
116
151
117
152
<!-- _How to run build_ -->
118
153
119
-
> To transpile `src/lib` and create a build in the dist folder, run:
154
+
> To transpile `./packages` and create a build in the `./dist` folder, run:
120
155
121
156
```
122
157
npm run build:component
123
158
```
124
159
125
-
## Demo
160
+
## Demo & storybook
161
+
162
+
-**Storybook** can bew viewed at [https://bbc.github.io/react-transcript-editor/](https://bbc.github.io/react-transcript-editor/)
163
+
164
+
-**Demo** can be viewed at [https://bbc.github.io/react-transcript-editor/iframe.html?id=demo--default](https://bbc.github.io/react-transcript-editor/iframe.html?id=demo--default)
165
+
166
+
167
+
http://localhost:6006
126
168
127
-
Demo can be viewed at [https://bbc.github.io/react-transcript-editor](https://bbc.github.io/react-transcript-editor)
This github repository uses [github pages](https://pages.github.com/) to host a demo of the component, in [docs/demo](./docs/demo)
182
+
This github repository uses [github pages](https://pages.github.com/) to host the storybook and the demo of the component
135
183
136
184
```
137
185
npm run deploy:ghpages
@@ -144,11 +192,16 @@ add to git, and push to origin master to update
144
192
Alternatively If you simply want to build the demo locally in the `build` folder then just
145
193
146
194
```
147
-
npm run build:example
195
+
npm run build:storybook
148
196
```
149
197
150
-
## Tests
198
+
you can then run this command to serve the static site locally
151
199
200
+
```
201
+
npm run build:storybook:serve
202
+
```
203
+
204
+
## Tests
152
205
<!-- _How to carry out tests_ -->
153
206
154
207
Test coverage using [`jest`](https://jestjs.io/), to run tests
@@ -157,6 +210,16 @@ Test coverage using [`jest`](https://jestjs.io/), to run tests
157
210
npm run test
158
211
```
159
212
213
+
During development you can use
214
+
215
+
```
216
+
npm run test:watch
217
+
```
218
+
219
+
## Travis CI
220
+
221
+
On commit this repo uses the [.travis.yml](./.travis.yml) config tu run the automated test on [travis CI](https://travis-ci.org/bbc/react-transcript-editor).
222
+
160
223
## Deployment
161
224
162
225
<!-- _How to deploy the code/app into test/staging/production_ -->
@@ -176,9 +239,9 @@ This runs `npm run build:component` and `npm publish --access public` under the
176
239
See [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines and [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) guidelines.
177
240
178
241
## Licence
179
-
180
242
<!-- mention MIT Licence -->
243
+
See [LICENCE](./LICENCE.md)
181
244
182
245
## Legal Disclaimer
183
246
184
-
Despite using React and DraftJs, the BBC is not promoting any Facebook products or other commercial interest.
247
+
_Despite using React and DraftJs, the BBC is not promoting any Facebook products or other commercial interest._
0 commit comments