forked from bbc/react-transcript-editor
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.stories.js
More file actions
105 lines (99 loc) · 3.15 KB
/
index.stories.js
File metadata and controls
105 lines (99 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import React from "react";
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import {
withKnobs,
text,
number,
boolean,
object,
select
} from '@storybook/addon-knobs';
import bbcKaldiTranscript from "./fixtures/bbc-kaldi.json";
import TranscriptEditor from "../index.js";
storiesOf("TranscriptEditor", module)
.addDecorator(withKnobs)
.add("default", () => {
const fixtureProps = {
title: text('title', 'Ted Talk'),
mediaUrl: text(
'mediaUrl',
'https://download.ted.com/talks/KateDarling_2018S-950k.mp4'
),
sttJsonType: text('sttJsonType', 'bbckaldi'),
isEditable: boolean('isEditable', true),
spellCheck: boolean('spellCheck', false),
fileName: text('fileName', 'KateDarling_2018S-950k.mp4'),
// commenting this version of `transcriptData` coz it seems that
// loading a json this sisde effects storybook performance
// transcriptData: object('transcriptData', bbcKaldiTranscript),
transcriptData: bbcKaldiTranscript,
handleAnalyticsEvents: action('Analytics event'),
handleAutoSaveChanges: action('handleAutoSaveChange'),
autoSaveContentType: select(
'autoSaveContentType',
[
'draftjs',
'digitalpaperedit',
'txt',
'txtspeakertimecodes',
'srt',
'html',
'ttml',
'premiereTTML',
'itt',
'csv',
'vtt',
'pre-segment-txt',
'json-captions'
],
'draftjs',
0
),
mediaType: select('mediaType', [ 'audio', 'video' ], 'video', 1),
autoSaveContentType: text('autoSaveContentType', 'digitalpaperedit')
};
return <TranscriptEditor { ...fixtureProps } />;
})
.add('audio file', () => {
const fixtureProps = {
title: text('title', 'Ted Talk'),
mediaUrl: text(
'mediaUrl',
'https://download.ted.com/talks/KateDarling_2018S-950k.mp4'
),
sttJsonType: text('sttJsonType', 'bbckaldi'),
isEditable: boolean('isEditable', true),
spellCheck: boolean('spellCheck', false),
fileName: text('fileName', 'KateDarling_2018S-950k.mp4'),
// commenting this version of `transcriptData` coz it seems that
// loading a json this sisde effects storybook performance
// transcriptData: object('transcriptData', bbcKaldiTranscript),
transcriptData: bbcKaldiTranscript,
handleAnalyticsEvents: action('Analytics event'),
handleAutoSaveChanges: action('handleAutoSaveChange'),
autoSaveContentType: select(
'autoSaveContentType',
[
'draftjs',
'digitalpaperedit',
'txt',
'txtspeakertimecodes',
'srt',
'html',
'ttml',
'premiereTTML',
'itt',
'csv',
'vtt',
'pre-segment-txt',
'json-captions'
],
'draftjs',
0
),
mediaType: select('mediaType', [ 'audio', 'video' ], 'audio', 0),
autoSaveContentType: text('autoSaveContentType', 'digitalpaperedit')
};
return <TranscriptEditor { ...fixtureProps } />;
});