@coorpacademy/components 10.29.7 → 10.29.9-alpha.9
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 +3 -2
- package/es/atom/choice/index.native.js.map +1 -1
- package/es/atom/html/index.native.d.ts +1 -1
- package/es/atom/html/index.native.d.ts.map +1 -1
- package/es/atom/html/index.native.js +24 -5
- package/es/atom/html/index.native.js.map +1 -1
- package/es/molecule/review-correction-popin/index.js +4 -2
- package/es/molecule/review-correction-popin/index.js.map +1 -1
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +30 -14
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/mooc-header/style.css +26 -12
- package/es/organism/review-congrats/index.d.ts.map +1 -1
- package/es/organism/review-congrats/index.js +5 -3
- package/es/organism/review-congrats/index.js.map +1 -1
- package/es/organism/review-header/index.js +1 -1
- package/es/organism/review-header/index.js.map +1 -1
- package/es/organism/review-slide/index.d.ts.map +1 -1
- package/es/organism/review-slide/index.js +5 -3
- package/es/organism/review-slide/index.js.map +1 -1
- package/es/template/app-review/player/index.js +2 -2
- package/es/template/app-review/player/index.js.map +1 -1
- package/lib/atom/choice/index.native.d.ts.map +1 -1
- package/lib/atom/choice/index.native.js +7 -5
- package/lib/atom/choice/index.native.js.map +1 -1
- package/lib/atom/html/index.native.d.ts +1 -1
- package/lib/atom/html/index.native.d.ts.map +1 -1
- package/lib/atom/html/index.native.js +23 -4
- package/lib/atom/html/index.native.js.map +1 -1
- package/lib/molecule/review-correction-popin/index.js +4 -2
- package/lib/molecule/review-correction-popin/index.js.map +1 -1
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +27 -13
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/mooc-header/style.css +26 -12
- package/lib/organism/review-congrats/index.d.ts.map +1 -1
- package/lib/organism/review-congrats/index.js +5 -3
- package/lib/organism/review-congrats/index.js.map +1 -1
- package/lib/organism/review-header/index.js +1 -1
- package/lib/organism/review-header/index.js.map +1 -1
- package/lib/organism/review-slide/index.d.ts.map +1 -1
- package/lib/organism/review-slide/index.js +5 -3
- package/lib/organism/review-slide/index.js.map +1 -1
- package/lib/template/app-review/player/index.js +2 -2
- package/lib/template/app-review/player/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
height: 100%;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.
|
|
71
|
+
.navMobile {
|
|
72
72
|
display: none;
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -108,9 +108,28 @@
|
|
|
108
108
|
transition: transform 0.3s;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
.
|
|
111
|
+
.burger {
|
|
112
|
+
margin: 0 20px 0 0;
|
|
113
|
+
color: medium;
|
|
114
|
+
width: 25px;
|
|
115
|
+
height: 25px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.burgerHidden {
|
|
112
119
|
composes: caret;
|
|
113
|
-
|
|
120
|
+
display: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.close {
|
|
124
|
+
margin: 0 20px 0 0;
|
|
125
|
+
color: medium;
|
|
126
|
+
width: 25px;
|
|
127
|
+
height: 25px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.closeHidden {
|
|
131
|
+
composes: close;
|
|
132
|
+
display: none;
|
|
114
133
|
}
|
|
115
134
|
|
|
116
135
|
.optionsGroup {
|
|
@@ -498,7 +517,7 @@
|
|
|
498
517
|
height: 100%;
|
|
499
518
|
}
|
|
500
519
|
|
|
501
|
-
.
|
|
520
|
+
.navMobile {
|
|
502
521
|
display: none;
|
|
503
522
|
}
|
|
504
523
|
|
|
@@ -532,14 +551,14 @@
|
|
|
532
551
|
.logoWrapper {
|
|
533
552
|
background-color: white;
|
|
534
553
|
z-index: 2;
|
|
535
|
-
margin: 0 8px;
|
|
554
|
+
margin: 0 8px 0 0;
|
|
536
555
|
}
|
|
537
556
|
|
|
538
557
|
.logo {
|
|
539
558
|
display: none;
|
|
540
559
|
}
|
|
541
560
|
|
|
542
|
-
.
|
|
561
|
+
.navMobile {
|
|
543
562
|
display: flex;
|
|
544
563
|
align-items: center;
|
|
545
564
|
cursor: pointer;
|
|
@@ -551,7 +570,7 @@
|
|
|
551
570
|
min-height: 30px;
|
|
552
571
|
}
|
|
553
572
|
|
|
554
|
-
.
|
|
573
|
+
.navMobile img {
|
|
555
574
|
height: auto;
|
|
556
575
|
max-height: 50px;
|
|
557
576
|
width: auto;
|
|
@@ -560,11 +579,6 @@
|
|
|
560
579
|
align-self: center;
|
|
561
580
|
}
|
|
562
581
|
|
|
563
|
-
.logoMobile .notifications {
|
|
564
|
-
top: 5px;
|
|
565
|
-
right: 10px;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
582
|
.hiddenMenuWrapper {
|
|
569
583
|
display: none;
|
|
570
584
|
top: 0px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/review-congrats/index.js"],"names":[],"mappings":"AAOO,sDAMN;;AAED,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/review-congrats/index.js"],"names":[],"mappings":"AAOO,sDAMN;;AAED,yDAsEC"}
|
|
@@ -32,7 +32,8 @@ const ReviewCongrats = props => {
|
|
|
32
32
|
return /*#__PURE__*/React.createElement("div", {
|
|
33
33
|
className: style.mainContainer,
|
|
34
34
|
"aria-label": ariaLabel,
|
|
35
|
-
"data-name": dataName
|
|
35
|
+
"data-name": dataName,
|
|
36
|
+
"data-testid": "congrats"
|
|
36
37
|
}, /*#__PURE__*/React.createElement(AtomLottieWrapper, _extends({}, animationLottie, {
|
|
37
38
|
loop: false,
|
|
38
39
|
animationControl: 'play',
|
|
@@ -58,9 +59,10 @@ const ReviewCongrats = props => {
|
|
|
58
59
|
className: style.buttonContainer
|
|
59
60
|
}, buttonRevising ? /*#__PURE__*/React.createElement(ButtonLink, _extends({}, buttonRevising, {
|
|
60
61
|
className: style.buttonRevise,
|
|
61
|
-
"data-
|
|
62
|
+
"data-testid": "revise-skill-link"
|
|
62
63
|
})) : null, buttonRevisingSkill ? /*#__PURE__*/React.createElement(ButtonLink, _extends({}, buttonRevisingSkill, {
|
|
63
|
-
className: style.buttonRevise
|
|
64
|
+
className: style.buttonRevise,
|
|
65
|
+
"data-testid": "revise-another-skill-link"
|
|
64
66
|
})) : null)));
|
|
65
67
|
};
|
|
66
68
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useEffect","useRef","AtomLottieWrapper","ButtonLink","MoleculeReviewCardCongrats","style","propTypes","setScroll","container","current","scrollTo","left","behavior","ReviewCongrats","props","ariaLabel","dataName","animationLottie","title","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","timer","setTimeout","clearTimeout","mainContainer","lottie","ie11Backup","containerCongrats","containerCards","cardStar","cardRank","cardStarNoRank","buttonContainer","buttonRevise"],"sources":["../../../src/organism/review-congrats/index.js"],"sourcesContent":["import React, {useEffect, useRef} from 'react';\nimport AtomLottieWrapper from '../../atom/lottie-wrapper';\nimport ButtonLink from '../../atom/button-link';\nimport MoleculeReviewCardCongrats from '../../molecule/review-card-congrats';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nexport const setScroll = container => () => {\n container.current?.scrollTo &&\n container.current.scrollTo({\n left: 1000,\n behavior: 'smooth'\n });\n};\n\nconst ReviewCongrats = props => {\n const {\n 'aria-label': ariaLabel,\n 'data-name': dataName,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const container = useRef(null);\n\n useEffect(() => {\n const timer = setTimeout(setScroll(container), 2000);\n return () => timer && clearTimeout(timer);\n }, []);\n\n return (\n <div
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useEffect","useRef","AtomLottieWrapper","ButtonLink","MoleculeReviewCardCongrats","style","propTypes","setScroll","container","current","scrollTo","left","behavior","ReviewCongrats","props","ariaLabel","dataName","animationLottie","title","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","timer","setTimeout","clearTimeout","mainContainer","lottie","ie11Backup","containerCongrats","containerCards","cardStar","cardRank","cardStarNoRank","buttonContainer","buttonRevise"],"sources":["../../../src/organism/review-congrats/index.js"],"sourcesContent":["import React, {useEffect, useRef} from 'react';\nimport AtomLottieWrapper from '../../atom/lottie-wrapper';\nimport ButtonLink from '../../atom/button-link';\nimport MoleculeReviewCardCongrats from '../../molecule/review-card-congrats';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nexport const setScroll = container => () => {\n container.current?.scrollTo &&\n container.current.scrollTo({\n left: 1000,\n behavior: 'smooth'\n });\n};\n\nconst ReviewCongrats = props => {\n const {\n 'aria-label': ariaLabel,\n 'data-name': dataName,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const container = useRef(null);\n\n useEffect(() => {\n const timer = setTimeout(setScroll(container), 2000);\n return () => timer && clearTimeout(timer);\n }, []);\n\n return (\n <div\n className={style.mainContainer}\n aria-label={ariaLabel}\n data-name={dataName}\n data-testid=\"congrats\"\n >\n <AtomLottieWrapper\n {...animationLottie}\n loop={false}\n animationControl={'play'}\n autoplay\n data-name=\"lottie-wrapper\"\n className={style.lottie}\n backupImageClassName={style.ie11Backup}\n />\n <div className={style.containerCongrats}>\n <div className={style.title}>{title}</div>\n <div ref={container} className={style.containerCards}>\n {cardCongratsRank ? (\n <>\n <MoleculeReviewCardCongrats {...cardCongratsStar} className={style.cardStar} />\n <MoleculeReviewCardCongrats\n {...cardCongratsRank}\n timerAnimation={1800}\n className={style.cardRank}\n />\n </>\n ) : (\n <MoleculeReviewCardCongrats {...cardCongratsStar} className={style.cardStarNoRank} />\n )}\n </div>\n <div className={style.buttonContainer}>\n {buttonRevising ? (\n <ButtonLink\n {...buttonRevising}\n className={style.buttonRevise}\n data-testid=\"revise-skill-link\"\n />\n ) : null}\n {buttonRevisingSkill ? (\n <ButtonLink\n {...buttonRevisingSkill}\n className={style.buttonRevise}\n data-testid=\"revise-another-skill-link\"\n />\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nReviewCongrats.propTypes = propTypes;\n\nexport default ReviewCongrats;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,MAA1B,QAAuC,OAAvC;AACA,OAAOC,iBAAP,MAA8B,2BAA9B;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,0BAAP,MAAuC,qCAAvC;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,cAAtB;AAEA,OAAO,MAAMC,SAAS,GAAGC,SAAS,IAAI,MAAM;EAC1CA,SAAS,CAACC,OAAV,EAAmBC,QAAnB,IACEF,SAAS,CAACC,OAAV,CAAkBC,QAAlB,CAA2B;IACzBC,IAAI,EAAE,IADmB;IAEzBC,QAAQ,EAAE;EAFe,CAA3B,CADF;AAKD,CANM;;AAQP,MAAMC,cAAc,GAAGC,KAAK,IAAI;EAC9B,MAAM;IACJ,cAAcC,SADV;IAEJ,aAAaC,QAFT;IAGJC,eAHI;IAIJC,KAJI;IAKJC,gBALI;IAMJC,gBANI;IAOJC,cAPI;IAQJC;EARI,IASFR,KATJ;EAWA,MAAMN,SAAS,GAAGP,MAAM,CAAC,IAAD,CAAxB;EAEAD,SAAS,CAAC,MAAM;IACd,MAAMuB,KAAK,GAAGC,UAAU,CAACjB,SAAS,CAACC,SAAD,CAAV,EAAuB,IAAvB,CAAxB;IACA,OAAO,MAAMe,KAAK,IAAIE,YAAY,CAACF,KAAD,CAAlC;EACD,CAHQ,EAGN,EAHM,CAAT;EAKA,oBACE;IACE,SAAS,EAAElB,KAAK,CAACqB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|
|
56
56
|
})), /*#__PURE__*/React.createElement("div", {
|
|
57
57
|
className: style.iconButtonWrapper,
|
|
58
|
-
"data-
|
|
58
|
+
"data-testid": "review-header-close-button-wrapper"
|
|
59
59
|
}, /*#__PURE__*/React.createElement(ButtonLinkIconOnly, buttonProps)));
|
|
60
60
|
};
|
|
61
61
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","classnames","getOr","ButtonLinkIconOnly","ReviewHeaderSteps","style","propTypes","ReviewHeader","props","context","steps","mode","skillName","ariaLabel","closeButtonAriaLabel","onQuitClick","hiddenSteps","skin","primarySkinColor","buttonProps","icon","onClick","size","className","review","stepsWrapper","stepsWrapperAnimation","headerWrapper","titlesWrapper","title","color","iconButtonWrapper"],"sources":["../../../src/organism/review-header/index.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport getOr from 'lodash/fp/getOr';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport ReviewHeaderSteps from '../../molecule/review-header-steps';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst ReviewHeader = (props, context) => {\n const {\n steps,\n mode,\n skillName,\n 'aria-label': ariaLabel,\n closeButtonAriaLabel,\n onQuitClick,\n hiddenSteps\n } = props;\n const {skin} = context;\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const buttonProps = {\n icon: 'close',\n 'data-name': 'review-header-close-button',\n 'aria-label': closeButtonAriaLabel,\n onClick: onQuitClick,\n size: 'responsive',\n className: style.review\n };\n\n const stepsWrapper = classnames(\n style.stepsWrapper,\n hiddenSteps ? style.stepsWrapperAnimation : null\n );\n\n return (\n <div className={style.headerWrapper} data-name=\"review-header\" aria-label={ariaLabel}>\n <div className={style.titlesWrapper}>\n <div className={style.title} title={mode} aria-label={mode} data-name=\"review-header-mode\">\n {mode}\n </div>\n <div\n className={style.skillName}\n style={{\n color: primarySkinColor\n }}\n title={skillName}\n aria-label={skillName}\n data-name=\"review-header-skill-name\"\n >\n {skillName}\n </div>\n </div>\n\n <div className={stepsWrapper}>\n <ReviewHeaderSteps steps={steps} key={'review-header-steps'} />\n </div>\n\n <div className={style.iconButtonWrapper} data-
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classnames","getOr","ButtonLinkIconOnly","ReviewHeaderSteps","style","propTypes","ReviewHeader","props","context","steps","mode","skillName","ariaLabel","closeButtonAriaLabel","onQuitClick","hiddenSteps","skin","primarySkinColor","buttonProps","icon","onClick","size","className","review","stepsWrapper","stepsWrapperAnimation","headerWrapper","titlesWrapper","title","color","iconButtonWrapper"],"sources":["../../../src/organism/review-header/index.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport getOr from 'lodash/fp/getOr';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport ReviewHeaderSteps from '../../molecule/review-header-steps';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst ReviewHeader = (props, context) => {\n const {\n steps,\n mode,\n skillName,\n 'aria-label': ariaLabel,\n closeButtonAriaLabel,\n onQuitClick,\n hiddenSteps\n } = props;\n const {skin} = context;\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const buttonProps = {\n icon: 'close',\n 'data-name': 'review-header-close-button',\n 'aria-label': closeButtonAriaLabel,\n onClick: onQuitClick,\n size: 'responsive',\n className: style.review\n };\n\n const stepsWrapper = classnames(\n style.stepsWrapper,\n hiddenSteps ? style.stepsWrapperAnimation : null\n );\n\n return (\n <div className={style.headerWrapper} data-name=\"review-header\" aria-label={ariaLabel}>\n <div className={style.titlesWrapper}>\n <div className={style.title} title={mode} aria-label={mode} data-name=\"review-header-mode\">\n {mode}\n </div>\n <div\n className={style.skillName}\n style={{\n color: primarySkinColor\n }}\n title={skillName}\n aria-label={skillName}\n data-name=\"review-header-skill-name\"\n >\n {skillName}\n </div>\n </div>\n\n <div className={stepsWrapper}>\n <ReviewHeaderSteps steps={steps} key={'review-header-steps'} />\n </div>\n\n <div className={style.iconButtonWrapper} data-testid=\"review-header-close-button-wrapper\">\n <ButtonLinkIconOnly {...buttonProps} />\n </div>\n </div>\n );\n};\n\nReviewHeader.propTypes = propTypes;\n\nexport default ReviewHeader;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,iBAAP,MAA8B,oCAA9B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,SAAtB;;AAEA,MAAMC,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IACJC,KADI;IAEJC,IAFI;IAGJC,SAHI;IAIJ,cAAcC,SAJV;IAKJC,oBALI;IAMJC,WANI;IAOJC;EAPI,IAQFR,KARJ;EASA,MAAM;IAACS;EAAD,IAASR,OAAf;EACA,MAAMS,gBAAgB,GAAGhB,KAAK,CAAC,SAAD,EAAY,gBAAZ,EAA8Be,IAA9B,CAA9B;EAEA,MAAME,WAAW,GAAG;IAClBC,IAAI,EAAE,OADY;IAElB,aAAa,4BAFK;IAGlB,cAAcN,oBAHI;IAIlBO,OAAO,EAAEN,WAJS;IAKlBO,IAAI,EAAE,YALY;IAMlBC,SAAS,EAAElB,KAAK,CAACmB;EANC,CAApB;EASA,MAAMC,YAAY,GAAGxB,UAAU,CAC7BI,KAAK,CAACoB,YADuB,EAE7BT,WAAW,GAAGX,KAAK,CAACqB,qBAAT,GAAiC,IAFf,CAA/B;EAKA,oBACE;IAAK,SAAS,EAAErB,KAAK,CAACsB,aAAtB;IAAqC,aAAU,eAA/C;IAA+D,cAAYd;EAA3E,gBACE;IAAK,SAAS,EAAER,KAAK,CAACuB;EAAtB,gBACE;IAAK,SAAS,EAAEvB,KAAK,CAACwB,KAAtB;IAA6B,KAAK,EAAElB,IAApC;IAA0C,cAAYA,IAAtD;IAA4D,aAAU;EAAtE,GACGA,IADH,CADF,eAIE;IACE,SAAS,EAAEN,KAAK,CAACO,SADnB;IAEE,KAAK,EAAE;MACLkB,KAAK,EAAEZ;IADF,CAFT;IAKE,KAAK,EAAEN,SALT;IAME,cAAYA,SANd;IAOE,aAAU;EAPZ,GASGA,SATH,CAJF,CADF,eAkBE;IAAK,SAAS,EAAEa;EAAhB,gBACE,oBAAC,iBAAD;IAAmB,KAAK,EAAEf,KAA1B;IAAiC,GAAG,EAAE;EAAtC,EADF,CAlBF,eAsBE;IAAK,SAAS,EAAEL,KAAK,CAAC0B,iBAAtB;IAAyC,eAAY;EAArD,gBACE,oBAAC,kBAAD,EAAwBZ,WAAxB,CADF,CAtBF,CADF;AA4BD,CAvDD;;AAyDAZ,YAAY,CAACD,SAAb,2CAAyBA,SAAzB;AAEA,eAAeC,YAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.js"],"names":[],"mappings":";AA8HA,sDA8CC"}
|
|
@@ -95,12 +95,14 @@ const QuestionContainer = props => {
|
|
|
95
95
|
if (!answerUI || !questionText) return null;
|
|
96
96
|
return /*#__PURE__*/React.createElement("div", {
|
|
97
97
|
key: "content-container",
|
|
98
|
+
"data-testid": "content-container",
|
|
98
99
|
className: classnames(style.slideContentContainer, disableContent ? style.disabledSlideContent : null)
|
|
99
100
|
}, /*#__PURE__*/React.createElement("div", {
|
|
100
101
|
key: "from-course",
|
|
101
102
|
className: style.questionOrigin
|
|
102
103
|
}, questionOrigin), /*#__PURE__*/React.createElement("div", {
|
|
103
104
|
key: "title",
|
|
105
|
+
"data-testid": "slide-question",
|
|
104
106
|
className: style.question // eslint-disable-next-line react/no-danger
|
|
105
107
|
,
|
|
106
108
|
dangerouslySetInnerHTML: {
|
|
@@ -144,13 +146,13 @@ const ReviewSlide = props => {
|
|
|
144
146
|
animateCorrectionPopin
|
|
145
147
|
} = slide;
|
|
146
148
|
return /*#__PURE__*/React.createElement("div", {
|
|
147
|
-
"data-
|
|
149
|
+
"data-testid": "review-slide",
|
|
148
150
|
className: style.slide
|
|
149
151
|
}, loading ? /*#__PURE__*/React.createElement(Loader, {
|
|
150
152
|
className: style.loader,
|
|
151
153
|
theme: "default",
|
|
152
154
|
"aria-label": loadingAriaLabel
|
|
153
|
-
}) :
|
|
155
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(QuestionContainer, {
|
|
154
156
|
questionOrigin: parentContentTitle,
|
|
155
157
|
questionText: questionText,
|
|
156
158
|
answerUI: answerUI,
|
|
@@ -167,7 +169,7 @@ const ReviewSlide = props => {
|
|
|
167
169
|
showCorrectionPopin: showCorrectionPopin,
|
|
168
170
|
animateCorrectionPopin: animateCorrectionPopin,
|
|
169
171
|
key: "correction-popin"
|
|
170
|
-
})
|
|
172
|
+
})));
|
|
171
173
|
};
|
|
172
174
|
|
|
173
175
|
ReviewSlide.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","get","getOr","Answer","ButtonLink","Loader","ReviewCorrectionPopin","GetSkinFromContext","propTypes","style","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","klf","information","label","message","next","onClick","_correctionPopinProps","type","resultLabel","correctionPopinWrapper","popinAnimation","string","bool","ValidateButton","validateButton","primarySkinColor","disabled","validateButtonProps","className","customStyle","backgroundColor","validateButtonWrapper","QuestionContainer","props","answerUI","questionText","questionOrigin","disableContent","slideContentContainer","disabledSlideContent","question","__html","help","answerContainer","shape","slide","ReviewSlide","skin","loading","loadingAriaLabel","parentContentTitle","disabledContent","loader"],"sources":["../../../src/organism/review-slide/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Answer from '../../molecule/answer';\nimport ButtonLink from '../../atom/button-link';\nimport Loader from '../../atom/loader';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin';\nimport {GetSkinFromContext} from '../../atom/provider';\nimport propTypes from './prop-types';\nimport style from './style.css';\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}) => {\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 const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\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 <div\n className={classnames(\n style.correctionPopinWrapper,\n animateCorrectionPopin ? style.popinAnimation : null\n )}\n >\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </div>\n );\n};\n\nCorrectionPopin.propTypes = {\n slideIndex: PropTypes.string,\n showCorrectionPopin: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n correctionPopinProps: propTypes.correctionPopinProps\n};\n\nconst 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 className: style.validateButton,\n customStyle: {\n backgroundColor: primarySkinColor\n }\n };\n\n return (\n <div key=\"button-wrapper\" className={style.validateButtonWrapper}>\n <ButtonLink {...validateButtonProps} />\n </div>\n );\n};\n\nValidateButton.propTypes = {\n slideIndex: PropTypes.string,\n validateButton: propTypes.validateButton,\n primarySkinColor: PropTypes.string\n};\n\nconst QuestionContainer = props => {\n const {answerUI, questionText, questionOrigin, disableContent} = props;\n if (!answerUI || !questionText) return null;\n\n return (\n <div\n key=\"content-container\"\n className={classnames(\n style.slideContentContainer,\n disableContent ? style.disabledSlideContent : null\n )}\n >\n <div key=\"from-course\" className={style.questionOrigin}>\n {questionOrigin}\n </div>\n <div\n key=\"title\"\n className={style.question}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: questionText}}\n />\n <div key=\"help\" className={style.help}>\n {get('help', answerUI)}\n </div>\n <div key=\"answer-container\" className={style.answerContainer}>\n <Answer {...answerUI} key=\"answer\" />\n </div>\n </div>\n );\n};\n\nQuestionContainer.propTypes = {\n answerUI: PropTypes.shape(propTypes.slide.answerUI),\n questionText: PropTypes.string,\n questionOrigin: PropTypes.string,\n disableContent: PropTypes.bool\n};\n\nconst ReviewSlide = props => {\n const {slide, validateButton, correctionPopinProps, slideIndex = '0'} = props;\n\n const skin = GetSkinFromContext();\n const primarySkinColor = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const {\n loading,\n loadingAriaLabel,\n parentContentTitle,\n questionText,\n disabledContent,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n return (\n <div data-name={`slide-container`} className={style.slide}>\n {loading ? (\n <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n ) : (\n [\n <QuestionContainer\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n disableContent={disabledContent}\n key=\"question-container\"\n />,\n <ValidateButton\n slideIndex={slideIndex}\n validateButton={validateButton}\n primarySkinColor={primarySkinColor}\n key=\"validate-button\"\n />,\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ]\n )}\n </div>\n );\n};\n\nReviewSlide.propTypes = propTypes;\n\nexport default Review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xE;EAEA,MAAMc,IAAI,GAAG7C,kBAAkB,EAA/B;EACA,MAAMuB,gBAAgB,GAAGhC,OAAO,CAAC,MAAMI,KAAK,CAAC,SAAD,EAAY,gBAAZ,EAA8BkD,IAA9B,CAAZ,EAAiD,CAACA,IAAD,CAAjD,CAAhC;EACA,MAAM;IACJC,OADI;IAEJC,gBAFI;IAGJC,kBAHI;IAIJf,YAJI;IAKJgB,eALI;IAMJjB,QANI;IAOJ1B,mBAPI;IAQJC;EARI,IASFoC,KATJ;EAWA,oBACE;IAAK,aAAY,iBAAjB;IAAmC,SAAS,EAAEzC,KAAK,CAACyC;EAApD,GACGG,OAAO,gBACN,oBAAC,MAAD;IAAQ,SAAS,EAAE5C,KAAK,CAACgD,MAAzB;IAAiC,KAAK,EAAC,SAAvC;IAAiD,cAAYH;EAA7D,EADM,GAGN,cACE,oBAAC,iBAAD;IACE,cAAc,EAAEC,kBADlB;IAEE,YAAY,EAAEf,YAFhB;IAGE,QAAQ,EAAED,QAHZ;IAIE,cAAc,EAAEiB,eAJlB;IAKE,GAAG,EAAC;EALN,EADF,eAQE,oBAAC,cAAD;IACE,UAAU,EAAE5C,UADd;IAEE,cAAc,EAAEiB,cAFlB;IAGE,gBAAgB,EAAEC,gBAHpB;IAIE,GAAG,EAAC;EAJN,EARF,eAcE,oBAAC,eAAD;IACE,oBAAoB,EAAEnB,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EAdF,CAJJ,CADF;AA8BD,CA9CD;;AAgDAqC,WAAW,CAAC3C,SAAZ,2CAAwBA,SAAxB;AAEA,eAAe2C,WAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","get","getOr","Answer","ButtonLink","Loader","ReviewCorrectionPopin","GetSkinFromContext","propTypes","style","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","klf","information","label","message","next","onClick","_correctionPopinProps","type","resultLabel","correctionPopinWrapper","popinAnimation","string","bool","ValidateButton","validateButton","primarySkinColor","disabled","validateButtonProps","className","customStyle","backgroundColor","validateButtonWrapper","QuestionContainer","props","answerUI","questionText","questionOrigin","disableContent","slideContentContainer","disabledSlideContent","question","__html","help","answerContainer","shape","slide","ReviewSlide","skin","loading","loadingAriaLabel","parentContentTitle","disabledContent","loader"],"sources":["../../../src/organism/review-slide/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Answer from '../../molecule/answer';\nimport ButtonLink from '../../atom/button-link';\nimport Loader from '../../atom/loader';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin';\nimport {GetSkinFromContext} from '../../atom/provider';\nimport propTypes from './prop-types';\nimport style from './style.css';\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}) => {\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 const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\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 <div\n className={classnames(\n style.correctionPopinWrapper,\n animateCorrectionPopin ? style.popinAnimation : null\n )}\n >\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </div>\n );\n};\n\nCorrectionPopin.propTypes = {\n slideIndex: PropTypes.string,\n showCorrectionPopin: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n correctionPopinProps: propTypes.correctionPopinProps\n};\n\nconst 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 className: style.validateButton,\n customStyle: {\n backgroundColor: primarySkinColor\n }\n };\n\n return (\n <div key=\"button-wrapper\" className={style.validateButtonWrapper}>\n <ButtonLink {...validateButtonProps} />\n </div>\n );\n};\n\nValidateButton.propTypes = {\n slideIndex: PropTypes.string,\n validateButton: propTypes.validateButton,\n primarySkinColor: PropTypes.string\n};\n\nconst QuestionContainer = props => {\n const {answerUI, questionText, questionOrigin, disableContent} = props;\n if (!answerUI || !questionText) return null;\n\n return (\n <div\n key=\"content-container\"\n data-testid=\"content-container\"\n className={classnames(\n style.slideContentContainer,\n disableContent ? style.disabledSlideContent : null\n )}\n >\n <div key=\"from-course\" className={style.questionOrigin}>\n {questionOrigin}\n </div>\n <div\n key=\"title\"\n data-testid=\"slide-question\"\n className={style.question}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: questionText}}\n />\n <div key=\"help\" className={style.help}>\n {get('help', answerUI)}\n </div>\n <div key=\"answer-container\" className={style.answerContainer}>\n <Answer {...answerUI} key=\"answer\" />\n </div>\n </div>\n );\n};\n\nQuestionContainer.propTypes = {\n answerUI: PropTypes.shape(propTypes.slide.answerUI),\n questionText: PropTypes.string,\n questionOrigin: PropTypes.string,\n disableContent: PropTypes.bool\n};\n\nconst ReviewSlide = props => {\n const {slide, validateButton, correctionPopinProps, slideIndex = '0'} = props;\n\n const skin = GetSkinFromContext();\n const primarySkinColor = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const {\n loading,\n loadingAriaLabel,\n parentContentTitle,\n questionText,\n disabledContent,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n return (\n <div data-testid=\"review-slide\" className={style.slide}>\n {loading ? (\n <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n ) : (\n <>\n <QuestionContainer\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n disableContent={disabledContent}\n key=\"question-container\"\n />\n <ValidateButton\n slideIndex={slideIndex}\n validateButton={validateButton}\n primarySkinColor={primarySkinColor}\n key=\"validate-button\"\n />\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n </>\n )}\n </div>\n );\n};\n\nReviewSlide.propTypes = propTypes;\n\nexport default ReviewSlide;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,MAAP,MAAmB,uBAAnB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,qBAAP,MAAkC,wCAAlC;AACA,SAAQC,kBAAR,QAAiC,qBAAjC;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAAD,KAKlB;EACJ,IAAI,CAACD,mBAAL,EAA0B,OAAO,IAAP;EAE1B,MAAME,GAAG,GAAGb,KAAK,CAAC,EAAD,EAAK,KAAL,EAAYS,oBAAZ,CAAjB;EACA,MAAMK,WAAW,GAAGd,KAAK,CAAC;IAACe,KAAK,EAAE,EAAR;IAAYC,OAAO,EAAE;EAArB,CAAD,EAA2B,aAA3B,EAA0CP,oBAA1C,CAAzB;EACA,MAAMQ,IAAI,GAAGlB,GAAG,CAAC,MAAD,EAASU,oBA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oBAAC,eAAD;IACE,oBAAoB,EAAEnB,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EAdF,CAJJ,CADF;AA8BD,CA9CD;;AAgDAqC,WAAW,CAAC3C,SAAZ,2CAAwBA,SAAxB;AAEA,eAAe2C,WAAf"}
|
|
@@ -30,10 +30,10 @@ const PlayerReview = ({
|
|
|
30
30
|
className: classnames(style.reviewHeaderContainer, congrats && style.reviewHeaderContainerCongrats)
|
|
31
31
|
}, /*#__PURE__*/React.createElement(ReviewHeader, header)), /*#__PURE__*/React.createElement(StackedSlides, stack), isNil(congrats) ? null : /*#__PURE__*/React.createElement("div", {
|
|
32
32
|
className: style.congrats,
|
|
33
|
-
"data-
|
|
33
|
+
"data-testid": "congrats-container"
|
|
34
34
|
}, /*#__PURE__*/React.createElement(ReviewCongrats, congrats)), isNil(quitPopin) ? null : /*#__PURE__*/React.createElement("div", {
|
|
35
35
|
className: style.quitPopin,
|
|
36
|
-
"data-
|
|
36
|
+
"data-testid": "quit-popin-container"
|
|
37
37
|
}, /*#__PURE__*/React.createElement(CMPopin, quitPopin)));
|
|
38
38
|
};
|
|
39
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","isNil","classnames","ReviewBackground","ReviewCongrats","ReviewHeader","StackedSlides","CMPopin","style","propTypes","PlayerReview","header","stack","reviewBackgroundAriaLabel","congrats","quitPopin","playerReviewContainer","playerBackground","reviewHeaderContainer","reviewHeaderContainerCongrats"],"sources":["../../../../src/template/app-review/player/index.js"],"sourcesContent":["import React from 'react';\nimport isNil from 'lodash/fp/isNil';\nimport classnames from 'classnames';\nimport ReviewBackground from '../../../atom/review-background';\nimport ReviewCongrats from '../../../organism/review-congrats';\nimport ReviewHeader from '../../../organism/review-header';\nimport StackedSlides from '../../../organism/review-stacked-slides';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst PlayerReview = ({header, stack, reviewBackgroundAriaLabel, congrats, quitPopin}) => {\n return (\n <div\n key=\"review-player-container\"\n data-name=\"review-player-container\"\n className={style.playerReviewContainer}\n >\n <div key=\"player-background-container\" className={style.playerBackground}>\n <ReviewBackground aria-label={reviewBackgroundAriaLabel} />\n </div>\n <div\n key=\"review-header-wrapper\"\n className={classnames(\n style.reviewHeaderContainer,\n congrats && style.reviewHeaderContainerCongrats\n )}\n >\n <ReviewHeader {...header} />\n </div>\n <StackedSlides {...stack} />\n {isNil(congrats) ? null : (\n <div className={style.congrats} data-
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","isNil","classnames","ReviewBackground","ReviewCongrats","ReviewHeader","StackedSlides","CMPopin","style","propTypes","PlayerReview","header","stack","reviewBackgroundAriaLabel","congrats","quitPopin","playerReviewContainer","playerBackground","reviewHeaderContainer","reviewHeaderContainerCongrats"],"sources":["../../../../src/template/app-review/player/index.js"],"sourcesContent":["import React from 'react';\nimport isNil from 'lodash/fp/isNil';\nimport classnames from 'classnames';\nimport ReviewBackground from '../../../atom/review-background';\nimport ReviewCongrats from '../../../organism/review-congrats';\nimport ReviewHeader from '../../../organism/review-header';\nimport StackedSlides from '../../../organism/review-stacked-slides';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst PlayerReview = ({header, stack, reviewBackgroundAriaLabel, congrats, quitPopin}) => {\n return (\n <div\n key=\"review-player-container\"\n data-name=\"review-player-container\"\n className={style.playerReviewContainer}\n >\n <div key=\"player-background-container\" className={style.playerBackground}>\n <ReviewBackground aria-label={reviewBackgroundAriaLabel} />\n </div>\n <div\n key=\"review-header-wrapper\"\n className={classnames(\n style.reviewHeaderContainer,\n congrats && style.reviewHeaderContainerCongrats\n )}\n >\n <ReviewHeader {...header} />\n </div>\n <StackedSlides {...stack} />\n {isNil(congrats) ? null : (\n <div className={style.congrats} data-testid=\"congrats-container\">\n <ReviewCongrats {...congrats} />\n </div>\n )}\n\n {isNil(quitPopin) ? null : (\n <div className={style.quitPopin} data-testid=\"quit-popin-container\">\n <CMPopin {...quitPopin} />\n </div>\n )}\n </div>\n );\n};\n\nPlayerReview.propTypes = propTypes;\n\nexport default PlayerReview;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,gBAAP,MAA6B,iCAA7B;AACA,OAAOC,cAAP,MAA2B,mCAA3B;AACA,OAAOC,YAAP,MAAyB,iCAAzB;AACA,OAAOC,aAAP,MAA0B,yCAA1B;AACA,OAAOC,OAAP,MAAoB,4BAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,cAAtB;;AAEA,MAAMC,YAAY,GAAG,CAAC;EAACC,MAAD;EAASC,KAAT;EAAgBC,yBAAhB;EAA2CC,QAA3C;EAAqDC;AAArD,CAAD,KAAqE;EACxF,oBACE;IACE,GAAG,EAAC,yBADN;IAEE,aAAU,yBAFZ;IAGE,SAAS,EAAEP,KAAK,CAACQ;EAHnB,gBAKE;IAAK,GAAG,EAAC,6BAAT;IAAuC,SAAS,EAAER,KAAK,CAACS;EAAxD,gBACE,oBAAC,gBAAD;IAAkB,cAAYJ;EAA9B,EADF,CALF,eAQE;IACE,GAAG,EAAC,uBADN;IAEE,SAAS,EAAEX,UAAU,CACnBM,KAAK,CAACU,qBADa,EAEnBJ,QAAQ,IAAIN,KAAK,CAACW,6BAFC;EAFvB,gBAOE,oBAAC,YAAD,EAAkBR,MAAlB,CAPF,CARF,eAiBE,oBAAC,aAAD,EAAmBC,KAAnB,CAjBF,EAkBGX,KAAK,CAACa,QAAD,CAAL,GAAkB,IAAlB,gBACC;IAAK,SAAS,EAAEN,KAAK,CAACM,QAAtB;IAAgC,eAAY;EAA5C,gBACE,oBAAC,cAAD,EAAoBA,QAApB,CADF,CAnBJ,EAwBGb,KAAK,CAACc,SAAD,CAAL,GAAmB,IAAnB,gBACC;IAAK,SAAS,EAAEP,KAAK,CAACO,SAAtB;IAAiC,eAAY;EAA7C,gBACE,oBAAC,OAAD,EAAaA,SAAb,CADF,CAzBJ,CADF;AAgCD,CAjCD;;AAmCAL,YAAY,CAACD,SAAb,2CAAyBA,SAAzB;AAEA,eAAeC,YAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/choice/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAmB,SAAS,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/choice/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAmB,SAAS,EAAY,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAC,KAAK,EAAE,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAMxE,oBAAY,KAAK,GAAG;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAoEF,QAAA,MAAM,MAAM,8GAUT,KAAK,uBAqFP,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -7,11 +7,13 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
|
|
10
|
-
var _index = _interopRequireDefault(require("../
|
|
10
|
+
var _index = _interopRequireDefault(require("../html/index.native"));
|
|
11
|
+
|
|
12
|
+
var _index2 = _interopRequireDefault(require("../image-background/index.native"));
|
|
11
13
|
|
|
12
14
|
var _getCleanUri = _interopRequireDefault(require("../../util/get-clean-uri"));
|
|
13
15
|
|
|
14
|
-
var
|
|
16
|
+
var _index3 = _interopRequireDefault(require("../../hoc/touchable/index.native"));
|
|
15
17
|
|
|
16
18
|
var _templateContext = require("../../template/app-review/template-context");
|
|
17
19
|
|
|
@@ -138,7 +140,7 @@ const Choice = ({
|
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
|
|
141
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
143
|
+
return /*#__PURE__*/_react.default.createElement(_index3.default, {
|
|
142
144
|
onPress: !isDisabled ? onPress : undefined,
|
|
143
145
|
style: style,
|
|
144
146
|
analyticsID: "question-choice",
|
|
@@ -150,13 +152,13 @@ const Choice = ({
|
|
|
150
152
|
testID: prefixTestID && `${prefixTestID}${selectedSuffix}`
|
|
151
153
|
}, url ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
152
154
|
style: styleSheet.imageContainer
|
|
153
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
154
156
|
testID: prefixTestID && `${prefixTestID}${mediaSuffix}`,
|
|
155
157
|
source: source,
|
|
156
158
|
style: styleSheet.image
|
|
157
159
|
})) : null, children ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
158
160
|
style: textWrapperStyle
|
|
159
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
160
162
|
style: textStyle
|
|
161
163
|
}, children)) : null));
|
|
162
164
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","squeezed","StyleSheet","create","boxShadow","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","backgroundColor","container","colors","white","borderRadius","radius","regular","flexDirection","alignItems","textContainer","paddingHorizontal","paddingVertical","justifyContent","flex","squeezedTextContainer","padding","spacing","small","paddingLeft","undefined","paddingRight","text","fontSize","medium","fontWeight","bold","color","black","textAlign","textSelected","unselectedImageContainer","borderRightColor","border","imageContainer","overflow","borderTopLeftRadius","borderBottomLeftRadius","image","Choice","children","isSelected","isDisabled","onPress","media","testID","prefixTestID","style","questionType","templateContext","useTemplateContext","brandTheme","styleSheet","setStylesheet","useState","useEffect","_stylesheet","selectedSuffix","mediaType","type","toLowerCase","url","src","length","getCleanUri","source","uri","mediaSuffix","textStyle","textWrapperStyle","push","selectionStyle","primary","borderColor","borderTopRightRadius","borderBottomRightRadius"],"sources":["../../../src/atom/choice/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {View, StyleSheet, ViewStyle, Text, TextStyle} from 'react-native';\nimport type {Media, QuestionType} from '../../molecule/questions/types';\n\nimport ImageBackground from '../image-background/index.native';\nimport getCleanUri from '../../util/get-clean-uri';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\nexport type Props = {\n isSelected?: boolean;\n onPress: () => void;\n children?: string;\n isDisabled?: boolean;\n testID?: string;\n media?: Media;\n squeezed?: boolean;\n style?: ViewStyle;\n questionType: QuestionType;\n};\n\ntype StyleSheetType = {\n boxShadow: ViewStyle;\n container: ViewStyle;\n text: TextStyle;\n textSelected: TextStyle;\n textContainer: ViewStyle;\n squeezedTextContainer: ViewStyle;\n unselectedImageContainer: ViewStyle;\n imageContainer: ViewStyle;\n image: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme, squeezed: boolean): StyleSheetType =>\n StyleSheet.create({\n boxShadow: {\n shadowColor: '#000',\n shadowOffset: {width: 0, height: 4},\n shadowOpacity: 0.12,\n shadowRadius: 16,\n elevation: 8,\n backgroundColor: '#0000'\n },\n container: {\n backgroundColor: theme.colors.white,\n borderRadius: theme.radius.regular,\n flexDirection: 'row',\n alignItems: 'stretch'\n },\n textContainer: {\n paddingHorizontal: 24,\n paddingVertical: 12,\n justifyContent: 'center',\n alignItems: 'center',\n flex: 1\n },\n squeezedTextContainer: {\n padding: theme.spacing.small,\n paddingLeft: undefined,\n paddingVertical: undefined,\n paddingRight: undefined,\n flex: 0\n },\n text: {\n fontSize: squeezed ? theme.fontSize.medium : theme.fontSize.regular,\n fontWeight: theme.fontWeight.bold,\n color: theme.colors.black,\n textAlign: 'center'\n },\n textSelected: {\n color: theme.colors.white\n },\n unselectedImageContainer: {\n borderRightColor: theme.colors.border\n },\n imageContainer: {\n height: '100%',\n width: '25%',\n overflow: 'hidden',\n borderTopLeftRadius: theme.radius.regular,\n borderBottomLeftRadius: theme.radius.regular\n },\n image: {\n flex: 1\n }\n });\n\nconst Choice = ({\n children,\n isSelected = false,\n squeezed = false,\n isDisabled,\n onPress,\n media,\n testID: prefixTestID,\n style,\n questionType\n}: Props) => {\n const templateContext = useTemplateContext();\n const {theme, brandTheme} = templateContext;\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, squeezed);\n setStylesheet(_stylesheet);\n }, [theme, squeezed]);\n\n if (!styleSheet) {\n return null;\n }\n\n const selectedSuffix = prefixTestID && isSelected ? '-selected' : '';\n const mediaType = media && media.type && media.type === 'img' && media.type.toLowerCase();\n const url =\n media &&\n media.type === 'img' &&\n media.src &&\n media.src.length > 0 &&\n getCleanUri(media.src[0].url);\n\n const source = {uri: url ? getCleanUri(url) : undefined};\n const mediaSuffix = prefixTestID && mediaType ? `-${mediaType}` : '';\n\n const textStyle: TextStyle[] = [styleSheet.text];\n const textWrapperStyle: ViewStyle[] = [styleSheet.textContainer];\n\n if (squeezed) {\n textWrapperStyle.push(styleSheet.squeezedTextContainer);\n }\n\n if (isSelected) {\n textStyle.push(styleSheet.textSelected);\n\n // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread\n const selectionStyle = brandTheme && {\n backgroundColor: brandTheme.colors?.primary,\n borderColor: brandTheme.colors?.primary,\n ...(url\n ? {\n borderTopRightRadius: theme.radius.regular,\n borderBottomRightRadius: theme.radius.regular\n }\n : {\n borderRadius: theme.radius.regular\n })\n };\n\n if (selectionStyle) {\n textWrapperStyle.push(selectionStyle);\n }\n }\n\n return (\n <Touchable\n onPress={!isDisabled ? onPress : undefined}\n style={style}\n analyticsID=\"question-choice\"\n analyticsParams={{questionType}}\n >\n <View\n style={[styleSheet.boxShadow, styleSheet.container]}\n testID={prefixTestID && `${prefixTestID}${selectedSuffix}`}\n >\n {url ? (\n <View style={styleSheet.imageContainer}>\n <ImageBackground\n testID={prefixTestID && `${prefixTestID}${mediaSuffix}`}\n source={source}\n style={styleSheet.image}\n />\n </View>\n ) : null}\n\n {children ? (\n <View style={textWrapperStyle}>\n <Text style={textStyle}>{children}</Text>\n </View>\n ) : null}\n </View>\n </Touchable>\n );\n};\n\nexport default Choice;\n"],"mappings":";;;;;AAAA;;AACA;;AAGA;;AACA;;AACA;;AACA;;;;;;;;;;AA2BA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAeC,QAAf,KACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,SAAS,EAAE;IACTC,WAAW,EAAE,MADJ;IAETC,YAAY,EAAE;MAACC,KAAK,EAAE,CAAR;MAAWC,MAAM,EAAE;IAAnB,CAFL;IAGTC,aAAa,EAAE,IAHN;IAITC,YAAY,EAAE,EAJL;IAKTC,SAAS,EAAE,CALF;IAMTC,eAAe,EAAE;EANR,CADK;EAShBC,SAAS,EAAE;IACTD,eAAe,EAAEZ,KAAK,CAACc,MAAN,CAAaC,KADrB;IAETC,YAAY,EAAEhB,KAAK,CAACiB,MAAN,CAAaC,OAFlB;IAGTC,aAAa,EAAE,KAHN;IAITC,UAAU,EAAE;EAJH,CATK;EAehBC,aAAa,EAAE;IACbC,iBAAiB,EAAE,EADN;IAEbC,eAAe,EAAE,EAFJ;I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IAAM,KAAK,EAAED;EAAb,GAAyB5B,QAAzB,CADF,CADO,GAIL,IAlBN,CANF,CADF;AA6BD,CA/FD;;eAiGeD,M"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","squeezed","StyleSheet","create","boxShadow","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","backgroundColor","container","colors","white","borderRadius","radius","regular","flexDirection","alignItems","textContainer","paddingHorizontal","paddingVertical","justifyContent","flex","squeezedTextContainer","padding","spacing","small","paddingLeft","undefined","paddingRight","text","fontSize","medium","fontWeight","bold","color","black","textAlign","textSelected","unselectedImageContainer","borderRightColor","border","imageContainer","overflow","borderTopLeftRadius","borderBottomLeftRadius","image","Choice","children","isSelected","isDisabled","onPress","media","testID","prefixTestID","style","questionType","templateContext","useTemplateContext","brandTheme","styleSheet","setStylesheet","useState","useEffect","_stylesheet","selectedSuffix","mediaType","type","toLowerCase","url","src","length","getCleanUri","source","uri","mediaSuffix","textStyle","textWrapperStyle","push","selectionStyle","primary","borderColor","borderTopRightRadius","borderBottomRightRadius"],"sources":["../../../src/atom/choice/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {View, StyleSheet, ViewStyle, TextStyle} from 'react-native';\n\nimport Html from '../html/index.native';\nimport ImageBackground from '../image-background/index.native';\nimport type {Media, QuestionType} from '../../molecule/questions/types';\nimport getCleanUri from '../../util/get-clean-uri';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\nexport type Props = {\n isSelected?: boolean;\n onPress: () => void;\n children?: string;\n isDisabled?: boolean;\n testID?: string;\n media?: Media;\n squeezed?: boolean;\n style?: ViewStyle;\n questionType: QuestionType;\n};\n\ntype StyleSheetType = {\n boxShadow: ViewStyle;\n container: ViewStyle;\n text: TextStyle;\n textSelected: TextStyle;\n textContainer: ViewStyle;\n squeezedTextContainer: ViewStyle;\n unselectedImageContainer: ViewStyle;\n imageContainer: ViewStyle;\n image: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme, squeezed: boolean): StyleSheetType =>\n StyleSheet.create({\n boxShadow: {\n shadowColor: '#000',\n shadowOffset: {width: 0, height: 4},\n shadowOpacity: 0.12,\n shadowRadius: 16,\n elevation: 8,\n backgroundColor: '#0000'\n },\n container: {\n backgroundColor: theme.colors.white,\n borderRadius: theme.radius.regular,\n flexDirection: 'row',\n alignItems: 'stretch'\n },\n textContainer: {\n paddingHorizontal: 24,\n paddingVertical: 12,\n justifyContent: 'center',\n alignItems: 'center',\n flex: 1\n },\n squeezedTextContainer: {\n padding: theme.spacing.small,\n paddingLeft: undefined,\n paddingVertical: undefined,\n paddingRight: undefined,\n flex: 0\n },\n text: {\n fontSize: squeezed ? theme.fontSize.medium : theme.fontSize.regular,\n fontWeight: theme.fontWeight.bold,\n color: theme.colors.black,\n textAlign: 'center'\n },\n textSelected: {\n color: theme.colors.white\n },\n unselectedImageContainer: {\n borderRightColor: theme.colors.border\n },\n imageContainer: {\n height: '100%',\n width: '25%',\n overflow: 'hidden',\n borderTopLeftRadius: theme.radius.regular,\n borderBottomLeftRadius: theme.radius.regular\n },\n image: {\n flex: 1\n }\n });\n\nconst Choice = ({\n children,\n isSelected = false,\n squeezed = false,\n isDisabled,\n onPress,\n media,\n testID: prefixTestID,\n style,\n questionType\n}: Props) => {\n const templateContext = useTemplateContext();\n const {theme, brandTheme} = templateContext;\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, squeezed);\n setStylesheet(_stylesheet);\n }, [theme, squeezed]);\n\n if (!styleSheet) {\n return null;\n }\n\n const selectedSuffix = prefixTestID && isSelected ? '-selected' : '';\n const mediaType = media && media.type && media.type === 'img' && media.type.toLowerCase();\n const url =\n media &&\n media.type === 'img' &&\n media.src &&\n media.src.length > 0 &&\n getCleanUri(media.src[0].url);\n\n const source = {uri: url ? getCleanUri(url) : undefined};\n const mediaSuffix = prefixTestID && mediaType ? `-${mediaType}` : '';\n\n const textStyle: TextStyle[] = [styleSheet.text];\n const textWrapperStyle: ViewStyle[] = [styleSheet.textContainer];\n\n if (squeezed) {\n textWrapperStyle.push(styleSheet.squeezedTextContainer);\n }\n\n if (isSelected) {\n textStyle.push(styleSheet.textSelected);\n\n // eslint-disable-next-line @coorpacademy/coorpacademy/no-overwriting-spread\n const selectionStyle = brandTheme && {\n backgroundColor: brandTheme.colors?.primary,\n borderColor: brandTheme.colors?.primary,\n ...(url\n ? {\n borderTopRightRadius: theme.radius.regular,\n borderBottomRightRadius: theme.radius.regular\n }\n : {\n borderRadius: theme.radius.regular\n })\n };\n\n if (selectionStyle) {\n textWrapperStyle.push(selectionStyle);\n }\n }\n\n return (\n <Touchable\n onPress={!isDisabled ? onPress : undefined}\n style={style}\n analyticsID=\"question-choice\"\n analyticsParams={{questionType}}\n >\n <View\n style={[styleSheet.boxShadow, styleSheet.container]}\n testID={prefixTestID && `${prefixTestID}${selectedSuffix}`}\n >\n {url ? (\n <View style={styleSheet.imageContainer}>\n <ImageBackground\n testID={prefixTestID && `${prefixTestID}${mediaSuffix}`}\n source={source}\n style={styleSheet.image}\n />\n </View>\n ) : null}\n\n {children ? (\n <View style={textWrapperStyle}>\n <Html style={textStyle}>{children}</Html>\n </View>\n ) : null}\n </View>\n </Touchable>\n );\n};\n\nexport default Choice;\n"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AA2BA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAeC,QAAf,KACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,SAAS,EAAE;IACTC,WAAW,EAAE,MADJ;IAETC,YAAY,EAAE;MAACC,KAAK,EAAE,CAAR;MAAWC,MAAM,EAAE;IAAnB,CAFL;IAGTC,aAAa,EAAE,IAHN;IAITC,YAAY,EAAE,EAJL;IAKTC,SAAS,EAAE,CALF;IAMTC,eA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UAAU,CAAClB;EAAxB,gBACE,6BAAC,eAAD;IACE,MAAM,EAAEY,YAAY,IAAK,GAAEA,YAAa,GAAEqB,WAAY,EADxD;IAEE,MAAM,EAAEF,MAFV;IAGE,KAAK,EAAEb,UAAU,CAACd;EAHpB,EADF,CADE,GAQA,IAZN,EAcGE,QAAQ,gBACP,6BAAC,iBAAD;IAAM,KAAK,EAAE6B;EAAb,gBACE,6BAAC,cAAD;IAAM,KAAK,EAAED;EAAb,GAAyB5B,QAAzB,CADF,CADO,GAIL,IAlBN,CANF,CADF;AA6BD,CA/FD;;eAiGeD,M"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ViewStyle, ImageStyle, TextStyle } from 'react-native';
|
|
3
3
|
export declare type Props = {
|
|
4
4
|
children: string;
|
|
5
|
-
fontSize
|
|
5
|
+
fontSize?: TextStyle['fontSize'];
|
|
6
6
|
numberOfLines?: number;
|
|
7
7
|
onLinkPress?: (url: string) => void;
|
|
8
8
|
containerStyle?: ViewStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/html/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAO,SAAS,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/html/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAO,SAAS,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAqBpE,oBAAY,KAAK,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAqBF,QAAA,MAAM,IAAI,UAAW,KAAK,gBAsIzB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -23,8 +23,13 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
23
23
|
|
|
24
24
|
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); }
|
|
25
25
|
|
|
26
|
+
const HtmlBase = props => {
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativeRenderHtml.default, props);
|
|
28
|
+
};
|
|
29
|
+
|
|
26
30
|
const Html = props => {
|
|
27
31
|
const templateContext = (0, _templateContext.useTemplateContext)();
|
|
32
|
+
const [isDisabledBaseFontStyleColor, disableBaseFontStyleColor] = (0, _react.useState)(false);
|
|
28
33
|
const {
|
|
29
34
|
theme
|
|
30
35
|
} = templateContext;
|
|
@@ -101,13 +106,26 @@ const Html = props => {
|
|
|
101
106
|
const SpanRenderer = (0, _react.useCallback)((htmlAttribs, _children) => /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
102
107
|
numberOfLines: numberOfLines
|
|
103
108
|
}, _children), [numberOfLines]);
|
|
109
|
+
const FontRenderer = (0, _react.useCallback)((htmlAttribs, _children) => {
|
|
110
|
+
if (htmlAttribs.color) {
|
|
111
|
+
disableBaseFontStyleColor(true);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
115
|
+
key: 1,
|
|
116
|
+
style: _extends({}, baseFontStyle, {
|
|
117
|
+
color: htmlAttribs.color?.replace(/ /g, '')
|
|
118
|
+
})
|
|
119
|
+
}, _children);
|
|
120
|
+
}, [baseFontStyle]);
|
|
104
121
|
const renderers = {
|
|
122
|
+
font: FontRenderer,
|
|
105
123
|
span: SpanRenderer
|
|
106
124
|
};
|
|
107
125
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
108
126
|
testID: testID,
|
|
109
127
|
style: containerStyle
|
|
110
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
128
|
+
}, /*#__PURE__*/_react.default.createElement(HtmlBase // to text-align center on android
|
|
111
129
|
// we have to encapsulate between <p> tag
|
|
112
130
|
// and use custom style define on <p>
|
|
113
131
|
// definition in component style doesn't work
|
|
@@ -116,9 +134,10 @@ const Html = props => {
|
|
|
116
134
|
// eslint-disable-next-line no-nested-ternary
|
|
117
135
|
html: isTextCentered ? `<p>${children}</p>` : numberOfLines ? `<span>${children}</span>` : `${children}`
|
|
118
136
|
},
|
|
119
|
-
tagsStyles: tagsStyles
|
|
120
|
-
,
|
|
121
|
-
|
|
137
|
+
tagsStyles: tagsStyles,
|
|
138
|
+
baseFontStyle: _extends({}, baseFontStyle, {
|
|
139
|
+
color: isDisabledBaseFontStyleColor ? undefined : baseFontStyle.color
|
|
140
|
+
}),
|
|
122
141
|
renderers: renderers // this is exceptionally for the onboarding course
|
|
123
142
|
// is the only course that has a gif in the context but the img tag
|
|
124
143
|
// comes with width & height attr and these makes this lib do not render the gif
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["HtmlBase","props","Html","templateContext","useTemplateContext","isDisabledBaseFontStyleColor","disableBaseFontStyleColor","useState","theme","children","fontSize","containerStyle","imageStyle","style","testID","anchorTextColor","HTML_ANCHOR_TEXT_COLOR","isTextCentered","numberOfLines","styles","p","marginVertical","textAlign","u","textDecorationLine","i","fontStyle","b","fontWeight","bold","s","tagsStyles","h1","h2","h3","h4","h5","h6","a","color","img","baseFontStyle","DEFAULT_TEXT_STYLE","colors","black","Array","isArray","styleObject","reduce","result","child","SpanRenderer","useCallback","htmlAttribs","_children","FontRenderer","replace","renderers","font","span","html","undefined"],"sources":["../../../src/atom/html/index.native.tsx"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport {View, ViewStyle, ImageStyle, TextStyle} from 'react-native';\nimport RenderHTML, {\n CustomRendererProps,\n MixedStyleRecord,\n RenderHTMLProps,\n TBlock\n} from 'react-native-render-html';\n\nimport {HTML_ANCHOR_TEXT_COLOR} from '../../variables/theme.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport Text, {DEFAULT_STYLE as DEFAULT_TEXT_STYLE} from '../text/index.native';\n\ninterface CustomRenderHTMLProps extends RenderHTMLProps {\n baseFontStyle?: TextStyle;\n testID?: string;\n}\n\nconst HtmlBase = (props: CustomRenderHTMLProps) => {\n return <RenderHTML {...props} />;\n};\n\nexport type Props = {\n children: string;\n fontSize?: TextStyle['fontSize'];\n numberOfLines?: number;\n onLinkPress?: (url: string) => void;\n containerStyle?: ViewStyle;\n anchorTextColor?: string;\n imageStyle?: ImageStyle;\n style?: ViewStyle | ViewStyle[];\n testID?: string;\n isTextCentered?: boolean;\n};\n\ntype Styles = {\n p: {\n marginVertical: ViewStyle['marginVertical'];\n textAlign: TextStyle['textAlign'];\n };\n u: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n i: {\n fontStyle: TextStyle['fontStyle'];\n };\n b: {\n fontWeight: TextStyle['fontWeight'];\n };\n s: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n};\n\nconst Html = (props: Props) => {\n const templateContext = useTemplateContext();\n const [isDisabledBaseFontStyleColor, disableBaseFontStyleColor] = useState<boolean>(false);\n const {theme} = templateContext;\n const {\n children,\n fontSize,\n containerStyle,\n imageStyle,\n style,\n testID,\n anchorTextColor = HTML_ANCHOR_TEXT_COLOR,\n isTextCentered,\n numberOfLines\n } = props;\n\n // Don't use StyleSheet there, it's not a react style\n const styles: Styles = {\n p: {\n marginVertical: 0,\n textAlign: 'center'\n },\n u: {\n textDecorationLine: 'underline'\n },\n i: {\n fontStyle: 'italic'\n },\n b: {\n fontWeight: theme.fontWeight.bold\n },\n s: {\n textDecorationLine: 'line-through'\n }\n };\n\n const tagsStyles: MixedStyleRecord = {\n ...styles,\n h1: {fontSize},\n h2: {fontSize},\n h3: {fontSize},\n h4: {fontSize},\n h5: {fontSize},\n h6: {fontSize},\n a: {color: anchorTextColor},\n img: imageStyle || {}\n };\n\n let baseFontStyle: TextStyle = {...DEFAULT_TEXT_STYLE, fontSize, color: theme.colors.black};\n if (style) {\n if (Array.isArray(style)) {\n const styleObject = style.reduce((result, child) => ({\n ...result,\n ...child\n }));\n baseFontStyle = {\n ...baseFontStyle,\n ...styleObject\n };\n } else {\n baseFontStyle = {\n ...baseFontStyle,\n ...style\n };\n }\n }\n\n const SpanRenderer = useCallback(\n (htmlAttribs: CustomRendererProps<TBlock>, _children: string) => (\n <Text numberOfLines={numberOfLines}>{_children}</Text>\n ),\n [numberOfLines]\n );\n\n interface HtmlAttrib extends CustomRendererProps<TBlock> {\n color?: string;\n }\n\n const FontRenderer = useCallback(\n (htmlAttribs: HtmlAttrib, _children: string) => {\n if (htmlAttribs.color) {\n disableBaseFontStyleColor(true);\n }\n\n return (\n <Text\n key={1}\n style={{\n ...baseFontStyle,\n color: htmlAttribs.color?.replace(/ /g, '')\n }}\n >\n {_children}\n </Text>\n );\n },\n [baseFontStyle]\n );\n\n const renderers = {\n font: FontRenderer,\n span: SpanRenderer\n };\n\n return (\n <View testID={testID} style={containerStyle}>\n <HtmlBase\n // to text-align center on android\n // we have to encapsulate between <p> tag\n // and use custom style define on <p>\n // definition in component style doesn't work\n source={{\n // eslint-disable-next-line no-nested-ternary\n html: isTextCentered\n ? `<p>${children}</p>`\n : numberOfLines\n ? `<span>${children}</span>`\n : `${children}`\n }}\n tagsStyles={tagsStyles}\n baseFontStyle={{\n ...baseFontStyle,\n color: isDisabledBaseFontStyleColor ? undefined : baseFontStyle.color\n }}\n renderers={renderers}\n // this is exceptionally for the onboarding course\n // is the only course that has a gif in the context but the img tag\n // comes with width & height attr and these makes this lib do not render the gif\n // so to avoid it, we decided to ignore these attr\n ignoredStyles={['width', 'height']}\n testID=\"html-base\"\n />\n </View>\n );\n};\n\nexport default Html;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAOA;;AACA;;AACA;;;;;;;;;;AAOA,MAAMA,QAAQ,GAAIC,KAAD,IAAkC;EACjD,oBAAO,6BAAC,8BAAD,EAAgBA,KAAhB,CAAP;AACD,CAFD;;AAoCA,MAAMC,IAAI,GAAID,KAAD,IAAkB;EAC7B,MAAME,eAAe,GAAG,IAAAC,mCAAA,GAAxB;EACA,MAAM,CAACC,4BAAD,EAA+BC,yBAA/B,IAA4D,IAAAC,eAAA,EAAkB,KAAlB,CAAlE;EACA,MAAM;IAACC;EAAD,IAAUL,eAAhB;EACA,MAAM;IACJM,QADI;IAEJC,QAFI;IAGJC,cAHI;IAIJC,UAJI;IAKJC,KALI;IAMJC,MANI;IAOJC,eAAe,GAAGC,6BAPd;IAQJC,cARI;IASJC;EATI,IAUFjB,KAVJ,CAJ6B,CAgB7B;;EACA,MAAMkB,MAAc,GAAG;IACrBC,CAAC,EAAE;MACDC,cAAc,EAAE,CADf;MAEDC,SAAS,EAAE;IAFV,CADkB;IAKrBC,CAAC,EAAE;MACDC,kBAAkB,EAAE;IADnB,CALkB;IAQrBC,CAAC,EAAE;MACDC,SAAS,EAAE;IADV,CARkB;IAWrBC,CAAC,EAAE;MACDC,UAAU,EAAEpB,KAAK,CAACoB,UAAN,CAAiBC;IAD5B,CAXkB;IAcrBC,CAAC,EAAE;MACDN,kBAAkB,EAAE;IADnB;EAdkB,CAAvB;;EAmBA,MAAMO,UAA4B,gBAC7BZ,MAD6B;IAEhCa,EAAE,EAAE;MAACtB;IAAD,CAF4B;IAGhCuB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,EAAiC,EAAjC;MAFJ;IAFP,GAOGF,SAPH,CADF;EAWD,CAjBkB,EAkBnB,CAACb,aAAD,CAlBmB,CAArB;EAqBA,MAAMgB,SAAS,GAAG;IAChBC,IAAI,EAAEH,YADU;IAEhBI,IAAI,EAAER;EAFU,CAAlB;EAKA,oBACE,6BAAC,iBAAD;IAAM,MAAM,EAAErC,MAAd;IAAsB,KAAK,EAAEH;EAA7B,gBACE,6BAAC,QAAD,CACE;EACA;EACA;EACA;EAJF;IAKE,MAAM,EAAE;MACN;MACAiD,IAAI,EAAE3C,cAAc,GACf,MAAKR,QAAS,MADC,GAEhBS,aAAa,GACZ,SAAQT,QAAS,SADL,GAEZ,GAAEA,QAAS;IANV,CALV;IAaE,UAAU,EAAEsB,UAbd;IAcE,aAAa,eACRU,aADQ;MAEXF,KAAK,EAAElC,4BAA4B,GAAGwD,SAAH,GAAepB,aAAa,CAACF;IAFrD,EAdf;IAkBE,SAAS,EAAEkB,SAlBb,CAmBE;IACA;IACA;IACA;IAtBF;IAuBE,aAAa,EAAE,CAAC,OAAD,EAAU,QAAV,CAvBjB;IAwBE,MAAM,EAAC;EAxBT,EADF,CADF;AA8BD,CAtID;;eAwIevD,I"}
|
|
@@ -65,7 +65,8 @@ const ReviewCorrectionPopin = props => {
|
|
|
65
65
|
};
|
|
66
66
|
const Icon = ICONS[type];
|
|
67
67
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
68
|
-
className: _style.default.wrapper
|
|
68
|
+
className: _style.default.wrapper,
|
|
69
|
+
"data-testid": "review-correction-popin"
|
|
69
70
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
70
71
|
className: (0, _classnames.default)(_style.default.popin, type === 'right' ? _style.default.right : _style.default.wrong)
|
|
71
72
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -99,7 +100,8 @@ const ReviewCorrectionPopin = props => {
|
|
|
99
100
|
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
100
101
|
className: type === 'right' ? _style.default.actions : _style.default.actionsWrong
|
|
101
102
|
}, cta, /*#__PURE__*/_react.default.createElement("div", {
|
|
102
|
-
className: _style.default.nextQuestionContainer
|
|
103
|
+
className: _style.default.nextQuestionContainer,
|
|
104
|
+
"data-testid": "next-question-button-container"
|
|
103
105
|
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, _extends({}, nextQuestionButtonProps, {
|
|
104
106
|
className: _style.default.nextQuestionButton
|
|
105
107
|
}))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["buildKlfButton","klf","klfButtonProps","icon","position","type","style","klfContainer","klfButtonContainer","klfButton","toolTip","tooltipText","__html","tooltip","ReviewCorrectionPopin","props","information","resultLabel","next","nextQuestionButtonProps","cta","ICONS","right","RightIcon","wrong","WrongIcon","Icon","wrapper","classnames","popin","correctionSection","iconCircle","iconRight","iconWrong","feedbackSection","labelContainer","label","message","actions","actionsWrong","nextQuestionContainer","nextQuestionButton","propTypes"],"sources":["../../../src/molecule/review-correction-popin/index.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst buildKlfButton = klf => {\n const klfButtonProps = {\n ...klf,\n icon: {\n position: 'left',\n type: 'key'\n },\n type: 'primary'\n };\n\n return (\n <div className={style.klfContainer}>\n <div className={style.klfButtonContainer}>\n <ButtonLink {...klfButtonProps} className={style.klfButton} />\n </div>\n <div className={style.toolTip}>\n <span\n className={style.tooltipText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: klf.tooltip}}\n />\n </div>\n </div>\n );\n};\n\nconst ReviewCorrectionPopin = props => {\n const {information, resultLabel, type, klf, next} = props;\n\n const nextQuestionButtonProps = {\n ...next,\n type: 'primary'\n };\n\n const cta = type === 'wrong' ? buildKlfButton(klf) : null;\n\n const ICONS = {\n right: RightIcon,\n wrong: WrongIcon\n };\n const Icon = ICONS[type];\n\n return (\n <div className={style.wrapper}>\n <div className={classnames(style.popin, type === 'right' ? style.right : style.wrong)}>\n <div className={style.correctionSection}>\n <div className={style.iconCircle}>\n <Icon className={type === 'right' ? style.iconRight : style.iconWrong} />\n </div>\n <div className={style.resultLabel} aria-label=\"result\">\n <span aria-label={resultLabel}>{resultLabel}</span>\n </div>\n </div>\n <div className={style.feedbackSection}>\n <div className={style.information} aria-label=\"answer-information\">\n <div className={style.labelContainer}>\n <span className={style.label} aria-label={information.label}>\n {information.label}\n </span>\n </div>\n <span\n className={style.message}\n aria-label={information.message}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: information.message}}\n />\n </div>\n </div>\n <div className={type === 'right' ? style.actions : style.actionsWrong}>\n {cta}\n <div className={style.nextQuestionContainer}>\n <ButtonLink {...nextQuestionButtonProps} className={style.nextQuestionButton} />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nReviewCorrectionPopin.propTypes = propTypes;\n\nexport default ReviewCorrectionPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;;;AAEA,MAAMA,cAAc,GAAGC,GAAG,IAAI;EAC5B,MAAMC,cAAc,gBACfD,GADe;IAElBE,IAAI,EAAE;MACJC,QAAQ,EAAE,MADN;MAEJC,IAAI,EAAE;IAFF,CAFY;IAMlBA,IAAI,EAAE;EANY,EAApB;;EASA,oBACE;IAAK,SAAS,EAAEC,cAAA,CAAMC;EAAtB,gBACE;IAAK,SAAS,EAAED,cAAA,CAAME;EAAtB,gBACE,6BAAC,mBAAD,eAAgBN,cAAhB;IAAgC,SAAS,EAAEI,cAAA,CAAMG;EAAjD,GADF,CADF,eAIE;IAAK,SAAS,EAAEH,cAAA,CAAMI;EAAtB,gBACE;IACE,SAAS,EAAEJ,cAAA,CAAMK,WADnB,CAEE;IAFF;IAGE,uBAAuB,EAAE;MAACC,MAAM,EAAEX,GAAG,CAACY;IAAb;EAH3B,EADF,CAJF,CADF;AAcD,CAxBD;;AA0BA,MAAMC,qBAAqB,GAAGC,KAAK,IAAI;EACrC,MAAM;IAACC,WAAD;IAAcC,WAAd;IAA2BZ,IAA3B;IAAiCJ,GAAjC;IAAsCiB;EAAtC,IAA8CH,KAApD;;EAEA,MAAMI,uBAAuB,gBACxBD,IADwB;IAE3Bb,IAAI,EAAE;EAFqB,EAA7B;;EAKA,MAAMe,GAAG,GAAGf,IAAI,KAAK,OAAT,GAAmBL,cAAc,CAACC,GAAD,CAAjC,GAAyC,IAArD;EAEA,MAAMoB,KAAK,GAAG;IACZC,KAAK,EAAEC,2CADK;IAEZC,KAAK,EAAEC;EAFK,CAAd;EAIA,MAAMC,IAAI,GAAGL,KAAK,CAAChB,IAAD,CAAlB;EAEA,oBACE;IAAK,SAAS,EAAEC,cAAA,CAAMqB;
|
|
1
|
+
{"version":3,"file":"index.js","names":["buildKlfButton","klf","klfButtonProps","icon","position","type","style","klfContainer","klfButtonContainer","klfButton","toolTip","tooltipText","__html","tooltip","ReviewCorrectionPopin","props","information","resultLabel","next","nextQuestionButtonProps","cta","ICONS","right","RightIcon","wrong","WrongIcon","Icon","wrapper","classnames","popin","correctionSection","iconCircle","iconRight","iconWrong","feedbackSection","labelContainer","label","message","actions","actionsWrong","nextQuestionContainer","nextQuestionButton","propTypes"],"sources":["../../../src/molecule/review-correction-popin/index.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst buildKlfButton = klf => {\n const klfButtonProps = {\n ...klf,\n icon: {\n position: 'left',\n type: 'key'\n },\n type: 'primary'\n };\n\n return (\n <div className={style.klfContainer}>\n <div className={style.klfButtonContainer}>\n <ButtonLink {...klfButtonProps} className={style.klfButton} />\n </div>\n <div className={style.toolTip}>\n <span\n className={style.tooltipText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: klf.tooltip}}\n />\n </div>\n </div>\n );\n};\n\nconst ReviewCorrectionPopin = props => {\n const {information, resultLabel, type, klf, next} = props;\n\n const nextQuestionButtonProps = {\n ...next,\n type: 'primary'\n };\n\n const cta = type === 'wrong' ? buildKlfButton(klf) : null;\n\n const ICONS = {\n right: RightIcon,\n wrong: WrongIcon\n };\n const Icon = ICONS[type];\n\n return (\n <div className={style.wrapper} data-testid=\"review-correction-popin\">\n <div className={classnames(style.popin, type === 'right' ? style.right : style.wrong)}>\n <div className={style.correctionSection}>\n <div className={style.iconCircle}>\n <Icon className={type === 'right' ? style.iconRight : style.iconWrong} />\n </div>\n <div className={style.resultLabel} aria-label=\"result\">\n <span aria-label={resultLabel}>{resultLabel}</span>\n </div>\n </div>\n <div className={style.feedbackSection}>\n <div className={style.information} aria-label=\"answer-information\">\n <div className={style.labelContainer}>\n <span className={style.label} aria-label={information.label}>\n {information.label}\n </span>\n </div>\n <span\n className={style.message}\n aria-label={information.message}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: information.message}}\n />\n </div>\n </div>\n <div className={type === 'right' ? style.actions : style.actionsWrong}>\n {cta}\n <div className={style.nextQuestionContainer} data-testid=\"next-question-button-container\">\n <ButtonLink {...nextQuestionButtonProps} className={style.nextQuestionButton} />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nReviewCorrectionPopin.propTypes = propTypes;\n\nexport default ReviewCorrectionPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;;;AAEA,MAAMA,cAAc,GAAGC,GAAG,IAAI;EAC5B,MAAMC,cAAc,gBACfD,GADe;IAElBE,IAAI,EAAE;MACJC,QAAQ,EAAE,MADN;MAEJC,IAAI,EAAE;IAFF,CAFY;IAMlBA,IAAI,EAAE;EANY,EAAp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CAAM0B,SAAzB,GAAqC1B,cAAA,CAAM2B;EAA5D,EADF,CADF,eAIE;IAAK,SAAS,EAAE3B,cAAA,CAAMW,WAAtB;IAAmC,cAAW;EAA9C,gBACE;IAAM,cAAYA;EAAlB,GAAgCA,WAAhC,CADF,CAJF,CADF,eASE;IAAK,SAAS,EAAEX,cAAA,CAAM4B;EAAtB,gBACE;IAAK,SAAS,EAAE5B,cAAA,CAAMU,WAAtB;IAAmC,cAAW;EAA9C,gBACE;IAAK,SAAS,EAAEV,cAAA,CAAM6B;EAAtB,gBACE;IAAM,SAAS,EAAE7B,cAAA,CAAM8B,KAAvB;IAA8B,cAAYpB,WAAW,CAACoB;EAAtD,GACGpB,WAAW,CAACoB,KADf,CADF,CADF,eAME;IACE,SAAS,EAAE9B,cAAA,CAAM+B,OADnB;IAEE,cAAYrB,WAAW,CAACqB,OAF1B,CAGE;IAHF;IAIE,uBAAuB,EAAE;MAACzB,MAAM,EAAEI,WAAW,CAACqB;IAArB;EAJ3B,EANF,CADF,CATF,eAwBE;IAAK,SAAS,EAAEhC,IAAI,KAAK,OAAT,GAAmBC,cAAA,CAAMgC,OAAzB,GAAmChC,cAAA,CAAMiC;EAAzD,GACGnB,GADH,eAEE;IAAK,SAAS,EAAEd,cAAA,CAAMkC,qBAAtB;IAA6C,eAAY;EAAzD,gBACE,6BAAC,mBAAD,eAAgBrB,uBAAhB;IAAyC,SAAS,EAAEb,cAAA,CAAMmC;EAA1D,GADF,CAFF,CAxBF,CADF,CADF;AAmCD,CAnDD;;AAqDA3B,qBAAqB,CAAC4B,SAAtB,2CAAkCA,kBAAlC;eAEe5B,qB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-header/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-header/index.js"],"names":[],"mappings":";AAwBA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAyFE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAmBC;IAjBC;;;;MAIC;IA6CH,6BAIC;IAED,yBAGC;IAxBD,qCAQC;IAED,wBAGC;IAjBD,+BAEC;IA4BD,2BAKC;IAED,0BAKC;IAED,sBAIC;IAED,qBAIC;IAED,yBAQC;IAED,0BAQC;IArFD,2EASC;IAGC,kBAAsB;IA2ExB,6BAmZC;CACF"}
|