@coorpacademy/components 11.11.3-alpha.6 → 11.11.3
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/tooltip/index.d.ts +1 -3
- package/es/atom/tooltip/index.d.ts.map +1 -1
- package/es/atom/tooltip/index.js +7 -17
- package/es/atom/tooltip/index.js.map +1 -1
- package/es/atom/tooltip/style.css +2 -10
- package/es/globals.d.js.map +1 -1
- package/es/molecule/video-player-mobile/index.native.d.ts +2 -1
- package/es/molecule/video-player-mobile/index.native.d.ts.map +1 -1
- package/es/molecule/video-player-mobile/index.native.js +23 -11
- package/es/molecule/video-player-mobile/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 +29 -15
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/organism/user-preferences/index.d.ts.map +1 -1
- package/es/organism/user-preferences/index.js +3 -6
- package/es/organism/user-preferences/index.js.map +1 -1
- package/lib/atom/tooltip/index.d.ts +1 -3
- package/lib/atom/tooltip/index.d.ts.map +1 -1
- package/lib/atom/tooltip/index.js +7 -18
- package/lib/atom/tooltip/index.js.map +1 -1
- package/lib/atom/tooltip/style.css +2 -10
- package/lib/globals.d.js.map +1 -1
- package/lib/molecule/video-player-mobile/index.native.d.ts +2 -1
- package/lib/molecule/video-player-mobile/index.native.d.ts.map +1 -1
- package/lib/molecule/video-player-mobile/index.native.js +23 -11
- package/lib/molecule/video-player-mobile/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 +37 -23
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/organism/user-preferences/index.d.ts.map +1 -1
- package/lib/organism/user-preferences/index.js +3 -10
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/locales/.mtslconfig.json +1 -0
- package/package.json +2 -3
- package/es/atom/battle-opponent/index.d.ts +0 -19
- package/es/atom/battle-opponent/index.d.ts.map +0 -1
- package/es/atom/battle-opponent/index.js +0 -52
- package/es/atom/battle-opponent/index.js.map +0 -1
- package/es/atom/battle-opponent/prop-types.d.ts +0 -19
- package/es/atom/battle-opponent/prop-types.d.ts.map +0 -1
- package/es/atom/battle-opponent/prop-types.js +0 -11
- package/es/atom/battle-opponent/prop-types.js.map +0 -1
- package/es/atom/battle-opponent/style.css +0 -124
- package/es/molecule/battle-opponent-list/index.d.ts +0 -18
- package/es/molecule/battle-opponent-list/index.d.ts.map +0 -1
- package/es/molecule/battle-opponent-list/index.js +0 -25
- package/es/molecule/battle-opponent-list/index.js.map +0 -1
- package/es/molecule/battle-opponent-list/prop-types.d.ts +0 -26
- package/es/molecule/battle-opponent-list/prop-types.d.ts.map +0 -1
- package/es/molecule/battle-opponent-list/prop-types.js +0 -14
- package/es/molecule/battle-opponent-list/prop-types.js.map +0 -1
- package/es/molecule/battle-opponent-list/style.css +0 -5
- package/lib/atom/battle-opponent/index.d.ts +0 -19
- package/lib/atom/battle-opponent/index.d.ts.map +0 -1
- package/lib/atom/battle-opponent/index.js +0 -70
- package/lib/atom/battle-opponent/index.js.map +0 -1
- package/lib/atom/battle-opponent/prop-types.d.ts +0 -19
- package/lib/atom/battle-opponent/prop-types.d.ts.map +0 -1
- package/lib/atom/battle-opponent/prop-types.js +0 -20
- package/lib/atom/battle-opponent/prop-types.js.map +0 -1
- package/lib/atom/battle-opponent/style.css +0 -124
- package/lib/molecule/battle-opponent-list/index.d.ts +0 -18
- package/lib/molecule/battle-opponent-list/index.d.ts.map +0 -1
- package/lib/molecule/battle-opponent-list/index.js +0 -43
- package/lib/molecule/battle-opponent-list/index.js.map +0 -1
- package/lib/molecule/battle-opponent-list/prop-types.d.ts +0 -26
- package/lib/molecule/battle-opponent-list/prop-types.d.ts.map +0 -1
- package/lib/molecule/battle-opponent-list/prop-types.js +0 -23
- package/lib/molecule/battle-opponent-list/prop-types.js.map +0 -1
- package/lib/molecule/battle-opponent-list/style.css +0 -5
|
@@ -13,8 +13,6 @@ var _reactTooltip = _interopRequireDefault(require("react-tooltip"));
|
|
|
13
13
|
|
|
14
14
|
var _isString = _interopRequireDefault(require("lodash/fp/isString"));
|
|
15
15
|
|
|
16
|
-
var _keys = _interopRequireDefault(require("lodash/fp/keys"));
|
|
17
|
-
|
|
18
16
|
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
19
17
|
|
|
20
18
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
@@ -29,18 +27,13 @@ const FontSizes = {
|
|
|
29
27
|
12: _style.default.tooltipContentFontSize12,
|
|
30
28
|
14: _style.default.tooltipContentFontSize14
|
|
31
29
|
};
|
|
32
|
-
const IconSizes = {
|
|
33
|
-
small: 12,
|
|
34
|
-
big: 20
|
|
35
|
-
};
|
|
36
30
|
|
|
37
31
|
const ToolTipWrapper = ({
|
|
38
32
|
toolTipIsVisible,
|
|
39
33
|
anchorId,
|
|
40
34
|
closeToolTipInformationTextAriaLabel,
|
|
41
35
|
content,
|
|
42
|
-
handleContentMouseOver
|
|
43
|
-
iconSize
|
|
36
|
+
handleContentMouseOver
|
|
44
37
|
}) => {
|
|
45
38
|
if (!toolTipIsVisible) return null;
|
|
46
39
|
|
|
@@ -55,7 +48,7 @@ const ToolTipWrapper = ({
|
|
|
55
48
|
}, content);
|
|
56
49
|
} else {
|
|
57
50
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
-
className:
|
|
51
|
+
className: _style.default.toolTip,
|
|
59
52
|
"data-testid": "tooltip",
|
|
60
53
|
"aria-label": closeToolTipInformationTextAriaLabel,
|
|
61
54
|
onMouseOver: handleContentMouseOver
|
|
@@ -68,8 +61,7 @@ ToolTipWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
68
61
|
anchorId: _propTypes.default.string,
|
|
69
62
|
closeToolTipInformationTextAriaLabel: _propTypes.default.string.isRequired,
|
|
70
63
|
content: _propTypes.default.node,
|
|
71
|
-
handleContentMouseOver: _propTypes.default.func
|
|
72
|
-
iconSize: _propTypes.default.oneOf((0, _keys.default)(IconSizes))
|
|
64
|
+
handleContentMouseOver: _propTypes.default.func
|
|
73
65
|
} : {};
|
|
74
66
|
|
|
75
67
|
const toggleStateOnKeyPress = (state, setState, ref) => event => {
|
|
@@ -94,8 +86,7 @@ const ToolTip = ({
|
|
|
94
86
|
toolTipIsVisible: _toolTipIsVisible,
|
|
95
87
|
iconContainerClassName,
|
|
96
88
|
delayHide = 250,
|
|
97
|
-
fontSize = 14
|
|
98
|
-
iconSize = 'small'
|
|
89
|
+
fontSize = 14
|
|
99
90
|
}) => {
|
|
100
91
|
const isComponent = (0, _react.useMemo)(() => !(0, _isString.default)(TooltipContent) && /*#__PURE__*/(0, _react.isValidElement)(TooltipContent()), [TooltipContent]);
|
|
101
92
|
const [toolTipIsVisible, setToolTipIsVisible] = (0, _react.useState)(false);
|
|
@@ -140,8 +131,8 @@ const ToolTip = ({
|
|
|
140
131
|
tabIndex: 0
|
|
141
132
|
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyInformationIcon, {
|
|
142
133
|
className: _style.default.informationIcon,
|
|
143
|
-
width:
|
|
144
|
-
height:
|
|
134
|
+
width: 12,
|
|
135
|
+
height: 12,
|
|
145
136
|
"aria-label": ariaLabel
|
|
146
137
|
})), /*#__PURE__*/_react.default.createElement(ToolTipWrapper, {
|
|
147
138
|
toolTipIsVisible: toolTipIsVisible,
|
|
@@ -149,8 +140,7 @@ const ToolTip = ({
|
|
|
149
140
|
closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
|
|
150
141
|
content: content,
|
|
151
142
|
handleContentMouseOver: handleContentMouseOver,
|
|
152
|
-
fontSize: fontSize
|
|
153
|
-
iconSize: iconSize
|
|
143
|
+
fontSize: fontSize
|
|
154
144
|
}));
|
|
155
145
|
};
|
|
156
146
|
|
|
@@ -163,7 +153,6 @@ ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
163
153
|
iconContainerClassName: _propTypes.default.string,
|
|
164
154
|
delayHide: _propTypes.default.number,
|
|
165
155
|
fontSize: _propTypes.default.oneOf([12, 14]),
|
|
166
|
-
iconSize: _propTypes.default.oneOf((0, _keys.default)(IconSizes)),
|
|
167
156
|
// ---------- React Tooltip exclusive --------------
|
|
168
157
|
// externalHandling: if passed down, React Tooltip is used instead, due to limitations on
|
|
169
158
|
// parents overflow hidden controls
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["FontSizes","style","tooltipContentFontSize12","tooltipContentFontSize14","IconSizes","small","big","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","handleContentMouseOver","iconSize","toolTipReact","classnames","toolTip","bigIconToolTip","smallIconToolTip","propTypes","PropTypes","bool","string","isRequired","node","func","oneOf","keys","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","iconContainerClassName","delayHide","fontSize","isComponent","useMemo","isString","isValidElement","setToolTipIsVisible","useState","mouseLeaveTimer","setMouseLeaveTimer","undefined","handleKeyPress","useCallback","clearTimeout","handleMouseOver","handleMouseLeave","setTimeout","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","number"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport ReactTooltip from 'react-tooltip';\nimport isString from 'lodash/fp/isString';\nimport keys from 'lodash/fp/keys';\nimport {NovaCompositionCoorpacademyInformationIcon as InformationIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst FontSizes = {\n 12: style.tooltipContentFontSize12,\n 14: style.tooltipContentFontSize14\n};\n\nconst IconSizes = {\n small: 12,\n big: 20\n};\n\nconst ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content,\n handleContentMouseOver,\n iconSize\n}) => {\n if (!toolTipIsVisible) return null;\n if (anchorId) {\n return (\n <ReactTooltip\n id={anchorId}\n className={style.toolTipReact}\n data-event-off=\"click\"\n place=\"left\"\n effect=\"solid\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </ReactTooltip>\n );\n } else {\n return (\n <div\n className={classnames(\n style.toolTip,\n iconSize === 'big' ? style.bigIconToolTip : style.smallIconToolTip\n )}\n data-testid=\"tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n onMouseOver={handleContentMouseOver}\n >\n {content}\n </div>\n );\n }\n};\n\nToolTipWrapper.propTypes = {\n toolTipIsVisible: PropTypes.bool,\n anchorId: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n content: PropTypes.node,\n handleContentMouseOver: PropTypes.func,\n iconSize: PropTypes.oneOf(keys(IconSizes))\n};\n\nexport const toggleStateOnKeyPress = (state, setState, ref) => event => {\n if (event.key === 'Enter') {\n if (ref) ref.current.focus();\n event.stopPropagation();\n event.preventDefault();\n setState(!state);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setState(false);\n }\n};\n\nconst ToolTip = ({\n anchorId,\n TooltipContent,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel,\n toolTipIsVisible: _toolTipIsVisible,\n iconContainerClassName,\n delayHide = 250,\n fontSize = 14,\n iconSize = 'small'\n}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), delayHide));\n }, [delayHide]);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={classnames([style.tooltipContent, FontSizes[fontSize]])}>{TooltipContent}</p>\n );\n }, [TooltipContent, fontSize, isComponent]);\n\n return anchorId ? (\n <ToolTipWrapper\n toolTipIsVisible={_toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n fontSize={fontSize}\n />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={classnames([style.tooltipIconContainer, iconContainerClassName])}\n data-testid={dataTestId}\n onKeyDown={handleKeyPress}\n tabIndex={0}\n >\n <InformationIcon\n className={style.informationIcon}\n width={IconSizes[iconSize]}\n height={IconSizes[iconSize]}\n aria-label={ariaLabel}\n />\n </button>\n <ToolTipWrapper\n toolTipIsVisible={toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n handleContentMouseOver={handleContentMouseOver}\n fontSize={fontSize}\n iconSize={iconSize}\n />\n </div>\n );\n};\n\nToolTip.propTypes = {\n TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),\n 'data-testid': PropTypes.string,\n 'aria-label': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n // ---------- Regular Tooltip exclusive --------------\n iconContainerClassName: PropTypes.string,\n delayHide: PropTypes.number,\n fontSize: PropTypes.oneOf([12, 14]),\n iconSize: PropTypes.oneOf(keys(IconSizes)),\n // ---------- React Tooltip exclusive --------------\n // externalHandling: if passed down, React Tooltip is used instead, due to limitations on\n // parents overflow hidden controls\n anchorId: PropTypes.string,\n toolTipIsVisible: PropTypes.bool\n};\n\nexport default ToolTip;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,SAAS,GAAG;EAChB,IAAIC,cAAA,CAAMC,wBADM;EAEhB,IAAID,cAAA,CAAME;AAFM,CAAlB;AAKA,MAAMC,SAAS,GAAG;EAChBC,KAAK,EAAE,EADS;EAEhBC,GAAG,EAAE;AAFW,CAAlB;;AAKA,MAAMC,cAAc,GAAG,CAAC;EACtBC,gBADsB;EAEtBC,QAFsB;EAGtBC,oCAHsB;EAItBC,OAJsB;EAKtBC,sBALsB;EAMtBC;AANsB,CAAD,KAOjB;EACJ,IAAI,CAACL,gBAAL,EAAuB,OAAO,IAAP;;EACvB,IAAIC,QAAJ,EAAc;IACZ,oBACE,6BAAC,qBAAD;MACE,EAAE,EAAEA,QADN;MAEE,SAAS,EAAER,cAAA,CAAMa,YAFnB;MAGE,kBAAe,OAHjB;MAIE,KAAK,EAAC,MAJR;MAKE,MAAM,EAAC,OALT;MAME,cAAYJ;IANd,GAQGC,OARH,CADF;EAYD,CAbD,MAaO;IACL,oBACE;MACE,SAAS,EAAE,IAAAI,mBAAA,EACTd,cAAA,CAAMe,OADG,EAETH,QAAQ,KAAK,KAAb,GAAqBZ,cAAA,CAAMgB,cAA3B,GAA4ChB,cAAA,CAAMiB,gBAFzC,CADb;MAKE,eAAY,SALd;MAME,cAAYR,oCANd;MAOE,WAAW,EAAEE;IAPf,GASGD,OATH,CADF;EAaD;AACF,CArCD;;AAuCAJ,cAAc,CAACY,SAAf,2CAA2B;EACzBX,gBAAgB,EAAEY,kBAAA,CAAUC,IADH;EAEzBZ,QAAQ,EAAEW,kBAAA,CAAUE,MAFK;EAGzBZ,oCAAoC,EAAEU,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AAgB,CAAC,EAAD,EAAK,EAAL,CAAhB,CARQ;EASlBb,QAAQ,EAAEO,kBAAA,CAAUM,KAAV,CAAgB,IAAAC,aAAA,EAAKvB,SAAL,CAAhB,CATQ;EAUlB;EACA;EACA;EACAK,QAAQ,EAAEW,kBAAA,CAAUE,MAbF;EAclBd,gBAAgB,EAAEY,kBAAA,CAAUC;AAdV,CAApB;eAiBeiB,O"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["FontSizes","style","tooltipContentFontSize12","tooltipContentFontSize14","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","handleContentMouseOver","toolTipReact","toolTip","propTypes","PropTypes","bool","string","isRequired","node","func","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","iconContainerClassName","delayHide","fontSize","isComponent","useMemo","isString","isValidElement","setToolTipIsVisible","useState","mouseLeaveTimer","setMouseLeaveTimer","undefined","handleKeyPress","useCallback","clearTimeout","handleMouseOver","handleMouseLeave","setTimeout","classnames","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","number","oneOf"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport ReactTooltip from 'react-tooltip';\nimport isString from 'lodash/fp/isString';\nimport {NovaCompositionCoorpacademyInformationIcon as InformationIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst FontSizes = {\n 12: style.tooltipContentFontSize12,\n 14: style.tooltipContentFontSize14\n};\n\nconst ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content,\n handleContentMouseOver\n}) => {\n if (!toolTipIsVisible) return null;\n if (anchorId) {\n return (\n <ReactTooltip\n id={anchorId}\n className={style.toolTipReact}\n data-event-off=\"click\"\n place=\"left\"\n effect=\"solid\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </ReactTooltip>\n );\n } else {\n return (\n <div\n className={style.toolTip}\n data-testid=\"tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n onMouseOver={handleContentMouseOver}\n >\n {content}\n </div>\n );\n }\n};\n\nToolTipWrapper.propTypes = {\n toolTipIsVisible: PropTypes.bool,\n anchorId: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n content: PropTypes.node,\n handleContentMouseOver: PropTypes.func\n};\n\nexport const toggleStateOnKeyPress = (state, setState, ref) => event => {\n if (event.key === 'Enter') {\n if (ref) ref.current.focus();\n event.stopPropagation();\n event.preventDefault();\n setState(!state);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setState(false);\n }\n};\n\nconst ToolTip = ({\n anchorId,\n TooltipContent,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel,\n toolTipIsVisible: _toolTipIsVisible,\n iconContainerClassName,\n delayHide = 250,\n fontSize = 14\n}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), delayHide));\n }, [delayHide]);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={classnames([style.tooltipContent, FontSizes[fontSize]])}>{TooltipContent}</p>\n );\n }, [TooltipContent, fontSize, isComponent]);\n\n return anchorId ? (\n <ToolTipWrapper\n toolTipIsVisible={_toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n fontSize={fontSize}\n />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={classnames([style.tooltipIconContainer, iconContainerClassName])}\n data-testid={dataTestId}\n onKeyDown={handleKeyPress}\n tabIndex={0}\n >\n <InformationIcon\n className={style.informationIcon}\n width={12}\n height={12}\n aria-label={ariaLabel}\n />\n </button>\n <ToolTipWrapper\n toolTipIsVisible={toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n handleContentMouseOver={handleContentMouseOver}\n fontSize={fontSize}\n />\n </div>\n );\n};\n\nToolTip.propTypes = {\n TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),\n 'data-testid': PropTypes.string,\n 'aria-label': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n // ---------- Regular Tooltip exclusive --------------\n iconContainerClassName: PropTypes.string,\n delayHide: PropTypes.number,\n fontSize: PropTypes.oneOf([12, 14]),\n // ---------- React Tooltip exclusive --------------\n // externalHandling: if passed down, React Tooltip is used instead, due to limitations on\n // parents overflow hidden controls\n anchorId: PropTypes.string,\n toolTipIsVisible: PropTypes.bool\n};\n\nexport default ToolTip;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,SAAS,GAAG;EAChB,IAAIC,cAAA,CAAMC,wBADM;EAEhB,IAAID,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EC,sBAL1B;IAME,QAAQ,EAAE2B;EANZ,EAnBF,CAXF;AAwCD,CAxFD;;AA0FAP,OAAO,CAACjB,SAAR,2CAAoB;EAClBkB,cAAc,EAAEjB,kBAAA,CAAU4C,SAAV,CAAoB,CAAC5C,kBAAA,CAAUK,IAAX,EAAiBL,kBAAA,CAAUI,IAA3B,EAAiCJ,kBAAA,CAAUE,MAA3C,CAApB,CADE;EAElB,eAAeF,kBAAA,CAAUE,MAFP;EAGlB,cAAcF,kBAAA,CAAUE,MAHN;EAIlBR,oCAAoC,EAAEM,kBAAA,CAAUE,MAAV,CAAiBC,UAJrC;EAKlB;EACAkB,sBAAsB,EAAErB,kBAAA,CAAUE,MANhB;EAOlBoB,SAAS,EAAEtB,kBAAA,CAAU6C,MAPH;EAQlBtB,QAAQ,EAAEvB,kBAAA,CAAU8C,KAAV,CAAgB,CAAC,EAAD,EAAK,EAAL,CAAhB,CARQ;EASlB;EACA;EACA;EACArD,QAAQ,EAAEO,kBAAA,CAAUE,MAZF;EAalBV,gBAAgB,EAAEQ,kBAAA,CAAUC;AAbV,CAApB;eAgBee,O"}
|
|
@@ -34,18 +34,10 @@
|
|
|
34
34
|
position: absolute;
|
|
35
35
|
border-radius: 7px;
|
|
36
36
|
background-color: cm_grey_700;
|
|
37
|
-
height: auto;
|
|
38
|
-
width: 200px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.bigIconToolTip {
|
|
42
|
-
right: -71px;
|
|
43
|
-
bottom: 31px;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.smallIconToolTip {
|
|
47
37
|
right: -75px;
|
|
48
38
|
bottom: 32px;
|
|
39
|
+
height: auto;
|
|
40
|
+
width: 200px;
|
|
49
41
|
}
|
|
50
42
|
|
|
51
43
|
.toolTip::before {
|
package/lib/globals.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.d.js","names":[],"sources":["../src/globals.d.ts"],"sourcesContent":["declare module '@coorpacademy/nova-icons';\ndeclare module '@coorpacademy/react-native-slider';\ndeclare module '@react-native-community/blur';\ndeclare module '@coorpacademy/translate';\ndeclare module '
|
|
1
|
+
{"version":3,"file":"globals.d.js","names":[],"sources":["../src/globals.d.ts"],"sourcesContent":["declare module '@coorpacademy/nova-icons';\ndeclare module '@coorpacademy/react-native-slider';\ndeclare module '@react-native-community/blur';\ndeclare module '@coorpacademy/translate';\ndeclare module 'react-native/*';\ndeclare module 'color';\ndeclare module 'classnames';\ndeclare module '*.css';\n"],"mappings":""}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { Media } from '../questions/types';
|
|
3
3
|
export declare type Props = {
|
|
4
4
|
media: Media;
|
|
5
|
+
autoplay: boolean;
|
|
5
6
|
};
|
|
6
|
-
declare const Video: ({ media }: Props) => JSX.Element | null;
|
|
7
|
+
declare const Video: ({ media, autoplay }: Props) => JSX.Element | null;
|
|
7
8
|
export default Video;
|
|
8
9
|
//# sourceMappingURL=index.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/video-player-mobile/index.native.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAEzC,oBAAY,KAAK,GAAG;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/video-player-mobile/index.native.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAEzC,oBAAY,KAAK,GAAG;IAAC,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAC,CAAC;AA+CtD,QAAA,MAAM,KAAK,wBAAuB,KAAK,uBAEtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -17,6 +17,8 @@ var _templateContext = require("../../template/app-review/template-context");
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
+
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); }
|
|
21
|
+
|
|
20
22
|
const styleSheet = _reactNative.StyleSheet.create({
|
|
21
23
|
container: {
|
|
22
24
|
flex: 1,
|
|
@@ -25,7 +27,8 @@ const styleSheet = _reactNative.StyleSheet.create({
|
|
|
25
27
|
});
|
|
26
28
|
|
|
27
29
|
const VideoSwitch = ({
|
|
28
|
-
media
|
|
30
|
+
media,
|
|
31
|
+
autoplay
|
|
29
32
|
}) => {
|
|
30
33
|
const {
|
|
31
34
|
brandTheme
|
|
@@ -35,15 +38,21 @@ const VideoSwitch = ({
|
|
|
35
38
|
case 'application/kontiki':
|
|
36
39
|
case 'application/jwplayer':
|
|
37
40
|
case 'video/mp4':
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
{
|
|
42
|
+
if (!media.jwpOptions?.config) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const config = _extends({}, media.jwpOptions.config, {
|
|
47
|
+
autostart: autoplay
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativeJwMediaPlayer.default, {
|
|
51
|
+
style: styleSheet.container,
|
|
52
|
+
config: config
|
|
53
|
+
});
|
|
40
54
|
}
|
|
41
55
|
|
|
42
|
-
return /*#__PURE__*/_react.default.createElement(_reactNativeJwMediaPlayer.default, {
|
|
43
|
-
style: styleSheet.container,
|
|
44
|
-
config: media.jwpOptions.config
|
|
45
|
-
});
|
|
46
|
-
|
|
47
56
|
case 'application/vimeo':
|
|
48
57
|
return media.videoId ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
49
58
|
style: styleSheet.container
|
|
@@ -55,7 +64,8 @@ const VideoSwitch = ({
|
|
|
55
64
|
return /*#__PURE__*/_react.default.createElement(_reactNativeYoutube.default, {
|
|
56
65
|
apiKey: brandTheme.youtube?.apiKey || '',
|
|
57
66
|
style: styleSheet.container,
|
|
58
|
-
videoId: media.videoId
|
|
67
|
+
videoId: media.videoId,
|
|
68
|
+
play: autoplay
|
|
59
69
|
});
|
|
60
70
|
|
|
61
71
|
default:
|
|
@@ -64,10 +74,12 @@ const VideoSwitch = ({
|
|
|
64
74
|
};
|
|
65
75
|
|
|
66
76
|
const Video = ({
|
|
67
|
-
media
|
|
77
|
+
media,
|
|
78
|
+
autoplay
|
|
68
79
|
}) => {
|
|
69
80
|
return media ? /*#__PURE__*/_react.default.createElement(VideoSwitch, {
|
|
70
|
-
media: media
|
|
81
|
+
media: media,
|
|
82
|
+
autoplay: autoplay
|
|
71
83
|
}) : null;
|
|
72
84
|
};
|
|
73
85
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["styleSheet","StyleSheet","create","container","flex","width","VideoSwitch","media","brandTheme","useTemplateContext","mimeType","jwpOptions","config","videoId","youtube","apiKey","Video"],"sources":["../../../src/molecule/video-player-mobile/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, Text, View} from 'react-native';\nimport JWPlayer from 'react-native-jw-media-player';\nimport Youtube from 'react-native-youtube';\nimport {Vimeo} from 'react-native-vimeo-iframe';\nimport {useTemplateContext} from '../../template/app-review/template-context';\n\nimport {Media} from '../questions/types';\n\nexport type Props = {media: Media};\n\nconst styleSheet = StyleSheet.create({\n container: {\n flex: 1,\n width: '100%'\n }\n});\n\nconst VideoSwitch = ({media}: Props) => {\n const {brandTheme} = useTemplateContext();\n\n switch (media.mimeType) {\n case 'application/kontiki':\n case 'application/jwplayer':\n case 'video/mp4'
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["styleSheet","StyleSheet","create","container","flex","width","VideoSwitch","media","autoplay","brandTheme","useTemplateContext","mimeType","jwpOptions","config","autostart","videoId","youtube","apiKey","Video"],"sources":["../../../src/molecule/video-player-mobile/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, Text, View} from 'react-native';\nimport JWPlayer from 'react-native-jw-media-player';\nimport Youtube from 'react-native-youtube';\nimport {Vimeo} from 'react-native-vimeo-iframe';\nimport {useTemplateContext} from '../../template/app-review/template-context';\n\nimport {Media} from '../questions/types';\n\nexport type Props = {media: Media; autoplay: boolean};\n\nconst styleSheet = StyleSheet.create({\n container: {\n flex: 1,\n width: '100%'\n }\n});\n\nconst VideoSwitch = ({media, autoplay}: Props) => {\n const {brandTheme} = useTemplateContext();\n\n switch (media.mimeType) {\n case 'application/kontiki':\n case 'application/jwplayer':\n case 'video/mp4': {\n if (!media.jwpOptions?.config) {\n return null;\n }\n\n const config = {\n ...media.jwpOptions.config,\n autostart: autoplay\n };\n\n return <JWPlayer style={styleSheet.container} config={config} />;\n }\n case 'application/vimeo':\n return media.videoId ? (\n <View style={styleSheet.container}>\n <Vimeo videoId={media.videoId} />\n </View>\n ) : null;\n case 'application/youtube':\n return (\n <Youtube\n apiKey={brandTheme.youtube?.apiKey || ''}\n style={styleSheet.container}\n videoId={media.videoId}\n play={autoplay}\n />\n );\n default:\n return <Text>{`video mimeType ${media.mimeType} is not handled`}</Text>;\n }\n};\n\nconst Video = ({media, autoplay}: Props) => {\n return media ? <VideoSwitch media={media} autoplay={autoplay} /> : null;\n};\n\nexport default Video;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAMA,MAAMA,UAAU,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EACnCC,SAAS,EAAE;IACTC,IAAI,EAAE,CADG;IAETC,KAAK,EAAE;EAFE;AADwB,CAAlB,CAAnB;;AAOA,MAAMC,WAAW,GAAG,CAAC;EAACC,KAAD;EAAQC;AAAR,CAAD,KAA8B;EAChD,M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native.tsx"],"names":[],"mappings":";AA0BA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/index.native.tsx"],"names":[],"mappings":";AA0BA,OAAO,EAAa,gBAAgB,EAAa,MAAM,cAAc,CAAC;AA6NtE,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBA6DrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -13,19 +13,19 @@ var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
|
13
13
|
|
|
14
14
|
var _reactNativeAnimation = require("@coorpacademy/react-native-animation");
|
|
15
15
|
|
|
16
|
-
var _index = _interopRequireDefault(require("../../
|
|
16
|
+
var _index = _interopRequireDefault(require("../../molecule/answer/index.native"));
|
|
17
17
|
|
|
18
|
-
var _index2 = _interopRequireDefault(require("../../molecule/
|
|
19
|
-
|
|
20
|
-
var _index3 = _interopRequireDefault(require("../../molecule/review-correction-popin/index.native"));
|
|
18
|
+
var _index2 = _interopRequireDefault(require("../../molecule/review-correction-popin/index.native"));
|
|
21
19
|
|
|
22
20
|
var _templateContext = require("../../template/app-review/template-context");
|
|
23
21
|
|
|
24
|
-
var
|
|
22
|
+
var _index3 = _interopRequireDefault(require("../../atom/button/index.native"));
|
|
25
23
|
|
|
26
24
|
var _propTypes = require("../../molecule/answer/prop-types");
|
|
27
25
|
|
|
28
|
-
var
|
|
26
|
+
var _index4 = _interopRequireDefault(require("../../molecule/video-player-mobile/index.native"));
|
|
27
|
+
|
|
28
|
+
var _index5 = _interopRequireDefault(require("../../atom/html/index.native"));
|
|
29
29
|
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
31
|
|
|
@@ -35,12 +35,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
35
35
|
|
|
36
36
|
const styles = _reactNative.StyleSheet.create({
|
|
37
37
|
mediaContainer: {
|
|
38
|
-
flex: 1,
|
|
39
38
|
alignItems: 'center',
|
|
40
39
|
justifyContent: 'center',
|
|
41
|
-
marginTop: 20,
|
|
42
40
|
width: '100%',
|
|
43
|
-
|
|
41
|
+
height: 200,
|
|
44
42
|
borderRadius: 10,
|
|
45
43
|
overflow: 'hidden'
|
|
46
44
|
},
|
|
@@ -56,14 +54,20 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
56
54
|
});
|
|
57
55
|
|
|
58
56
|
const MediaView = ({
|
|
59
|
-
media
|
|
57
|
+
media,
|
|
58
|
+
autoplay
|
|
60
59
|
}) => {
|
|
60
|
+
if (!media) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
61
64
|
switch (media.type) {
|
|
62
65
|
case _propTypes.TYPE_VIDEO:
|
|
63
66
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
64
67
|
style: styles.mediaContainer
|
|
65
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
66
|
-
media: media
|
|
68
|
+
}, /*#__PURE__*/_react.default.createElement(_index4.default, {
|
|
69
|
+
media: media,
|
|
70
|
+
autoplay: autoplay
|
|
67
71
|
}));
|
|
68
72
|
|
|
69
73
|
case _propTypes.TYPE_IMAGE:
|
|
@@ -121,7 +125,7 @@ const CorrectionPopin = ({
|
|
|
121
125
|
const style = animateCorrectionPopin ? [styles.correctionPopinWrapper, translateUp.animatedStyle] : styles.correctionPopinWrapper;
|
|
122
126
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
123
127
|
style: style
|
|
124
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
128
|
+
}, /*#__PURE__*/_react.default.createElement(_index2.default, _correctionPopinProps));
|
|
125
129
|
};
|
|
126
130
|
|
|
127
131
|
const createQuestionStyle = theme => _reactNative.StyleSheet.create({
|
|
@@ -152,10 +156,11 @@ const createQuestionStyle = theme => _reactNative.StyleSheet.create({
|
|
|
152
156
|
textAlign: 'center'
|
|
153
157
|
},
|
|
154
158
|
choicesScrollView: {
|
|
155
|
-
|
|
159
|
+
marginTop: 20,
|
|
156
160
|
width: '100%'
|
|
157
161
|
},
|
|
158
162
|
choicesScrollContent: {
|
|
163
|
+
justifyContent: 'space-between',
|
|
159
164
|
padding: 10
|
|
160
165
|
}
|
|
161
166
|
});
|
|
@@ -164,7 +169,8 @@ const Question = props => {
|
|
|
164
169
|
const {
|
|
165
170
|
answerUI,
|
|
166
171
|
questionText,
|
|
167
|
-
questionOrigin
|
|
172
|
+
questionOrigin = '',
|
|
173
|
+
autoplayMedia = false
|
|
168
174
|
} = props;
|
|
169
175
|
const {
|
|
170
176
|
theme
|
|
@@ -175,23 +181,29 @@ const Question = props => {
|
|
|
175
181
|
setStyle(questionStyle);
|
|
176
182
|
}, [theme]);
|
|
177
183
|
if (!answerUI || !questionText || !style) return null;
|
|
184
|
+
const hasVideoOrImage = answerUI.media?.type && [_propTypes.TYPE_VIDEO, _propTypes.TYPE_IMAGE].includes(answerUI.media.type);
|
|
178
185
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
179
186
|
style: style.questionHeading
|
|
180
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
187
|
+
}, /*#__PURE__*/_react.default.createElement(_index5.default, {
|
|
181
188
|
style: style.questionOrigin
|
|
182
|
-
}, questionOrigin), /*#__PURE__*/_react.default.createElement(
|
|
189
|
+
}, questionOrigin), /*#__PURE__*/_react.default.createElement(_index5.default, {
|
|
183
190
|
style: style.questionText
|
|
184
|
-
}, questionText), /*#__PURE__*/_react.default.createElement(
|
|
191
|
+
}, questionText), /*#__PURE__*/_react.default.createElement(_index5.default, {
|
|
185
192
|
style: style.questionHelp
|
|
186
|
-
}, (0, _get.default)('help', answerUI))),
|
|
187
|
-
media: answerUI.media
|
|
188
|
-
}) : null, /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, {
|
|
193
|
+
}, (0, _get.default)('help', answerUI))), /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, {
|
|
189
194
|
style: style.choicesScrollView,
|
|
190
195
|
contentContainerStyle: style.choicesScrollContent,
|
|
191
196
|
centerContent: true,
|
|
192
197
|
showsHorizontalScrollIndicator: false,
|
|
193
198
|
showsVerticalScrollIndicator: false
|
|
194
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
199
|
+
}, hasVideoOrImage ? /*#__PURE__*/_react.default.createElement(MediaView, {
|
|
200
|
+
media: answerUI.media,
|
|
201
|
+
autoplay: autoplayMedia
|
|
202
|
+
}) : null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
203
|
+
style: {
|
|
204
|
+
marginTop: hasVideoOrImage ? 30 : 0
|
|
205
|
+
}
|
|
206
|
+
}, /*#__PURE__*/_react.default.createElement(_index.default, answerUI))));
|
|
195
207
|
};
|
|
196
208
|
|
|
197
209
|
const createSlideStyle = (num, screenWidth) => {
|
|
@@ -253,6 +265,7 @@ const Slide = props => {
|
|
|
253
265
|
width
|
|
254
266
|
} = (0, _reactNative.useWindowDimensions)();
|
|
255
267
|
const slideStyle = createSlideStyle(num, width);
|
|
268
|
+
const isFirstSlide = num === 1;
|
|
256
269
|
const {
|
|
257
270
|
loading,
|
|
258
271
|
parentContentTitle,
|
|
@@ -274,8 +287,9 @@ const Slide = props => {
|
|
|
274
287
|
questionOrigin: parentContentTitle,
|
|
275
288
|
questionText: questionText,
|
|
276
289
|
answerUI: answerUI,
|
|
290
|
+
autoplayMedia: isFirstSlide,
|
|
277
291
|
key: "question-container"
|
|
278
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
292
|
+
}), /*#__PURE__*/_react.default.createElement(_index3.default, {
|
|
279
293
|
disabled: isValidated || validateButton.disabled,
|
|
280
294
|
submitValue: validateButton.label,
|
|
281
295
|
onPress: handleValidatePress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","mediaContainer","flex","alignItems","justifyContent","marginTop","width","minHeight","borderRadius","overflow","image","correctionPopinWrapper","position","bottom","MediaView","media","type","TYPE_VIDEO","TYPE_IMAGE","uri","url","split","TYPE_AUDIO","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","useTranslateY","fromValue","toValue","duration","easing","Easing","bezier","useEffect","start","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesScrollView","marginVertical","choicesScrollContent","padding","Question","props","answerUI","useTemplateContext","setStyle","useState","questionStyle","createSlideStyle","num","screenWidth","slideWidth","hiddenBackgroundToLockActions","left","right","top","backgroundColor","slide","height","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","validateButton","isValidated","setValidated","handleValidatePress","useCallback","Keyboard","dismiss","setTimeout","useWindowDimensions","slideStyle","loading","parentContentTitle","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState} from 'react';\n\nimport {\n Animated,\n Easing,\n Image,\n Keyboard,\n ScrollView,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from '../../molecule/answer/prop-types';\nimport Video from '../../molecule/video-player-mobile/index.native';\nimport {Media} from '../../molecule/questions/types';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n mediaContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: 20,\n width: '100%',\n minHeight: 150,\n borderRadius: 10,\n overflow: 'hidden'\n },\n image: {\n flex: 1,\n width: '100%'\n },\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst MediaView = ({media}: {media: Media}) => {\n switch (media.type) {\n case TYPE_VIDEO:\n return (\n <View style={styles.mediaContainer}>\n <Video media={media} />\n </View>\n );\n case TYPE_IMAGE: {\n const uri = `https://${media.url?.split('//')[1]}`;\n return <Image style={[styles.mediaContainer, styles.image]} source={{uri}} />;\n }\n case TYPE_AUDIO:\n default:\n return null;\n }\n};\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 500,\n toValue: 0,\n duration: 500,\n easing: Easing.bezier(0.34, 1.36, 0.64, 1)\n });\n\n // the translation is required only once on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, '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 const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesScrollView: ViewStyle;\n choicesScrollContent: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): 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 choicesScrollView: {\n marginVertical: 20,\n width: '100%'\n },\n choicesScrollContent: {\n padding: 10\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} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\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 {answerUI.media ? <MediaView media={answerUI.media} /> : null}\n <ScrollView\n style={style.choicesScrollView}\n contentContainerStyle={style.choicesScrollContent}\n centerContent\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n >\n <Answer {...answerUI} />\n </ScrollView>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n hiddenBackgroundToLockActions: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n hiddenBackgroundToLockActions: {\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n backgroundColor: '#00000000'\n },\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 {animatedStyle, slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n const [isValidated, setValidated] = useState<boolean>(false);\n\n const handleValidatePress = useCallback(() => {\n Keyboard.dismiss();\n setValidated(true);\n\n // calling the onclick later, after react has rerendered, to display the locking BG as soon as possible\n setTimeout(() => {\n validateButton.onClick();\n }, 20);\n\n // only to create on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\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 if (loading) {\n return <View style={slideStyle.slide} />;\n }\n\n return (\n <Animated.View style={[slideStyle.slide, animatedStyle]}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n <Button\n disabled={isValidated || validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {isValidated ? <View style={slideStyle.hiddenBackgroundToLockActions} /> : null}\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </Animated.View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;;;;AAAA;;AAEA;;AAYA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;AAIA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,cAAc,EAAE;IACdC,IAAI,EAAE,CADQ;IAEdC,UAAU,EAAE,QAFE;IAGdC,cAAc,EAAE,QAHF;IAIdC,SAAS,EAAE,EAJG;IAKdC,KAAK,EAAE,MALO;IAMdC,SAAS,EAAE,GANG;IAOdC,YAAY,EAAE,EAPA;IAQdC,QAAQ,EAAE;EARI,CADe;EAW/BC,KAAK,EAAE;IACLR,IAAI,EAAE,CADD;IAELI,KAAK,EAAE;EAFF,CAXwB;EAe/BK,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBP,KAAK,EAAE;EAHe;AAfO,CAAlB,CAAf;;AAsBA,MAAMQ,SAAS,GAAG,CAAC;EAACC;AAAD,CAAD,KAA6B;EAC7C,QAAQA,KAAK,CAACC,IAAd;IACE,KAAKC,qBAAL;MACE,oBACE,6BAAC,iBAAD;QAAM,KAAK,EAAEnB,MAAM,CAACG;MAApB,gBACE,6BAAC,eAAD;QAAO,KAAK,EAAEc;MAAd,EADF,CADF;;IAKF,KAAKG,qBAAL;MAAiB;QACf,MAAMC,GAAG,GAAI,WAAUJ,KAAK,CAACK,GAAN,EAAWC,KAAX,CAAiB,IAAjB,EAAuB,CAAvB,CAA0B,EAAjD;QACA,oBAAO,6BAAC,kBAAD;UAAO,KAAK,EAAE,CAACvB,MAAM,CAACG,cAAR,EAAwBH,MAAM,CAACY,KAA/B,CAAd;UAAqD,MAAM,EAAE;YAACS;UAAD;QAA7D,EAAP;MACD;;IACD,KAAKG,qBAAL;IACA;MACE,OAAO,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C,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IAtBN,CADF;AA0BD,CA3DD;;eA6DeuE,K"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","mediaContainer","alignItems","justifyContent","width","height","borderRadius","overflow","image","flex","correctionPopinWrapper","position","bottom","MediaView","media","autoplay","type","TYPE_VIDEO","TYPE_IMAGE","uri","url","split","TYPE_AUDIO","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateUp","useTranslateY","fromValue","toValue","duration","easing","Easing","bezier","useEffect","start","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","resultLabel","style","animatedStyle","createQuestionStyle","theme","questionHeading","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesScrollView","choicesScrollContent","padding","Question","props","answerUI","autoplayMedia","useTemplateContext","setStyle","useState","questionStyle","hasVideoOrImage","includes","createSlideStyle","num","screenWidth","slideWidth","hiddenBackgroundToLockActions","left","right","top","backgroundColor","slide","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","validateButton","isValidated","setValidated","handleValidatePress","useCallback","Keyboard","dismiss","setTimeout","useWindowDimensions","slideStyle","isFirstSlide","loading","parentContentTitle","disabled"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState} from 'react';\n\nimport {\n Animated,\n Easing,\n Image,\n Keyboard,\n ScrollView,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport {useTranslateY} from '@coorpacademy/react-native-animation';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from '../../molecule/answer/prop-types';\nimport Video from '../../molecule/video-player-mobile/index.native';\nimport {Media} from '../../molecule/questions/types';\nimport Html from '../../atom/html/index.native';\nimport {PopinProps, ReviewSlideProps, SlideProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n mediaContainer: {\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n height: 200,\n borderRadius: 10,\n overflow: 'hidden'\n },\n image: {\n flex: 1,\n width: '100%'\n },\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst MediaView = ({media, autoplay}: {media?: Media; autoplay: boolean}) => {\n if (!media) {\n return null;\n }\n\n switch (media.type) {\n case TYPE_VIDEO:\n return (\n <View style={styles.mediaContainer}>\n <Video media={media} autoplay={autoplay} />\n </View>\n );\n case TYPE_IMAGE: {\n const uri = `https://${media.url?.split('//')[1]}`;\n return <Image style={[styles.mediaContainer, styles.image]} source={{uri}} />;\n }\n case TYPE_AUDIO:\n default:\n return null;\n }\n};\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateUp = useTranslateY({\n fromValue: 500,\n toValue: 0,\n duration: 500,\n easing: Easing.bezier(0.34, 1.36, 0.64, 1)\n });\n\n // the translation is required only once on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => translateUp.start(), []);\n\n if (!showCorrectionPopin) return null;\n\n const klf = getOr(undefined, '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 const style = animateCorrectionPopin\n ? [styles.correctionPopinWrapper, translateUp.animatedStyle]\n : styles.correctionPopinWrapper;\n\n return (\n <Animated.View style={style}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesScrollView: ViewStyle;\n choicesScrollContent: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): 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 choicesScrollView: {\n marginTop: 20,\n width: '100%'\n },\n choicesScrollContent: {\n justifyContent: 'space-between',\n padding: 10\n }\n });\n\ntype QuestionProps = {\n autoplayMedia: boolean;\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin = '', autoplayMedia = false} = props;\n const {theme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n const hasVideoOrImage =\n answerUI.media?.type && [TYPE_VIDEO, TYPE_IMAGE].includes(answerUI.media.type);\n\n return (\n <>\n <View style={style.questionHeading}>\n <Html style={style.questionOrigin}>{questionOrigin}</Html>\n <Html style={style.questionText}>{questionText}</Html>\n <Html style={style.questionHelp}>{get('help', answerUI)}</Html>\n </View>\n <ScrollView\n style={style.choicesScrollView}\n contentContainerStyle={style.choicesScrollContent}\n centerContent\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n >\n {hasVideoOrImage ? <MediaView media={answerUI.media} autoplay={autoplayMedia} /> : null}\n <View style={{marginTop: hasVideoOrImage ? 30 : 0}}>\n <Answer {...answerUI} />\n </View>\n </ScrollView>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n hiddenBackgroundToLockActions: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n hiddenBackgroundToLockActions: {\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n backgroundColor: '#00000000'\n },\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 {animatedStyle, slide, correctionPopinProps, validateButton, num, slideIndex = '0'} = props;\n const [isValidated, setValidated] = useState<boolean>(false);\n\n const handleValidatePress = useCallback(() => {\n Keyboard.dismiss();\n setValidated(true);\n\n // calling the onclick later, after react has rerendered, to display the locking BG as soon as possible\n setTimeout(() => {\n validateButton.onClick();\n }, 20);\n\n // only to create on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n const isFirstSlide = num === 1;\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n if (loading) {\n return <View style={slideStyle.slide} />;\n }\n\n return (\n <Animated.View style={[slideStyle.slide, animatedStyle]}>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n autoplayMedia={isFirstSlide}\n key=\"question-container\"\n />\n <Button\n disabled={isValidated || validateButton.disabled}\n submitValue={validateButton.label}\n onPress={handleValidatePress}\n testID={`slide-validate-button-${slideIndex}`}\n />\n {isValidated ? <View style={slideStyle.hiddenBackgroundToLockActions} /> : null}\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </Animated.View>\n );\n};\n\nexport default Slide;\n"],"mappings":";;;;;AAAA;;AAEA;;AAYA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;;;;;;;AAGA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,cAAc,EAAE;IACdC,UAAU,EAAE,QADE;IAEdC,cAAc,EAAE,QAFF;IAGdC,KAAK,EAAE,MAHO;IAIdC,MAAM,EAAE,GAJM;IAKdC,YAAY,EAAE,EALA;IAMdC,QAAQ,EAAE;EANI,CADe;EAS/BC,KAAK,EAAE;IACLC,IAAI,EAAE,CADD;IAELL,KAAK,EAAE;EAFF,CATwB;EAa/BM,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBR,KAAK,EAAE;EAHe;AAbO,CAAlB,CAAf;;AAoBA,MAAMS,SAAS,GAAG,CAAC;EAACC,KAAD;EAAQC;AAAR,CAAD,KAA2D;EAC3E,IAAI,CAACD,KAAL,EAAY;IACV,OAAO,IAAP;EACD;;EAED,QAAQA,KAAK,CAACE,IAAd;IACE,KAAKC,qBAAL;MACE,oBACE,6BAAC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,kBAFI;IAGJ9C,YAHI;IAIJU,QAJI;IAKJnD,mBALI;IAMJC;EANI,IAOFmE,KAPJ;;EASA,IAAIkB,OAAJ,EAAa;IACX,oBAAO,6BAAC,iBAAD;MAAM,KAAK,EAAEF,UAAU,CAAChB;IAAxB,EAAP;EACD;;EAED,oBACE,6BAAC,qBAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAACgB,UAAU,CAAChB,KAAZ,EAAmB5C,aAAnB;EAAtB,gBACE,6BAAC,QAAD;IACE,cAAc,EAAE+D,kBADlB;IAEE,YAAY,EAAE9C,YAFhB;IAGE,QAAQ,EAAEU,QAHZ;IAIE,aAAa,EAAEkC,YAJjB;IAKE,GAAG,EAAC;EALN,EADF,eAQE,6BAAC,eAAD;IACE,QAAQ,EAAET,WAAW,IAAID,cAAc,CAACa,QAD1C;IAEE,WAAW,EAAEb,cAAc,CAAC3D,KAF9B;IAGE,OAAO,EAAE8D,mBAHX;IAIE,MAAM,EAAG,yBAAwB/E,UAAW;EAJ9C,EARF,EAcG6E,WAAW,gBAAG,6BAAC,iBAAD;IAAM,KAAK,EAAEQ,UAAU,CAACrB;EAAxB,EAAH,GAA+D,IAd7E,EAeGjE,oBAAoB,gBACnB,6BAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IAvBN,CADF;AA2BD,CA7DD;;eA+DeyE,K"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";AAwCA,0DAeC"}
|
|
@@ -11,7 +11,7 @@ var _isEmpty = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
|
11
11
|
|
|
12
12
|
var _map = _interopRequireDefault(require("lodash/fp/map"));
|
|
13
13
|
|
|
14
|
-
var _provider =
|
|
14
|
+
var _provider = require("../../atom/provider");
|
|
15
15
|
|
|
16
16
|
var _tooltip = _interopRequireDefault(require("../../atom/tooltip"));
|
|
17
17
|
|
|
@@ -21,18 +21,14 @@ var _style = _interopRequireDefault(require("./style.css"));
|
|
|
21
21
|
|
|
22
22
|
const _excluded = ["label", "description", "moreInfoAriaLabel"];
|
|
23
23
|
|
|
24
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
-
|
|
26
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
-
|
|
28
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
25
|
|
|
30
26
|
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); }
|
|
31
27
|
|
|
32
28
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
29
|
|
|
34
|
-
const Settings =
|
|
35
|
-
const translate = (0, _provider.GetTranslateFromContext)(
|
|
30
|
+
const Settings = props => {
|
|
31
|
+
const translate = (0, _provider.GetTranslateFromContext)();
|
|
36
32
|
|
|
37
33
|
const {
|
|
38
34
|
label,
|
|
@@ -60,9 +56,6 @@ Settings.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, _input
|
|
|
60
56
|
label: _propTypes.default.string.isRequired,
|
|
61
57
|
description: _propTypes.default.string
|
|
62
58
|
}) : {};
|
|
63
|
-
Settings.contextTypes = {
|
|
64
|
-
translate: _provider.default.childContextTypes.translate
|
|
65
|
-
};
|
|
66
59
|
|
|
67
60
|
const UserPreferences = props => {
|
|
68
61
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Settings","props","
|
|
1
|
+
{"version":3,"file":"index.js","names":["Settings","props","translate","GetTranslateFromContext","label","description","moreInfoAriaLabel","settings","style","isEmpty","infoIconTooltip","propTypes","InputSwitch","PropTypes","string","isRequired","UserPreferences","preferences","groupAriaLabel","map","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport {GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip from '../../atom/tooltip';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = props => {\n const translate = GetTranslateFromContext();\n const {label, description, moreInfoAriaLabel, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...settings} />\n <span className={style.label} tabIndex={0}>\n {label}\n </span>\n {isEmpty(description) ? null : (\n <ToolTip\n TooltipContent={description}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n data-testid=\"user-preferences-tooltip\"\n aria-label={moreInfoAriaLabel}\n iconContainerClassName={style.infoIconTooltip}\n fontSize={12}\n />\n )}\n </div>\n );\n};\n\nSettings.propTypes = {\n ...InputSwitch.propTypes,\n label: PropTypes.string.isRequired,\n description: PropTypes.string\n};\n\nconst UserPreferences = props => {\n const {preferences, moreInfoAriaLabel, groupAriaLabel} = props;\n\n return (\n <form>\n <div className={style.preferences} role=\"group\" aria-label={groupAriaLabel} tabIndex={0}>\n {map(\n settings => (\n <Settings {...settings} key={settings.label} moreInfoAriaLabel={moreInfoAriaLabel} />\n ),\n preferences\n )}\n </div>\n </form>\n );\n};\n\nUserPreferences.propTypes = {\n preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes)),\n moreInfoAriaLabel: PropTypes.string,\n groupAriaLabel: PropTypes.string\n};\n\nexport default UserPreferences;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAMC,SAAS,GAAG,IAAAC,iCAAA,GAAlB;;EACA,MAAM;IAACC,KAAD;IAAQC,WAAR;IAAqBC;EAArB,IAAuDL,KAA7D;EAAA,MAAiDM,QAAjD,iCAA6DN,KAA7D;;EACA,oBACE;IAAK,SAAS,EAAEO,cAAA,CAAMD;EAAtB,gBACE,6BAAC,oBAAD,EAAiBA,QAAjB,CADF,eAEE;IAAM,SAAS,EAAEC,cAAA,CAAMJ,KAAvB;IAA8B,QAAQ,EAAE;EAAxC,GACGA,KADH,CAFF,EAKG,IAAAK,gBAAA,EAAQJ,WAAR,IAAuB,IAAvB,gBACC,6BAAC,gBAAD;IACE,cAAc,EAAEA,WADlB;IAEE,oCAAoC,EAAEH,SAAS,CAC7C,oDAD6C,CAFjD;IAKE,eAAY,0BALd;IAME,cAAYI,iBANd;IAOE,sBAAsB,EAAEE,cAAA,CAAME,eAPhC;IAQE,QAAQ,EAAE;EARZ,EANJ,CADF;AAoBD,CAvBD;;AAyBAV,QAAQ,CAACW,SAAT,wDACKC,oBAAA,CAAYD,SADjB;EAEEP,KAAK,EAAES,kBAAA,CAAUC,MAAV,CAAiBC,UAF1B;EAGEV,WAAW,EAAEQ,kBAAA,CAAUC;AAHzB;;AAMA,MAAME,eAAe,GAAGf,KAAK,IAAI;EAC/B,MAAM;IAACgB,WAAD;IAAcX,iBAAd;IAAiCY;EAAjC,IAAmDjB,KAAzD;EAEA,oBACE,wDACE;IAAK,SAAS,EAAEO,cAAA,CAAMS,WAAtB;IAAmC,IAAI,EAAC,OAAxC;IAAgD,cAAYC,cAA5D;IAA4E,QAAQ,EAAE;EAAtF,GACG,IAAAC,YAAA,EACCZ,QAAQ,iBACN,6BAAC,QAAD,eAAcA,QAAd;IAAwB,GAAG,EAAEA,QAAQ,CAACH,KAAtC;IAA6C,iBAAiB,EAAEE;EAAhE,GAFH,EAICW,WAJD,CADH,CADF,CADF;AAYD,CAfD;;AAiBAD,eAAe,CAACL,SAAhB,2CAA4B;EAC1BM,WAAW,EAAEJ,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBrB,QAAQ,CAACW,SAAzB,CAAlB,CADa;EAE1BL,iBAAiB,EAAEO,kBAAA,CAAUC,MAFH;EAG1BI,cAAc,EAAEL,kBAAA,CAAUC;AAHA,CAA5B;eAMeE,e"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ignore_dirs":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.11.3
|
|
3
|
+
"version": "11.11.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -120,7 +120,6 @@
|
|
|
120
120
|
"@testing-library/react": "12.1.5",
|
|
121
121
|
"@testing-library/react-native": "^10.1.1",
|
|
122
122
|
"@types/react-native": "~0.68.7",
|
|
123
|
-
"@types/uuid": "^9.0.0",
|
|
124
123
|
"@typescript-eslint/eslint-plugin": "^5.39.0",
|
|
125
124
|
"@typescript-eslint/parser": "^5.39.0",
|
|
126
125
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
|
|
@@ -165,5 +164,5 @@
|
|
|
165
164
|
"last 2 versions",
|
|
166
165
|
"IE 11"
|
|
167
166
|
],
|
|
168
|
-
"gitHead": "
|
|
167
|
+
"gitHead": "62b44f766705d0cc015e583c4ca467b775a93afc"
|
|
169
168
|
}
|