@coorpacademy/components 10.26.0 → 10.27.0
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/es/atom/choice/index.native.d.ts.map +1 -1
- package/es/atom/choice/index.native.js +6 -4
- package/es/atom/choice/index.native.js.map +1 -1
- package/es/atom/header-back-button/index.native.d.ts +1 -1
- package/es/atom/header-back-button/index.native.d.ts.map +1 -1
- package/es/atom/header-back-button/index.native.js.map +1 -1
- package/es/atom/html/index.native.d.ts.map +1 -1
- package/es/atom/html/index.native.js +8 -14
- package/es/atom/html/index.native.js.map +1 -1
- package/es/atom/image-background/index.native.d.ts.map +1 -1
- package/es/atom/image-background/index.native.js +0 -1
- package/es/atom/image-background/index.native.js.map +1 -1
- package/es/atom/provider/web-context.d.ts +3 -3
- package/es/atom/provider/web-context.d.ts.map +1 -1
- package/es/atom/provider/web-context.js +10 -11
- package/es/atom/provider/web-context.js.map +1 -1
- package/es/atom/review-header-step-item/index.native.d.ts.map +1 -1
- package/es/atom/review-header-step-item/index.native.js.map +1 -1
- package/es/atom/select-modal/index.native.js.map +1 -1
- package/es/hoc/modal/index.native.d.ts +1 -1
- package/es/hoc/modal/index.native.d.ts.map +1 -1
- package/es/hoc/modal/index.native.js.map +1 -1
- package/es/hoc/modal/select/index.native.d.ts.map +1 -1
- package/es/hoc/modal/select/index.native.js +3 -3
- package/es/hoc/modal/select/index.native.js.map +1 -1
- package/es/hoc/modal/select-item/index.native.d.ts +1 -1
- package/es/hoc/modal/select-item/index.native.d.ts.map +1 -1
- package/es/hoc/modal/select-item/index.native.js +1 -1
- package/es/hoc/modal/select-item/index.native.js.map +1 -1
- package/es/hoc/touchable/index.native.d.ts +5 -5
- package/es/hoc/touchable/index.native.d.ts.map +1 -1
- package/es/hoc/touchable/index.native.js.map +1 -1
- package/es/molecule/answer/prop-types.d.ts +2 -18
- package/es/molecule/answer/prop-types.d.ts.map +1 -1
- package/es/molecule/answer/prop-types.js.map +1 -1
- package/es/molecule/brand-logo/index.native.d.ts.map +1 -1
- package/es/molecule/brand-logo/index.native.js +4 -3
- package/es/molecule/brand-logo/index.native.js.map +1 -1
- package/es/molecule/questions/free-text/index.native.d.ts.map +1 -1
- package/es/molecule/questions/free-text/index.native.js +2 -2
- package/es/molecule/questions/free-text/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/draggable/index.native.js +1 -1
- package/es/molecule/questions/mobile/draggable/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/slider/index.native.js +3 -3
- package/es/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/switch/index.native.js +2 -2
- package/es/molecule/questions/mobile/switch/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/template/index.native.js +3 -3
- package/es/molecule/questions/mobile/template/index.native.js.map +1 -1
- package/es/molecule/questions/types.d.ts +10 -3
- package/es/molecule/questions/types.d.ts.map +1 -1
- package/es/molecule/questions/types.js.map +1 -1
- package/es/molecule/video-player/jwplayer.d.ts +1 -3
- package/es/molecule/video-player/jwplayer.d.ts.map +1 -1
- package/es/molecule/video-player/jwplayer.js +32 -34
- package/es/molecule/video-player/jwplayer.js.map +1 -1
- package/es/organism/header-v2/index.native.d.ts +3 -3
- package/es/organism/header-v2/index.native.d.ts.map +1 -1
- package/es/organism/header-v2/index.native.js.map +1 -1
- package/es/organism/mobile-navigation/index.native.d.ts +24 -2
- package/es/organism/mobile-navigation/index.native.d.ts.map +1 -1
- package/es/organism/mobile-navigation/index.native.js.map +1 -1
- package/es/organism/review-slide/index.native.d.ts.map +1 -1
- package/es/organism/review-slide/index.native.js +7 -8
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/template/app-player/popin-header/index.js +4 -4
- package/es/template/app-player/popin-header/index.js.map +1 -1
- package/es/template/app-review/index.native.js +0 -2
- package/es/template/app-review/index.native.js.map +1 -1
- package/es/template/app-review/player/index.native.js +2 -5
- package/es/template/app-review/player/index.native.js.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.js.map +1 -1
- package/es/template/app-review/template-context.d.ts +4 -3
- package/es/template/app-review/template-context.d.ts.map +1 -1
- package/es/template/app-review/template-context.js +3 -3
- package/es/template/app-review/template-context.js.map +1 -1
- package/es/variables/analytics.d.ts +4 -1
- package/es/variables/analytics.d.ts.map +1 -1
- package/es/variables/analytics.js.map +1 -1
- package/es/variables/brand.native.d.ts +1 -0
- package/es/variables/brand.native.d.ts.map +1 -1
- package/es/variables/brand.native.js +1 -1
- package/es/variables/brand.native.js.map +1 -1
- package/es/variables/theme.native.d.ts +0 -1
- package/es/variables/theme.native.d.ts.map +1 -1
- package/es/variables/theme.native.js +0 -1
- package/es/variables/theme.native.js.map +1 -1
- package/lib/atom/choice/index.native.d.ts.map +1 -1
- package/lib/atom/choice/index.native.js +6 -4
- package/lib/atom/choice/index.native.js.map +1 -1
- package/lib/atom/header-back-button/index.native.d.ts +1 -1
- package/lib/atom/header-back-button/index.native.d.ts.map +1 -1
- package/lib/atom/header-back-button/index.native.js.map +1 -1
- package/lib/atom/html/index.native.d.ts.map +1 -1
- package/lib/atom/html/index.native.js +7 -13
- package/lib/atom/html/index.native.js.map +1 -1
- package/lib/atom/image-background/index.native.d.ts.map +1 -1
- package/lib/atom/image-background/index.native.js +0 -1
- package/lib/atom/image-background/index.native.js.map +1 -1
- package/lib/atom/provider/web-context.d.ts +3 -3
- package/lib/atom/provider/web-context.d.ts.map +1 -1
- package/lib/atom/provider/web-context.js +10 -11
- package/lib/atom/provider/web-context.js.map +1 -1
- package/lib/atom/review-header-step-item/index.native.d.ts.map +1 -1
- package/lib/atom/review-header-step-item/index.native.js.map +1 -1
- package/lib/atom/select-modal/index.native.js.map +1 -1
- package/lib/hoc/modal/index.native.d.ts +1 -1
- package/lib/hoc/modal/index.native.d.ts.map +1 -1
- package/lib/hoc/modal/index.native.js.map +1 -1
- package/lib/hoc/modal/select/index.native.d.ts.map +1 -1
- package/lib/hoc/modal/select/index.native.js +3 -3
- package/lib/hoc/modal/select/index.native.js.map +1 -1
- package/lib/hoc/modal/select-item/index.native.d.ts +1 -1
- package/lib/hoc/modal/select-item/index.native.d.ts.map +1 -1
- package/lib/hoc/modal/select-item/index.native.js +1 -1
- package/lib/hoc/modal/select-item/index.native.js.map +1 -1
- package/lib/hoc/touchable/index.native.d.ts +5 -5
- package/lib/hoc/touchable/index.native.d.ts.map +1 -1
- package/lib/hoc/touchable/index.native.js.map +1 -1
- package/lib/molecule/answer/prop-types.d.ts +2 -18
- package/lib/molecule/answer/prop-types.d.ts.map +1 -1
- package/lib/molecule/answer/prop-types.js.map +1 -1
- package/lib/molecule/brand-logo/index.native.d.ts.map +1 -1
- package/lib/molecule/brand-logo/index.native.js +4 -3
- package/lib/molecule/brand-logo/index.native.js.map +1 -1
- package/lib/molecule/questions/free-text/index.native.d.ts.map +1 -1
- package/lib/molecule/questions/free-text/index.native.js +2 -2
- package/lib/molecule/questions/free-text/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/draggable/index.native.js +1 -1
- package/lib/molecule/questions/mobile/draggable/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/slider/index.native.js +3 -3
- package/lib/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/switch/index.native.js +2 -2
- package/lib/molecule/questions/mobile/switch/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/template/index.native.js +3 -3
- package/lib/molecule/questions/mobile/template/index.native.js.map +1 -1
- package/lib/molecule/questions/types.d.ts +10 -3
- package/lib/molecule/questions/types.d.ts.map +1 -1
- package/lib/molecule/questions/types.js.map +1 -1
- package/lib/molecule/video-player/jwplayer.d.ts +1 -3
- package/lib/molecule/video-player/jwplayer.d.ts.map +1 -1
- package/lib/molecule/video-player/jwplayer.js +32 -34
- package/lib/molecule/video-player/jwplayer.js.map +1 -1
- package/lib/organism/header-v2/index.native.d.ts +3 -3
- package/lib/organism/header-v2/index.native.d.ts.map +1 -1
- package/lib/organism/header-v2/index.native.js.map +1 -1
- package/lib/organism/mobile-navigation/index.native.d.ts +24 -2
- package/lib/organism/mobile-navigation/index.native.d.ts.map +1 -1
- package/lib/organism/mobile-navigation/index.native.js.map +1 -1
- package/lib/organism/review-slide/index.native.d.ts.map +1 -1
- package/lib/organism/review-slide/index.native.js +7 -8
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/template/app-player/popin-header/index.js +4 -4
- package/lib/template/app-player/popin-header/index.js.map +1 -1
- package/lib/template/app-review/index.native.js +0 -2
- package/lib/template/app-review/index.native.js.map +1 -1
- package/lib/template/app-review/player/index.native.js +2 -5
- package/lib/template/app-review/player/index.native.js.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.js.map +1 -1
- package/lib/template/app-review/template-context.d.ts +4 -3
- package/lib/template/app-review/template-context.d.ts.map +1 -1
- package/lib/template/app-review/template-context.js +4 -3
- package/lib/template/app-review/template-context.js.map +1 -1
- package/lib/variables/analytics.d.ts +4 -1
- package/lib/variables/analytics.d.ts.map +1 -1
- package/lib/variables/analytics.js.map +1 -1
- package/lib/variables/brand.native.d.ts +1 -0
- package/lib/variables/brand.native.d.ts.map +1 -1
- package/lib/variables/brand.native.js +5 -0
- package/lib/variables/brand.native.js.map +1 -1
- package/lib/variables/theme.native.d.ts +0 -1
- package/lib/variables/theme.native.d.ts.map +1 -1
- package/lib/variables/theme.native.js +0 -1
- package/lib/variables/theme.native.js.map +1 -1
- package/package.json +6 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/questions/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,sCAAsC,CAAC;AAEhE,aAAK,GAAG,GAAG,MAAM,CAAC;AAElB,aAAK,aAAa,GACd,qBAAqB,GACrB,sBAAsB,GACtB,qBAAqB,GACrB,wBAAwB,GACxB,mBAAmB,CAAC;AAExB,a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AE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC1B,CAAC;AAEF,oBAAY,MAAM,GAAG,UAAU,GAAG,gBAAgB,GAAG,qBAAqB,GAAG,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/molecule/questions/types.ts"],"sourcesContent":["import {ChoiceItem} from '../../atom/select-modal/index.native';\n\ntype Url = string;\n\ntype VideoMimeType =\n | 'application/kontiki'\n | 'application/jwplayer'\n | 'application/youtube'\n | 'application/omniPlayer'\n | 'application/vimeo';\n\ntype ResourceMimeType =\n | 'video/mp4'\n | 'image/jpeg'\n | 'image/png'\n | 'application/pdf'\n | VideoMimeType;\n\nexport type Source = {\n _id?: string;\n mimeType?: ResourceMimeType;\n url: Url;\n videoId?: string;\n};\n\nexport type MediaType = 'img' | 'video' | 'pdf';\n\nexport type Media = {\n type?: MediaType;\n description?: string;\n mimeType?: ResourceMimeType;\n _id?: string;\n mediaUrl?: Url;\n url?: Url;\n subtitles?: Array<string>;\n posters?: Array<Url>;\n src?: Array<Source>;\n};\n\nexport type QuestionType = 'qcm' | 'qcmGraphic' | 'slider' | 'qcmDrag' | 'basic' | 'template';\n\ntype ChoiceBase = {\n _id: string;\n value?: string;\n name?: string;\n label?: string;\n};\n\nexport type SelectableChoice = {\n _id: string;\n label: string;\n selected: boolean;\n onPress:
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/molecule/questions/types.ts"],"sourcesContent":["import {ChoiceItem} from '../../atom/select-modal/index.native';\n\ntype Url = string;\n\ntype VideoMimeType =\n | 'application/kontiki'\n | 'application/jwplayer'\n | 'application/youtube'\n | 'application/omniPlayer'\n | 'application/vimeo';\n\ntype ResourceMimeType =\n | 'video/mp4'\n | 'audio/acc'\n | 'image/jpeg'\n | 'image/png'\n | 'application/pdf'\n | VideoMimeType;\n\nexport type Source = {\n _id?: string;\n mimeType?: ResourceMimeType;\n url: Url;\n videoId?: string;\n};\n\nexport type MediaType = 'img' | 'audio' | 'video' | 'pdf';\n\nexport type Media = {\n type?: MediaType;\n description?: string;\n mimeType?: ResourceMimeType;\n _id?: string;\n mediaUrl?: Url;\n url?: Url;\n subtitles?: Array<string>;\n posters?: Array<Url>;\n src?: Array<Source>;\n poster?: string;\n videoId?: string;\n onClick?: () => void;\n onPlay?: () => void;\n onPause?: () => void;\n onResume?: () => void;\n onEnded?: () => void;\n};\n\nexport type QuestionType = 'qcm' | 'qcmGraphic' | 'slider' | 'qcmDrag' | 'basic' | 'template';\n\ntype ChoiceBase = {\n _id: string;\n value?: string;\n name?: string;\n label?: string;\n};\n\nexport type SelectableChoice = {\n _id: string;\n label: string;\n selected: boolean;\n onPress: (value?: string) => void;\n media?: Media;\n};\n\nexport type TemplateTextChoice = {\n type: 'text';\n _id: string;\n name: string;\n value: string;\n label: string;\n selected: boolean;\n};\n\nexport type TemplateListOfChoices = {\n type: 'select';\n _id: string;\n name: string;\n value: string;\n label: string;\n items: Array<ChoiceItem>;\n};\n\nexport type Choice = ChoiceBase | SelectableChoice | TemplateListOfChoices | TemplateTextChoice;\n"],"mappings":""}
|
|
@@ -34,9 +34,9 @@ declare class JWPlayer extends React.Component<any, any, any> {
|
|
|
34
34
|
onSetupError: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
35
35
|
onWarning: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
36
36
|
};
|
|
37
|
+
static getDerivedStateFromProps(props: any): any;
|
|
37
38
|
constructor(props: any, context: any);
|
|
38
39
|
state: {
|
|
39
|
-
fileUrl: string;
|
|
40
40
|
scriptFailedLoading: boolean;
|
|
41
41
|
};
|
|
42
42
|
handlePlay(e: any): void;
|
|
@@ -49,9 +49,7 @@ declare class JWPlayer extends React.Component<any, any, any> {
|
|
|
49
49
|
handlePlayAttemptFailed(error: any): void;
|
|
50
50
|
handleAutostartNotAllowed(error: any): void;
|
|
51
51
|
handleWarning(error: any): void;
|
|
52
|
-
componentDidMount(): void;
|
|
53
52
|
componentDidUpdate(prevProps: any): void;
|
|
54
|
-
setFileUrl(): void;
|
|
55
53
|
render(): JSX.Element;
|
|
56
54
|
}
|
|
57
55
|
import React from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwplayer.d.ts","sourceRoot":"","sources":["../../../src/molecule/video-player/jwplayer.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"jwplayer.d.ts","sourceRoot":"","sources":["../../../src/molecule/video-player/jwplayer.js"],"names":[],"mappings":";AAoBA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAqC;IAqBrC,iDAEC;IArBD,sCAiBC;IAdC;;MAEC;IAgCH,yBAGC;IAED,2BAGC;IAED,0BAGC;IAED,0BAGC;IA6BD,8BAyBC;IA7CD,mCAGC;IAVD,qCAKC;IAOD,0CAGC;IAED,4CAGC;IAED,gCAGC;IA3DD,yCAYC;IA4ED,sBAoCC;CACF"}
|
|
@@ -6,15 +6,30 @@ import _get from "lodash/fp/get";
|
|
|
6
6
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import
|
|
9
|
+
import Player from '@jwplayer/jwplayer-react';
|
|
10
10
|
import style from './jwplayer.css';
|
|
11
11
|
import { JWPlayerPropTypes } from './prop-types';
|
|
12
12
|
|
|
13
|
+
const fileAndTracks = ({
|
|
14
|
+
file,
|
|
15
|
+
customProps,
|
|
16
|
+
playlist
|
|
17
|
+
} = {}) => {
|
|
18
|
+
if (file) return {
|
|
19
|
+
file,
|
|
20
|
+
tracks: customProps ? customProps.tracks : null
|
|
21
|
+
};
|
|
22
|
+
if (playlist && playlist[0]) return playlist[0];
|
|
23
|
+
return {
|
|
24
|
+
file: null,
|
|
25
|
+
tracks: null
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
13
29
|
class JWPlayer extends React.Component {
|
|
14
30
|
constructor(props, context) {
|
|
15
31
|
super(props, context);
|
|
16
32
|
this.state = {
|
|
17
|
-
fileUrl: '',
|
|
18
33
|
scriptFailedLoading: false
|
|
19
34
|
};
|
|
20
35
|
this.handlePlay = this.handlePlay.bind(this);
|
|
@@ -29,12 +44,8 @@ class JWPlayer extends React.Component {
|
|
|
29
44
|
this.handleWarning = this.handleWarning.bind(this);
|
|
30
45
|
}
|
|
31
46
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
jwPlayerScript.onerror = () => this.handleScriptError(jwPlayerScript);
|
|
36
|
-
|
|
37
|
-
this.setFileUrl();
|
|
47
|
+
static getDerivedStateFromProps(props) {
|
|
48
|
+
return fileAndTracks(props.jwpOptions);
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
componentDidUpdate(prevProps) {
|
|
@@ -55,26 +66,6 @@ class JWPlayer extends React.Component {
|
|
|
55
66
|
window.jwplayer(prevProps.jwpOptions.playerId).play();
|
|
56
67
|
}
|
|
57
68
|
}
|
|
58
|
-
|
|
59
|
-
const {
|
|
60
|
-
jwpOptions
|
|
61
|
-
} = this.props;
|
|
62
|
-
|
|
63
|
-
if (prevProps.jwpOptions.file !== jwpOptions.file) {
|
|
64
|
-
this.setFileUrl();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
setFileUrl() {
|
|
69
|
-
const {
|
|
70
|
-
jwpOptions
|
|
71
|
-
} = this.props;
|
|
72
|
-
const {
|
|
73
|
-
file
|
|
74
|
-
} = jwpOptions;
|
|
75
|
-
return this.setState({
|
|
76
|
-
fileUrl: file
|
|
77
|
-
});
|
|
78
69
|
}
|
|
79
70
|
|
|
80
71
|
handlePlay(e) {
|
|
@@ -171,7 +162,7 @@ class JWPlayer extends React.Component {
|
|
|
171
162
|
if (matched) {
|
|
172
163
|
const videoId = matched[1];
|
|
173
164
|
return this.setState({
|
|
174
|
-
|
|
165
|
+
file: `https://content.jwplatform.com/videos/${videoId}-1080.mp4`
|
|
175
166
|
});
|
|
176
167
|
}
|
|
177
168
|
}
|
|
@@ -185,19 +176,27 @@ class JWPlayer extends React.Component {
|
|
|
185
176
|
} = this.props;
|
|
186
177
|
const {
|
|
187
178
|
scriptFailedLoading,
|
|
188
|
-
|
|
179
|
+
file,
|
|
180
|
+
tracks
|
|
189
181
|
} = this.state;
|
|
190
182
|
|
|
191
183
|
const _jwpOptions = _extends({}, jwpOptions, {
|
|
192
184
|
customProps: _extends({}, _get('customProps', jwpOptions), {
|
|
185
|
+
key: jwpOptions.licenseKey,
|
|
193
186
|
autostart: !disableAutostart && _get('customProps.autostart', jwpOptions)
|
|
194
187
|
})
|
|
195
188
|
});
|
|
196
189
|
|
|
197
190
|
return /*#__PURE__*/React.createElement(React.Fragment, null, scriptFailedLoading ? /*#__PURE__*/React.createElement("p", {
|
|
198
191
|
className: style.errorMessage
|
|
199
|
-
}, scriptErrorMessage, " ") : null, /*#__PURE__*/React.createElement(
|
|
192
|
+
}, scriptErrorMessage, " ") : null, /*#__PURE__*/React.createElement(Player, {
|
|
193
|
+
key: file,
|
|
200
194
|
className: style.wrapper,
|
|
195
|
+
id: _jwpOptions.playerId,
|
|
196
|
+
file: file,
|
|
197
|
+
tracks: tracks,
|
|
198
|
+
library: _jwpOptions.playerScript,
|
|
199
|
+
config: _jwpOptions.customProps,
|
|
201
200
|
onAutoStart: this.handlePlay,
|
|
202
201
|
onPlay: this.handlePlay,
|
|
203
202
|
onResume: this.handleResume,
|
|
@@ -207,9 +206,8 @@ class JWPlayer extends React.Component {
|
|
|
207
206
|
onSetupError: this.handleSetupError,
|
|
208
207
|
onPlayAttemptFailed: this.handlePlayAttemptFailed,
|
|
209
208
|
onWarning: this.handleWarning,
|
|
210
|
-
onAutostartNotAllowed: this.handleAutostartNotAllowed
|
|
211
|
-
|
|
212
|
-
})));
|
|
209
|
+
onAutostartNotAllowed: this.handleAutostartNotAllowed
|
|
210
|
+
}));
|
|
213
211
|
}
|
|
214
212
|
|
|
215
213
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwplayer.js","names":["React","ReactJWPlayer","style","JWPlayerPropTypes","JWPlayer","Component","constructor","props","context","state","fileUrl","scriptFailedLoading","handlePlay","bind","handleResume","handlePause","handleEnded","handleError","handleSetupError","handleScriptError","handlePlayAttemptFailed","handleAutostartNotAllowed","handleWarning","componentDidMount","jwPlayerScript","document","getElementById","onerror","setFileUrl","componentDidUpdate","prevProps","changes","filter","key","current","prev","shouldStart","window","jwplayer","jwpOptions","playerId","play","file","setState","e","onPlay","onResume","onPause","onEnded","script","parentNode","removeChild","error","onSetupError","onPlayAttemptFailed","onAutostartNotAllowed","onWarning","onError","mimeType","code","videoUrl","regex","matched","match","videoId","render","disableAutostart","scriptErrorMessage","_jwpOptions","customProps","autostart","errorMessage","wrapper","propTypes"],"sources":["../../../src/molecule/video-player/jwplayer.js"],"sourcesContent":["import React from 'react';\nimport ReactJWPlayer from 'react-jw-player';\nimport {get, includes, isFunction, keys} from 'lodash/fp';\nimport style from './jwplayer.css';\nimport {JWPlayerPropTypes} from './prop-types';\n\nclass JWPlayer extends React.Component {\n static propTypes = JWPlayerPropTypes;\n\n constructor(props, context) {\n super(props, context);\n this.state = {\n fileUrl: '',\n scriptFailedLoading: false\n };\n\n this.handlePlay = this.handlePlay.bind(this);\n this.handleResume = this.handleResume.bind(this);\n this.handlePause = this.handlePause.bind(this);\n this.handleEnded = this.handleEnded.bind(this);\n this.handleError = this.handleError.bind(this);\n this.handleSetupError = this.handleSetupError.bind(this);\n this.handleScriptError = this.handleScriptError.bind(this);\n this.handlePlayAttemptFailed = this.handlePlayAttemptFailed.bind(this);\n this.handleAutostartNotAllowed = this.handleAutostartNotAllowed.bind(this);\n this.handleWarning = this.handleWarning.bind(this);\n }\n\n componentDidMount() {\n const jwPlayerScript = document.getElementById('jw-player-script');\n jwPlayerScript.onerror = () => this.handleScriptError(jwPlayerScript);\n this.setFileUrl();\n }\n\n componentDidUpdate(prevProps) {\n const changes = keys(this.props).filter(key => {\n const {[key]: current} = this.props;\n const {[key]: prev} = prevProps;\n return current !== prev;\n });\n const shouldStart = includes('autoplay', changes);\n if (shouldStart) {\n if (isFunction(window.jwplayer)) {\n window.jwplayer(prevProps.jwpOptions.playerId).play();\n }\n }\n const {jwpOptions} = this.props;\n if (prevProps.jwpOptions.file !== jwpOptions.file) {\n this.setFileUrl();\n }\n }\n\n setFileUrl() {\n const {jwpOptions} = this.props;\n const {file} = jwpOptions;\n\n return this.setState({fileUrl: file});\n }\n\n handlePlay(e) {\n const {onPlay} = this.props;\n if (onPlay) onPlay(e);\n }\n\n handleResume(e) {\n const {onResume} = this.props;\n if (onResume) onResume(e);\n }\n\n handlePause(e) {\n const {onPause} = this.props;\n if (onPause) onPause(e);\n }\n\n handleEnded(e) {\n const {onEnded} = this.props;\n if (onEnded) onEnded(e);\n }\n\n handleScriptError(script) {\n this.setState({scriptFailedLoading: true});\n if (script) {\n script.parentNode.removeChild();\n }\n }\n\n handleSetupError(error) {\n const {onSetupError} = this.props;\n if (onSetupError) onSetupError(error);\n }\n\n handlePlayAttemptFailed(error) {\n const {onPlayAttemptFailed} = this.props;\n if (onPlayAttemptFailed) onPlayAttemptFailed(error);\n }\n\n handleAutostartNotAllowed(error) {\n const {onAutostartNotAllowed} = this.props;\n if (onAutostartNotAllowed) onAutostartNotAllowed(error);\n }\n\n handleWarning(error) {\n const {onWarning} = this.props;\n if (onWarning) onWarning(error);\n }\n\n handleError(error) {\n const {onError, mimeType, jwpOptions} = this.props;\n const {code} = error;\n\n onError && onError(error);\n\n if (mimeType === 'application/kontiki') {\n return;\n }\n\n // This error mostly appears on IE11 on W7\n // Since IE11 dont kinda support M3U8 sometimes,\n // We've decided to switch from M3U8 to mp4 whenever it appears\n if (code === 214000) {\n const {file: videoUrl} = jwpOptions;\n const regex = /^https:\\/\\/content.jwplatform\\.com\\/manifests\\/(\\w+).m3u8/;\n const matched = videoUrl.match(regex);\n\n if (matched) {\n const videoId = matched[1];\n return this.setState({\n fileUrl: `https://content.jwplatform.com/videos/${videoId}-1080.mp4`\n });\n }\n }\n }\n\n render() {\n const {jwpOptions, disableAutostart, scriptErrorMessage} = this.props;\n const {scriptFailedLoading, fileUrl} = this.state;\n const _jwpOptions = {\n ...jwpOptions,\n customProps: {\n ...get('customProps', jwpOptions),\n autostart: !disableAutostart && get('customProps.autostart', jwpOptions)\n }\n };\n\n return (\n <>\n {scriptFailedLoading ? <p className={style.errorMessage}>{scriptErrorMessage} </p> : null}\n <ReactJWPlayer\n {..._jwpOptions}\n className={style.wrapper}\n onAutoStart={this.handlePlay}\n onPlay={this.handlePlay}\n onResume={this.handleResume}\n onPause={this.handlePause}\n onOneHundredPercent={this.handleEnded}\n onError={this.handleError}\n onSetupError={this.handleSetupError}\n onPlayAttemptFailed={this.handlePlayAttemptFailed}\n onWarning={this.handleWarning}\n onAutostartNotAllowed={this.handleAutostartNotAllowed}\n file={fileUrl}\n />\n </>\n );\n }\n}\n\nexport default JWPlayer;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AAEA,OAAOC,KAAP,MAAkB,gBAAlB;AACA,SAAQC,iBAAR,QAAgC,cAAhC;;AAEA,MAAMC,QAAN,SAAuBJ,KAAK,CAACK,SAA7B,CAAuC;EAGrCC,WAAW,CAACC,KAAD,EAAQC,OAAR,EAAiB;IAC1B,MAAMD,KAAN,EAAaC,OAAb;IACA,KAAKC,KAAL,GAAa;MACXC,OAAO,EAAE,EADE;MAEXC,mBAAmB,EAAE;IAFV,CAAb;IAKA,KAAKC,UAAL,GAAkB,KAAKA,UAAL,CAAgBC,IAAhB,C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d,CAAP;MAGD;IACF;EACF;;EAEDC,MAAM,GAAG;IACP,MAAM;MAAC1B,UAAD;MAAa2B,gBAAb;MAA+BC;IAA/B,IAAqD,KAAK5D,KAAhE;IACA,MAAM;MAACI,mBAAD;MAAsBD;IAAtB,IAAiC,KAAKD,KAA5C;;IACA,MAAM2D,WAAW,gBACZ7B,UADY;MAEf8B,WAAW,eACN,KAAI,aAAJ,EAAmB9B,UAAnB,CADM;QAET+B,SAAS,EAAE,CAACJ,gBAAD,IAAqB,KAAI,uBAAJ,EAA6B3B,UAA7B;MAFvB;IAFI,EAAjB;;IAQA,oBACE,0CACG5B,mBAAmB,gBAAG;MAAG,SAAS,EAAET,KAAK,CAACqE;IAApB,GAAmCJ,kBAAnC,MAAH,GAAiE,IADvF,eAEE,oBAAC,aAAD,eACMC,WADN;MAEE,SAAS,EAAElE,KAAK,CAACsE,OAFnB;MAGE,WAAW,EAAE,KAAK5D,UAHpB;MAIE,MAAM,EAAE,KAAKA,UAJf;MAKE,QAAQ,EAAE,KAAKE,YALjB;MAME,OAAO,EAAE,KAAKC,WANhB;MAOE,mBAAmB,EAAE,KAAKC,WAP5B;MAQE,OAAO,EAAE,KAAKC,WARhB;MASE,YAAY,EAAE,KAAKC,gBATrB;MAUE,mBAAmB,EAAE,KAAKE,uBAV5B;MAWE,SAAS,EAAE,KAAKE,aAXlB;MAYE,qBAAqB,EAAE,KAAKD,yBAZ9B;MAaE,IAAI,EAAEX;IAbR,GAFF,CADF;EAoBD;;AA9JoC;;AAAjCN,Q,CACGqE,S,2CAAYtE,iB;AAgKrB,eAAeC,QAAf"}
|
|
1
|
+
{"version":3,"file":"jwplayer.js","names":["React","Player","style","JWPlayerPropTypes","fileAndTracks","file","customProps","playlist","tracks","JWPlayer","Component","constructor","props","context","state","scriptFailedLoading","handlePlay","bind","handleResume","handlePause","handleEnded","handleError","handleSetupError","handleScriptError","handlePlayAttemptFailed","handleAutostartNotAllowed","handleWarning","getDerivedStateFromProps","jwpOptions","componentDidUpdate","prevProps","changes","filter","key","current","prev","shouldStart","window","jwplayer","playerId","play","e","onPlay","onResume","onPause","onEnded","script","setState","parentNode","removeChild","error","onSetupError","onPlayAttemptFailed","onAutostartNotAllowed","onWarning","onError","mimeType","code","videoUrl","regex","matched","match","videoId","render","disableAutostart","scriptErrorMessage","_jwpOptions","licenseKey","autostart","errorMessage","wrapper","playerScript","propTypes"],"sources":["../../../src/molecule/video-player/jwplayer.js"],"sourcesContent":["import React from 'react';\nimport Player from '@jwplayer/jwplayer-react';\nimport {get, includes, isFunction, keys} from 'lodash/fp';\nimport style from './jwplayer.css';\nimport {JWPlayerPropTypes} from './prop-types';\n\nconst fileAndTracks = ({file, customProps, playlist} = {}) => {\n if (file)\n return {\n file,\n tracks: customProps ? customProps.tracks : null\n };\n if (playlist && playlist[0]) return playlist[0];\n\n return {\n file: null,\n tracks: null\n };\n};\n\nclass JWPlayer extends React.Component {\n static propTypes = JWPlayerPropTypes;\n\n constructor(props, context) {\n super(props, context);\n\n this.state = {\n scriptFailedLoading: false\n };\n\n this.handlePlay = this.handlePlay.bind(this);\n this.handleResume = this.handleResume.bind(this);\n this.handlePause = this.handlePause.bind(this);\n this.handleEnded = this.handleEnded.bind(this);\n this.handleError = this.handleError.bind(this);\n this.handleSetupError = this.handleSetupError.bind(this);\n this.handleScriptError = this.handleScriptError.bind(this);\n this.handlePlayAttemptFailed = this.handlePlayAttemptFailed.bind(this);\n this.handleAutostartNotAllowed = this.handleAutostartNotAllowed.bind(this);\n this.handleWarning = this.handleWarning.bind(this);\n }\n\n static getDerivedStateFromProps(props) {\n return fileAndTracks(props.jwpOptions);\n }\n\n componentDidUpdate(prevProps) {\n const changes = keys(this.props).filter(key => {\n const {[key]: current} = this.props;\n const {[key]: prev} = prevProps;\n return current !== prev;\n });\n const shouldStart = includes('autoplay', changes);\n if (shouldStart) {\n if (isFunction(window.jwplayer)) {\n window.jwplayer(prevProps.jwpOptions.playerId).play();\n }\n }\n }\n\n handlePlay(e) {\n const {onPlay} = this.props;\n if (onPlay) onPlay(e);\n }\n\n handleResume(e) {\n const {onResume} = this.props;\n if (onResume) onResume(e);\n }\n\n handlePause(e) {\n const {onPause} = this.props;\n if (onPause) onPause(e);\n }\n\n handleEnded(e) {\n const {onEnded} = this.props;\n if (onEnded) onEnded(e);\n }\n\n handleScriptError(script) {\n this.setState({scriptFailedLoading: true});\n if (script) {\n script.parentNode.removeChild();\n }\n }\n\n handleSetupError(error) {\n const {onSetupError} = this.props;\n if (onSetupError) onSetupError(error);\n }\n\n handlePlayAttemptFailed(error) {\n const {onPlayAttemptFailed} = this.props;\n if (onPlayAttemptFailed) onPlayAttemptFailed(error);\n }\n\n handleAutostartNotAllowed(error) {\n const {onAutostartNotAllowed} = this.props;\n if (onAutostartNotAllowed) onAutostartNotAllowed(error);\n }\n\n handleWarning(error) {\n const {onWarning} = this.props;\n if (onWarning) onWarning(error);\n }\n\n handleError(error) {\n const {onError, mimeType, jwpOptions} = this.props;\n const {code} = error;\n\n onError && onError(error);\n\n if (mimeType === 'application/kontiki') {\n return;\n }\n\n // This error mostly appears on IE11 on W7\n // Since IE11 dont kinda support M3U8 sometimes,\n // We've decided to switch from M3U8 to mp4 whenever it appears\n if (code === 214000) {\n const {file: videoUrl} = jwpOptions;\n const regex = /^https:\\/\\/content.jwplatform\\.com\\/manifests\\/(\\w+).m3u8/;\n const matched = videoUrl.match(regex);\n\n if (matched) {\n const videoId = matched[1];\n return this.setState({\n file: `https://content.jwplatform.com/videos/${videoId}-1080.mp4`\n });\n }\n }\n }\n\n render() {\n const {jwpOptions, disableAutostart, scriptErrorMessage} = this.props;\n const {scriptFailedLoading, file, tracks} = this.state;\n const _jwpOptions = {\n ...jwpOptions,\n customProps: {\n ...get('customProps', jwpOptions),\n key: jwpOptions.licenseKey,\n autostart: !disableAutostart && get('customProps.autostart', jwpOptions)\n }\n };\n\n return (\n <>\n {scriptFailedLoading ? <p className={style.errorMessage}>{scriptErrorMessage} </p> : null}\n <Player\n key={file}\n className={style.wrapper}\n id={_jwpOptions.playerId}\n file={file}\n tracks={tracks}\n library={_jwpOptions.playerScript}\n config={_jwpOptions.customProps}\n onAutoStart={this.handlePlay}\n onPlay={this.handlePlay}\n onResume={this.handleResume}\n onPause={this.handlePause}\n onOneHundredPercent={this.handleEnded}\n onError={this.handleError}\n onSetupError={this.handleSetupError}\n onPlayAttemptFailed={this.handlePlayAttemptFailed}\n onWarning={this.handleWarning}\n onAutostartNotAllowed={this.handleAutostartNotAllowed}\n />\n </>\n );\n }\n}\n\nexport default JWPlayer;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,MAAP,MAAmB,0BAAnB;AAEA,OAAOC,KAAP,MAAkB,gBAAlB;AACA,SAAQC,iBAAR,QAAgC,cAAhC;;AAEA,MAAMC,aAAa,GAAG,CAAC;EAACC,IAAD;EAAOC,WAAP;EAAoBC;AAApB,IAAgC,EAAjC,KAAwC;EAC5D,IAAIF,IAAJ,EACE,OAAO;IACLA,IADK;IAELG,MAAM,EAAEF,WAAW,GAAGA,WAAW,CAACE,MAAf,GAAwB;EAFtC,CAAP;EAIF,IAAID,QAAQ,IAAIA,QAAQ,CAAC,CAAD,CAAxB,EAA6B,OAAOA,QAAQ,CAAC,CAAD,CAAf;EAE7B,OAAO;IACLF,IAAI,EAAE,IADD;IAELG,MAAM,EAAE;EAFH,CAAP;AAID,CAZD;;AAcA,MAAMC,QAAN,SAAuBT,KAAK,CAACU,SAA7B,CAAuC;EAGrCC,WAAW,CAACC,KAAD,EAAQC,OAAR,EAAiB;IAC1B,MAAMD,KAAN,EAAaC,OAAb;IAEA,KAAKC,KAAL,GAAa;MACXC,mBAAmB,EAAE;IADV,CAAb;IAIA,KAAKC,UAAL,GAAkB,KAAKA,UAAL,CAAgBC,IAAhB,CAAqB,IAArB,CAAlB;IACA,KAAKC,YAAL,GAAoB,KAAKA,YAAL,CAAkBD,IAAlB,CAAuB,IAAvB,CAApB;IACA,KAAKE,WAA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eAEE,oBAAC,MAAD;MACE,GAAG,EAAE5D,IADP;MAEE,SAAS,EAAEH,KAAK,CAACoE,OAFnB;MAGE,EAAE,EAAEJ,WAAW,CAAC3B,QAHlB;MAIE,IAAI,EAAElC,IAJR;MAKE,MAAM,EAAEG,MALV;MAME,OAAO,EAAE0D,WAAW,CAACK,YANvB;MAOE,MAAM,EAAEL,WAAW,CAAC5D,WAPtB;MAQE,WAAW,EAAE,KAAKU,UARpB;MASE,MAAM,EAAE,KAAKA,UATf;MAUE,QAAQ,EAAE,KAAKE,YAVjB;MAWE,OAAO,EAAE,KAAKC,WAXhB;MAYE,mBAAmB,EAAE,KAAKC,WAZ5B;MAaE,OAAO,EAAE,KAAKC,WAbhB;MAcE,YAAY,EAAE,KAAKC,gBAdrB;MAeE,mBAAmB,EAAE,KAAKE,uBAf5B;MAgBE,SAAS,EAAE,KAAKE,aAhBlB;MAiBE,qBAAqB,EAAE,KAAKD;IAjB9B,EAFF,CADF;EAwBD;;AAtJoC;;AAAjChB,Q,CACG+D,S,2CAAYrE,iB;AAwJrB,eAAeM,QAAf"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { GestureResponderEvent } from 'react-native';
|
|
3
3
|
export interface Props {
|
|
4
|
-
onSearchPress: (event: GestureResponderEvent) =>
|
|
5
|
-
onSettingsPress: (event: GestureResponderEvent) =>
|
|
6
|
-
onLogoLongPress: (event: GestureResponderEvent) =>
|
|
4
|
+
onSearchPress: (event: GestureResponderEvent) => void;
|
|
5
|
+
onSettingsPress: (event: GestureResponderEvent) => void;
|
|
6
|
+
onLogoLongPress: (event: GestureResponderEvent) => void;
|
|
7
7
|
}
|
|
8
8
|
export declare const HEADER_HEIGHT = 67;
|
|
9
9
|
declare const Header: (props: Props) => JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/header-v2/index.native.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAmB,qBAAqB,EAAY,MAAM,cAAc,CAAC;AAWhF,MAAM,WAAW,KAAK;IACpB,aAAa,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/header-v2/index.native.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAmB,qBAAqB,EAAY,MAAM,cAAc,CAAC;AAWhF,MAAM,WAAW,KAAK;IACpB,aAAa,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACtD,eAAe,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACxD,eAAe,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACzD;AAED,eAAO,MAAM,aAAa,KAAK,CAAC;AA0ChC,QAAA,MAAM,MAAM,UAAW,KAAK,uBAyD3B,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","View","StyleSheet","NovaCompositionCoorpacademySearch","SearchIcon","NovaCompositionCoorpacademyCog","SettingsIcon","useTemplateContext","BrandLogo","Gradient","Touchable","HEADER_HEIGHT","ICON_WIDTH","createStyleSheet","theme","create","container","position","backgroundColor","colors","white","flexDirection","alignItems","justifyContent","height","top","width","icons","icon","marginRight","logo","marginLeft","gradient","left","right","opacity","Header","props","templateContext","styleSheet","setStylesheet","onSearchPress","onSettingsPress","onLogoLongPress","logoHeight","spacing","small","_stylesheet","tiny","gray","medium","light","dark"],"sources":["../../../src/organism/header-v2/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\n\nimport {View, StyleSheet, GestureResponderEvent, ViewStyle} from 'react-native';\nimport {\n NovaCompositionCoorpacademySearch as SearchIcon,\n NovaCompositionCoorpacademyCog as SettingsIcon\n} from '@coorpacademy/nova-icons';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport BrandLogo from '../../molecule/brand-logo/index.native';\nimport Gradient from '../../atom/gradient/index.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {Theme} from '../../variables/theme.native';\n\nexport interface Props {\n onSearchPress: (event: GestureResponderEvent) =>
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","View","StyleSheet","NovaCompositionCoorpacademySearch","SearchIcon","NovaCompositionCoorpacademyCog","SettingsIcon","useTemplateContext","BrandLogo","Gradient","Touchable","HEADER_HEIGHT","ICON_WIDTH","createStyleSheet","theme","create","container","position","backgroundColor","colors","white","flexDirection","alignItems","justifyContent","height","top","width","icons","icon","marginRight","logo","marginLeft","gradient","left","right","opacity","Header","props","templateContext","styleSheet","setStylesheet","onSearchPress","onSettingsPress","onLogoLongPress","logoHeight","spacing","small","_stylesheet","tiny","gray","medium","light","dark"],"sources":["../../../src/organism/header-v2/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\n\nimport {View, StyleSheet, GestureResponderEvent, ViewStyle} from 'react-native';\nimport {\n NovaCompositionCoorpacademySearch as SearchIcon,\n NovaCompositionCoorpacademyCog as SettingsIcon\n} from '@coorpacademy/nova-icons';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport BrandLogo from '../../molecule/brand-logo/index.native';\nimport Gradient from '../../atom/gradient/index.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {Theme} from '../../variables/theme.native';\n\nexport interface Props {\n onSearchPress: (event: GestureResponderEvent) => void;\n onSettingsPress: (event: GestureResponderEvent) => void;\n onLogoLongPress: (event: GestureResponderEvent) => void;\n}\n\nexport const HEADER_HEIGHT = 67;\nconst ICON_WIDTH = 20;\n\ntype StyleSheetType = {\n container: ViewStyle;\n icons: ViewStyle;\n icon: ViewStyle;\n logo: ViewStyle;\n gradient: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme) =>\n StyleSheet.create({\n container: {\n position: 'absolute',\n backgroundColor: theme.colors.white,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n height: HEADER_HEIGHT,\n top: 0,\n width: '100%'\n },\n icons: {\n flexDirection: 'row'\n },\n icon: {\n marginRight: 16\n },\n logo: {\n width: 80,\n marginLeft: 16\n },\n gradient: {\n position: 'absolute',\n left: 0,\n top: HEADER_HEIGHT,\n right: 0,\n opacity: 0.3\n }\n });\n\nconst Header = (props: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {theme} = templateContext;\n\n const {onSearchPress, onSettingsPress, onLogoLongPress} = props;\n const logoHeight = HEADER_HEIGHT - theme.spacing.small * 2;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n // ------------------------------------\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={[styleSheet.container]} testID=\"header\">\n <Gradient\n height={theme.spacing.tiny}\n colors={[theme.colors.gray.medium, theme.colors.gray.light]}\n transparencyPosition=\"bottom\"\n style={styleSheet.gradient}\n />\n <View style={styleSheet.logo}>\n <Touchable\n testID=\"header-logo\"\n onLongPress={onLogoLongPress}\n analyticsID=\"sign-out\"\n isWithoutFeedback\n >\n <BrandLogo height={logoHeight} />\n </Touchable>\n </View>\n <View style={[styleSheet.icons]}>\n <Touchable testID=\"search-icon\" onPress={onSearchPress} analyticsID=\"search-icon\">\n <SearchIcon\n height={ICON_WIDTH}\n width={ICON_WIDTH}\n color={theme.colors.gray.dark}\n style={styleSheet.icon}\n />\n </Touchable>\n <Touchable testID=\"settings-icon\" onPress={onSettingsPress} analyticsID=\"settings-icon\">\n <SettingsIcon\n height={ICON_WIDTH}\n width={ICON_WIDTH}\n color={theme.colors.gray.dark}\n style={styleSheet.icon}\n />\n </Touchable>\n </View>\n </View>\n );\n};\n\nexport default Header;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,SAAzB,QAAyC,OAAzC;AAEA,SAAQC,IAA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kBG,IAH3B;IAIE,KAAK,EAAEb,UAAU,CAACX;EAJpB,EADF,CADF,eASE,oBAAC,SAAD;IAAW,MAAM,EAAC,eAAlB;IAAkC,OAAO,EAAEc,eAA3C;IAA4D,WAAW,EAAC;EAAxE,gBACE,oBAAC,YAAD;IACE,MAAM,EAAE9B,UADV;IAEE,KAAK,EAAEA,UAFT;IAGE,KAAK,EAAEE,KAAK,CAACK,MAAN,CAAa8B,IAAb,CAAkBG,IAH3B;IAIE,KAAK,EAAEb,UAAU,CAACX;EAJpB,EADF,CATF,CAjBF,CADF;AAsCD,CAzDD;;AA2DA,eAAeQ,MAAf"}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
import { Theme } from '../../variables/theme.native';
|
|
4
|
+
interface ButtonProps {
|
|
5
|
+
title: string;
|
|
6
|
+
testID: string;
|
|
7
|
+
selected: boolean;
|
|
8
|
+
Icon: FC<{
|
|
9
|
+
height: number;
|
|
10
|
+
width: number;
|
|
11
|
+
color?: string;
|
|
12
|
+
}>;
|
|
13
|
+
styles: StyleSheetType;
|
|
14
|
+
theme: Theme;
|
|
15
|
+
}
|
|
2
16
|
export declare type NavItemType = {
|
|
3
17
|
label: string;
|
|
4
|
-
icon:
|
|
18
|
+
icon: ButtonProps['Icon'];
|
|
5
19
|
onPress: () => void;
|
|
6
20
|
};
|
|
7
21
|
export interface Props {
|
|
@@ -9,6 +23,14 @@ export interface Props {
|
|
|
9
23
|
items: Array<NavItemType>;
|
|
10
24
|
selectedItemIndex: number;
|
|
11
25
|
}
|
|
26
|
+
declare type StyleSheetType = {
|
|
27
|
+
main: ViewStyle;
|
|
28
|
+
container: ViewStyle;
|
|
29
|
+
button: ViewStyle;
|
|
30
|
+
buttonText: TextStyle;
|
|
31
|
+
dot: ViewStyle;
|
|
32
|
+
blur: ViewStyle;
|
|
33
|
+
};
|
|
12
34
|
declare const NavigationBar: ({ items, selectedItemIndex }: Props) => JSX.Element | null;
|
|
13
35
|
export default NavigationBar;
|
|
14
36
|
//# sourceMappingURL=index.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/mobile-navigation/index.native.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/mobile-navigation/index.native.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAsB,EAAE,EAAC,MAAM,OAAO,CAAC;AACrD,OAAO,EAAyB,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAM1E,OAAO,EAAC,KAAK,EAAC,MAAM,8BAA8B,CAAC;AAEnD,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAC1D,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,oBAAY,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,WAAW,KAAK;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,aAAK,cAAc,GAAG;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE,SAAS,CAAC;IACtB,GAAG,EAAE,SAAS,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAsEF,QAAA,MAAM,aAAa,iCAAgC,KAAK,uBAoCvD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","View","StyleSheet","Text","BlurView","NovaCompositionNavigationNavBar","BlurredShadow","useTemplateContext","createStyleSheet","theme","create","main","marginHorizontal","container","position","bottom","width","flexDirection","justifyContent","alignSelf","overflow","height","borderRadius","backgroundColor","colors","gray","light","button","alignItems","flex","marginTop","spacing","small","buttonText","fontSize","lineHeight","color","text","primary","dot","cta","blur","transform","rotateX","scaleX","Button","testID","title","selected","Icon","styles","NavigationBar","items","selectedItemIndex","templateContext","styleSheet","setStylesheet","_stylesheet","map","prop","index","label","icon"],"sources":["../../../src/organism/mobile-navigation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle} from 'react-native';\nimport {BlurView} from '@react-native-community/blur';\n\nimport {NovaCompositionNavigationNavBar as BlurredShadow} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\nexport type NavItemType = {\n label: string;\n icon:
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","View","StyleSheet","Text","BlurView","NovaCompositionNavigationNavBar","BlurredShadow","useTemplateContext","createStyleSheet","theme","create","main","marginHorizontal","container","position","bottom","width","flexDirection","justifyContent","alignSelf","overflow","height","borderRadius","backgroundColor","colors","gray","light","button","alignItems","flex","marginTop","spacing","small","buttonText","fontSize","lineHeight","color","text","primary","dot","cta","blur","transform","rotateX","scaleX","Button","testID","title","selected","Icon","styles","NavigationBar","items","selectedItemIndex","templateContext","styleSheet","setStylesheet","_stylesheet","map","prop","index","label","icon"],"sources":["../../../src/organism/mobile-navigation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect, FC} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle} from 'react-native';\nimport {BlurView} from '@react-native-community/blur';\n\nimport {NovaCompositionNavigationNavBar as BlurredShadow} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\ninterface ButtonProps {\n title: string;\n testID: string;\n selected: boolean;\n Icon: FC<{height: number; width: number; color?: string}>;\n styles: StyleSheetType;\n theme: Theme;\n}\n\nexport type NavItemType = {\n label: string;\n icon: ButtonProps['Icon'];\n onPress: () => void;\n};\n\nexport interface Props {\n testID?: string;\n items: Array<NavItemType>;\n selectedItemIndex: number;\n}\n\ntype StyleSheetType = {\n main: ViewStyle;\n container: ViewStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n dot: ViewStyle;\n blur: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n main: {\n marginHorizontal: 20\n },\n container: {\n position: 'absolute',\n bottom: 34,\n width: '100%',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignSelf: 'center',\n overflow: 'hidden',\n height: 66,\n borderRadius: 12,\n backgroundColor: theme.colors.gray.light\n },\n button: {\n alignItems: 'center',\n flex: 1,\n height: '100%',\n marginTop: theme.spacing.small\n },\n buttonText: {\n fontSize: theme.fontSize.small,\n lineHeight: 26,\n // height: 11,\n color: theme.colors.text.primary\n },\n\n dot: {\n width: 8,\n height: 8,\n borderRadius: 8,\n backgroundColor: theme.colors.cta,\n marginTop: 3,\n position: 'absolute',\n alignSelf: 'center'\n },\n blur: {\n marginTop: -87,\n width: 200,\n height: 100,\n position: 'absolute',\n alignSelf: 'center',\n transform: [{rotateX: '180deg'}, {scaleX: 0.7}]\n }\n });\n\nconst Button = ({testID, title, selected, Icon, styles, theme}: ButtonProps) => (\n <View testID={testID} style={styles.button}>\n <View style={{alignItems: 'center'}}>\n <Icon\n height={16}\n width={16}\n color={selected ? theme.colors.cta : theme.colors.text.primary}\n />\n <Text style={styles.buttonText}>{title}</Text>\n </View>\n {selected ? (\n <View>\n <View style={styles.dot} />\n <BlurredShadow color={theme.colors.cta} style={styles.blur} />\n </View>\n ) : null}\n </View>\n);\n\nconst NavigationBar = ({items, selectedItemIndex}: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {theme} = templateContext;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.main}>\n <BlurView\n style={styleSheet.container}\n blurAmount={32}\n reducedTransparencyFallbackColor=\"rgba(17, 17, 23, 0.5)\"\n />\n <View style={styleSheet.container}>\n {items.map((prop, index) => (\n <Button\n key={`button-${prop.label}`}\n title={prop.label}\n Icon={prop.icon}\n selected={index === selectedItemIndex}\n testID={`navigationButton_${index}`}\n styles={styleSheet}\n theme={theme}\n />\n ))}\n </View>\n </View>\n );\n};\n\nexport default NavigationBar;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,SAAzB,QAA6C,OAA7C;AACA,SAAQC,IAAR,EAAcC,UAAd,EAA0BC,IAA1B,QAA2D,cAA3D;AACA,SAAQC,QAAR,QAAuB,8BAAvB;AAEA,SAAQC,+BAA+B,IAAIC,aAA3C,QAA+D,0BAA/D;AAEA,SAAQC,kBAAR,QAAiC,4CAAjC;;AAiCA,MAAMC,gBAAgB,GAAIC,KAAD,IACvBP,UAAU,CAACQ,MAAX,CAAkB;EAChBC,IAAI,EAAE;IACJC,gBAAgB,EAAE;EADd,CADU;EAIhBC,SAAS,EAAE;IACTC,QAAQ,EAAE,UADD;IAETC,MAAM,EAAE,EAFC;IAGTC,KAAK,EAAE,MAHE;IAITC,aAAa,EAAE,KAJN;IAKTC,cAAc,EAAE,eALP;IAMTC,SAAS,EAAE,QANF;IAOT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C,KAAK,CAACM,GAAN,CAAU,CAACC,IAAD,EAAOC,KAAP,kBACT,oBAAC,MAAD;IACE,GAAG,EAAG,UAASD,IAAI,CAACE,KAAM,EAD5B;IAEE,KAAK,EAAEF,IAAI,CAACE,KAFd;IAGE,IAAI,EAAEF,IAAI,CAACG,IAHb;IAIE,QAAQ,EAAEF,KAAK,KAAKP,iBAJtB;IAKE,MAAM,EAAG,oBAAmBO,KAAM,EALpC;IAME,MAAM,EAAEL,UANV;IAOE,KAAK,EAAE9C;EAPT,EADD,CADH,CANF,CADF;AAsBD,CApCD;;AAsCA,eAAe0C,aAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAC,gBAAgB,EAAa,MAAM,cAAc,CAAC;AAuL1D,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBAyCrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -13,6 +13,7 @@ const CorrectionPopin = ({
|
|
|
13
13
|
correctionPopinProps,
|
|
14
14
|
slideIndex,
|
|
15
15
|
showCorrectionPopin,
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
17
|
animateCorrectionPopin
|
|
17
18
|
}) => {
|
|
18
19
|
if (!showCorrectionPopin) return null;
|
|
@@ -37,7 +38,7 @@ const CorrectionPopin = ({
|
|
|
37
38
|
type: correctionPopinProps.type,
|
|
38
39
|
resultLabel: correctionPopinProps.resultLabel
|
|
39
40
|
};
|
|
40
|
-
return /*#__PURE__*/React.createElement(Text, null, "ReviewCorrectionPopin") // <ReviewCorrectionPopin {..._correctionPopinProps} />
|
|
41
|
+
return /*#__PURE__*/React.createElement(Text, null, "@todo ReviewCorrectionPopin ", _correctionPopinProps.toString()) // <ReviewCorrectionPopin {..._correctionPopinProps} />
|
|
41
42
|
;
|
|
42
43
|
}; // const ValidateButton = ({slideIndex, validateButton, primarySkinColor}) => {
|
|
43
44
|
// const {label, onClick, disabled} = validateButton;
|
|
@@ -89,7 +90,7 @@ const createQuestionStyle = (theme, brandTheme) => StyleSheet.create({
|
|
|
89
90
|
justifyContent: 'center'
|
|
90
91
|
},
|
|
91
92
|
validateButton: {
|
|
92
|
-
backgroundColor: brandTheme?.colors
|
|
93
|
+
backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,
|
|
93
94
|
borderRadius: 7,
|
|
94
95
|
width: '100%'
|
|
95
96
|
},
|
|
@@ -114,7 +115,7 @@ const Question = props => {
|
|
|
114
115
|
theme,
|
|
115
116
|
brandTheme
|
|
116
117
|
} = useTemplateContext();
|
|
117
|
-
const [style, setStyle] = useState(
|
|
118
|
+
const [style, setStyle] = useState();
|
|
118
119
|
useEffect(() => {
|
|
119
120
|
const questionStyle = createQuestionStyle(theme, brandTheme);
|
|
120
121
|
setStyle(questionStyle);
|
|
@@ -137,7 +138,7 @@ const Question = props => {
|
|
|
137
138
|
}, "@todo validate")));
|
|
138
139
|
};
|
|
139
140
|
|
|
140
|
-
const createSlideStyle = (num, screenWidth
|
|
141
|
+
const createSlideStyle = (num, screenWidth) => {
|
|
141
142
|
const slideWidth = screenWidth - 40 - num * 8;
|
|
142
143
|
return StyleSheet.create({
|
|
143
144
|
slide: {
|
|
@@ -167,16 +168,14 @@ const createSlideStyle = (num, screenWidth, screenHeight) => {
|
|
|
167
168
|
const Slide = props => {
|
|
168
169
|
const {
|
|
169
170
|
slide,
|
|
170
|
-
validateButton,
|
|
171
171
|
correctionPopinProps,
|
|
172
172
|
num,
|
|
173
173
|
slideIndex = '0'
|
|
174
174
|
} = props;
|
|
175
175
|
const {
|
|
176
|
-
width
|
|
177
|
-
height
|
|
176
|
+
width
|
|
178
177
|
} = useWindowDimensions();
|
|
179
|
-
const slideStyle = createSlideStyle(num, width
|
|
178
|
+
const slideStyle = createSlideStyle(num, width);
|
|
180
179
|
const {
|
|
181
180
|
loading,
|
|
182
181
|
parentContentTitle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","StyleSheet","useWindowDimensions","View","get","getOr","Text","Answer","useTemplateContext","Touchable","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","klf","information","label","message","next","_correctionPopinProps","onClick","console","log","type","resultLabel","createQuestionStyle","theme","brandTheme","create","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","width","validateButton","backgroundColor","borderRadius","validateButtonText","white","Question","props","answerUI","style","setStyle","questionStyle","createSlideStyle","num","screenWidth","screenHeight","slideWidth","slide","position","left","bottom","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","slideStyle","loading","parentContentTitle"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useMemo, useState} from 'react';\nimport {StyleSheet, useWindowDimensions, View, ViewStyle} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\n// import Loader from '../../atom/loader';\n// import ReviewCorrectionPopin from '../../molecule/review-correction-popin';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {ReviewCorrectionPopinProps} from '../../molecule/review-correction-popin/prop-types';\nimport {ReviewSlideProps, SlideProps} from './prop-types';\n\ntype PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: unknown;\n showCorrectionPopin: unknown;\n animateCorrectionPopin: unknown;\n};\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n if (!showCorrectionPopin) return null;\n\n const klf = getOr({}, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick: () => {\n // eslint-disable-next-line no-console\n console.log('Next Slide');\n },\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n return (\n <Text>ReviewCorrectionPopin</Text>\n // <ReviewCorrectionPopin {..._correctionPopinProps} />\n );\n};\n\n// const ValidateButton = ({slideIndex, validateButton, primarySkinColor}) => {\n// const {label, onClick, disabled} = validateButton;\n// const validateButtonProps = {\n// type: 'primary',\n// label,\n// 'aria-label': label,\n// 'data-name': `slide-validate-button-${slideIndex}`,\n// onClick,\n// disabled,\n// customStyle: {\n// backgroundColor: primarySkinColor\n// }\n// };\n\n// return <Button title=\"validate todo\" />;\n// };\n\nconst createQuestionStyle = (theme: Theme, brandTheme: any) =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n },\n validateButton: {\n backgroundColor: brandTheme?.colors.primary || theme.colors.text.primary,\n borderRadius: 7,\n width: '100%'\n },\n validateButtonText: {\n fontSize: 14,\n lineHeight: 20,\n fontWeight: '700',\n color: theme.colors.white,\n marginBottom: 16,\n marginTop: 16,\n textAlign: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme, brandTheme} = useTemplateContext();\n const [style, setStyle] = useState<any | null>(null);\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme, brandTheme);\n setStyle(questionStyle);\n }, [theme, brandTheme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n <Touchable style={style.validateButton}>\n <Text style={style.validateButtonText}>@todo validate</Text>\n </Touchable>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number, screenHeight: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {slide, validateButton, correctionPopinProps, num, slideIndex = '0'} = props;\n\n const {width, height} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width, height);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n return (\n <View style={slideStyle.slide}>\n {loading ? (\n // <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n <Text>@todo loader {num}</Text>\n ) : (\n <>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </>\n )}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAAmCC,QAAnC,QAAkD,OAAlD;AACA,SAAQC,UAAR,EAAoBC,mBAApB,EAAyCC,IAAzC,QAA+D,cAA/D;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,IAAP,MAAiB,8BAAjB;AACA,OAAOC,MAAP,MAAmB,oCAAnB,C,CACA;AACA;;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,SAAP,MAAsB,kCAAtB;;AAWA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKN;EAChB,IAAI,CAACD,mBAAL,EAA0B,OAAO,IAAP;EAE1B,MAAME,GAAG,GAAGV,KAAK,CAAC,EAAD,EAAK,KAAL,EAAYM,oBAAZ,CAAjB;EACA,MAAMK,WAAW,GAAGX,KAAK,CAAC;IAACY,KAAK,EAAE,EAAR;IAAYC,OAAO,EAAE;EAArB,CAAD,EAA2B,aAA3B,EAA0CP,oBAA1C,CAAzB;EACA,MAAMQ,IAAI,GAAGf,GAAG,CAAC,MAAD,EAASO,oBAAT,CAAhB;EAEA,MAAMS,qBAAqB,GAAG;IAC5BD,IAAI,EAAE;MACJE,OAAO,EAAE,MAAM;QACb;QACAC,OAAO,CAACC,G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;;AAwBA,MAAM0B,KAAK,GAAItB,KAAD,IAA6B;EACzC,MAAM;IAACU,KAAD;IAAQhB,cAAR;IAAwB1C,oBAAxB;IAA8CsD,GAA9C;IAAmDrD,UAAU,GAAG;EAAhE,IAAuE+C,KAA7E;EAEA,MAAM;IAACP,KAAD;IAAQqB;EAAR,IAAkBvE,mBAAmB,EAA3C;EACA,MAAMgF,UAAU,GAAGlB,gBAAgB,CAACC,GAAD,EAAMb,KAAN,EAAaqB,MAAb,CAAnC;EAEA,MAAM;IACJU,OADI;IAEJC,kBAFI;IAGJvC,YAHI;IAIJe,QAJI;IAKJ/C,mBALI;IAMJC;EANI,IAOFuD,KAPJ;EASA,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAEa,UAAU,CAACb;EAAxB,GACGc,OAAO;EAAA;EACN;EACA,oBAAC,IAAD,yBAAoBlB,GAApB,CAFM,gBAIN,uDACE,oBAAC,QAAD;IACE,cAAc,EAAEmB,kBADlB;IAEE,YAAY,EAAEvC,YAFhB;IAGE,QAAQ,EAAEe,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,EAOGjD,oBAAoB,gBACnB,oBAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IAfN,CALJ,CADF;AA0BD,CAzCD;;AA2CA,eAAemE,KAAf"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","StyleSheet","useWindowDimensions","View","get","getOr","Text","Answer","useTemplateContext","Touchable","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","klf","information","label","message","next","_correctionPopinProps","onClick","console","log","type","resultLabel","toString","createQuestionStyle","theme","brandTheme","create","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","width","validateButton","backgroundColor","borderRadius","validateButtonText","white","Question","props","answerUI","style","setStyle","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","position","left","bottom","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","slideStyle","loading","parentContentTitle"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, TextStyle, useWindowDimensions, View, ViewStyle} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\n// import Loader from '../../atom/loader';\n// import ReviewCorrectionPopin from '../../molecule/review-correction-popin';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {ReviewCorrectionPopinProps} from '../../molecule/review-correction-popin/prop-types';\nimport {ReviewSlideProps, SlideProps} from './prop-types';\n\ntype PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: unknown;\n showCorrectionPopin: unknown;\n animateCorrectionPopin: unknown;\n};\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n animateCorrectionPopin\n}: PopinProps) => {\n if (!showCorrectionPopin) return null;\n\n const klf = getOr({}, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick: () => {\n // eslint-disable-next-line no-console\n console.log('Next Slide');\n },\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n return (\n <Text>@todo ReviewCorrectionPopin {_correctionPopinProps.toString()}</Text>\n // <ReviewCorrectionPopin {..._correctionPopinProps} />\n );\n};\n\n// const ValidateButton = ({slideIndex, validateButton, primarySkinColor}) => {\n// const {label, onClick, disabled} = validateButton;\n// const validateButtonProps = {\n// type: 'primary',\n// label,\n// 'aria-label': label,\n// 'data-name': `slide-validate-button-${slideIndex}`,\n// onClick,\n// disabled,\n// customStyle: {\n// backgroundColor: primarySkinColor\n// }\n// };\n\n// return <Button title=\"validate todo\" />;\n// };\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n validateButton: ViewStyle;\n validateButtonText: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme, brandTheme: Brand): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n },\n validateButton: {\n backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,\n borderRadius: 7,\n width: '100%'\n },\n validateButtonText: {\n fontSize: 14,\n lineHeight: 20,\n fontWeight: '700',\n color: theme.colors.white,\n marginBottom: 16,\n marginTop: 16,\n textAlign: 'center'\n }\n });\n\ntype QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme, brandTheme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme, brandTheme);\n setStyle(questionStyle);\n }, [theme, brandTheme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n <Touchable style={style.validateButton}>\n <Text style={style.validateButtonText}>@todo validate</Text>\n </Touchable>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {slide, correctionPopinProps, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n return (\n <View style={slideStyle.slide}>\n {loading ? (\n // <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n <Text>@todo loader {num}</Text>\n ) : (\n <>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </>\n )}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SAAQC,UAAR,EAA+BC,mBAA/B,EAAoDC,IAApD,QAA0E,cAA1E;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,IAAP,MAAiB,8BAAjB;AACA,OAAOC,MAAP,MAAmB,oCAAnB,C,CACA;AACA;;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,SAAP,MAAsB,kCAAtB;;AAYA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvB;EACAC;AALuB,CAAD,KAMN;EAChB,IAAI,CAACD,mBAAL,EAA0B,OAAO,IAAP;EAE1B,MAAME,GAAG,GAAGV,KAAK,CAAC,EAAD,EAAK,KAAL,EAAYM,oBAAZ,CAAjB;EACA,MAAMK,WAAW,GAAGX,KAAK,CAAC;IAACY,KAAK,EAAE,EAAR;IAAYC,OAAO,EAAE;EAArB,CAAD,EAA2B,aAA3B,EAA0CP,oBAA1C,CAAzB;EACA,MAAMQ,IAAI,GAAGf,GAAG,CAAC,MAAD,EAASO,oBAAT,CAAhB;EAEA,MAAMS,qBAAqB,GAAG;IAC5BD,IAAI,EAAE;MACJE,OAAO,EAAE,MAAM;QACb;QACAC,OAAO,CAACC,GAAR,CAAY,YAAZ;MACD,CAJG;MAKJN,KAAK,EAAEE,IAAI,IAAIA,IAAI,CAACF,KALhB;MAMJ,aAAc,wBAAuBL,UAAW,EAN5C;MAOJ,cAAcO,IAAI,IAAIA,IAAI,CAAC,YAAD;IAPtB,CADsB;IAU5BJ,GAV4B;IAW5BC,WAX4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A,MAAMgF,UAAU,GAAGjB,gBAAgB,CAACC,GAAD,EAAMb,KAAN,CAAnC;EAEA,MAAM;IACJ8B,OADI;IAEJC,kBAFI;IAGJtC,YAHI;IAIJe,QAJI;IAKJhD,mBALI;IAMJC;EANI,IAOFuD,KAPJ;EASA,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAEa,UAAU,CAACb;EAAxB,GACGc,OAAO;EAAA;EACN;EACA,oBAAC,IAAD,yBAAoBjB,GAApB,CAFM,gBAIN,uDACE,oBAAC,QAAD;IACE,cAAc,EAAEkB,kBADlB;IAEE,YAAY,EAAEtC,YAFhB;IAGE,QAAQ,EAAEe,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,EAOGlD,oBAAoB,gBACnB,oBAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IAfN,CALJ,CADF;AA0BD,CAzCD;;AA2CA,eAAemE,KAAf"}
|
|
@@ -222,7 +222,7 @@ IconsPart.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
222
222
|
revival: PropTypes.bool
|
|
223
223
|
} : {};
|
|
224
224
|
|
|
225
|
-
const buildClass = (value, success, failed, loading, mode = 'default'
|
|
225
|
+
const buildClass = (value, success, failed, loading, scormStyle, mode = 'default') => {
|
|
226
226
|
if (loading && _isNil(value)) return loading;
|
|
227
227
|
if (mode === 'scorm') return scormStyle;
|
|
228
228
|
return value ? failed : success;
|
|
@@ -251,7 +251,7 @@ const renderIconStatusScorm = failed => {
|
|
|
251
251
|
}));
|
|
252
252
|
};
|
|
253
253
|
|
|
254
|
-
const buildDefaultOrScormStyle = (defaultStyle, mode = 'default',
|
|
254
|
+
const buildDefaultOrScormStyle = (defaultStyle, styleScorm, failed, mode = 'default', failedStyle = null) => {
|
|
255
255
|
if (mode === 'scorm' && failed && failedStyle) return failedStyle;
|
|
256
256
|
if (mode === 'scorm') return styleScorm;
|
|
257
257
|
return defaultStyle;
|
|
@@ -271,12 +271,12 @@ const CorrectionPart = props => {
|
|
|
271
271
|
|
|
272
272
|
const isLoading = _isNil(failed);
|
|
273
273
|
|
|
274
|
-
const className = buildClass(failed, stars && rank ? style.correctionSectionEndSuccess : style.correctionSectionSuccess, gameOver ? style.correctionSectionFailGameOver : style.correctionSectionFail, style.correctionSectionLoading,
|
|
274
|
+
const className = buildClass(failed, stars && rank ? style.correctionSectionEndSuccess : style.correctionSectionSuccess, gameOver ? style.correctionSectionFailGameOver : style.correctionSectionFail, style.correctionSectionLoading, style.resultContenantContainerScorm, mode);
|
|
275
275
|
return /*#__PURE__*/React.createElement("div", {
|
|
276
276
|
"data-name": "correctionSection",
|
|
277
277
|
className: className
|
|
278
278
|
}, mode === 'scorm' && !isLoading && renderIconStatusScorm(failed), /*#__PURE__*/React.createElement("div", {
|
|
279
|
-
className: buildDefaultOrScormStyle(style.titlesWrapper,
|
|
279
|
+
className: buildDefaultOrScormStyle(style.titlesWrapper, style.titlesWrapperScorm, failed, mode)
|
|
280
280
|
}, isLoading ? /*#__PURE__*/React.createElement(Loader, null) : null, /*#__PURE__*/React.createElement("h1", {
|
|
281
281
|
"data-name": "title",
|
|
282
282
|
className: buildDefaultOrScormStyle(classnames(style.title, style.innerHTML), mode, style.resultTitleScorm, failed) // eslint-disable-next-line react/no-danger
|