@magmamath/students-features 0.11.0-rc.20 → 0.11.0-rc.22
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/dist/commonjs/features/chatbot/components/Chat/FadeMask.js +16 -104
- package/dist/commonjs/features/chatbot/components/Chat/FadeMask.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Chat/FadeMask.native.js +89 -0
- package/dist/commonjs/features/chatbot/components/Chat/FadeMask.native.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/Chat/FadeMask.web.js +43 -0
- package/dist/commonjs/features/chatbot/components/Chat/FadeMask.web.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/Chat/useChatScroll.js +5 -5
- package/dist/commonjs/features/chatbot/components/Chat/useChatScroll.js.map +1 -1
- package/dist/commonjs/features/chatbot/helpers.js +2 -2
- package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +1 -1
- package/dist/commonjs/shared/translation/localization/ca.json +2 -1
- package/dist/commonjs/shared/translation/localization/de.json +2 -1
- package/dist/commonjs/shared/translation/localization/en.json +2 -1
- package/dist/commonjs/shared/translation/localization/gb.json +2 -1
- package/dist/commonjs/shared/translation/localization/sct.json +2 -1
- package/dist/commonjs/shared/translation/localization/sw.json +1 -0
- package/dist/module/features/chatbot/components/Chat/FadeMask.js +1 -104
- package/dist/module/features/chatbot/components/Chat/FadeMask.js.map +1 -1
- package/dist/module/features/chatbot/components/Chat/FadeMask.native.js +81 -0
- package/dist/module/features/chatbot/components/Chat/FadeMask.native.js.map +1 -0
- package/dist/module/features/chatbot/components/Chat/FadeMask.web.js +37 -0
- package/dist/module/features/chatbot/components/Chat/FadeMask.web.js.map +1 -0
- package/dist/module/features/chatbot/components/Chat/useChatScroll.js +6 -6
- package/dist/module/features/chatbot/components/Chat/useChatScroll.js.map +1 -1
- package/dist/module/features/chatbot/helpers.js +2 -2
- package/dist/module/features/chatbot/helpers.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js +1 -1
- package/dist/module/shared/translation/localization/ca.json +2 -1
- package/dist/module/shared/translation/localization/de.json +2 -1
- package/dist/module/shared/translation/localization/en.json +2 -1
- package/dist/module/shared/translation/localization/gb.json +2 -1
- package/dist/module/shared/translation/localization/sct.json +2 -1
- package/dist/module/shared/translation/localization/sw.json +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/Chat/FadeMask.d.ts +2 -14
- package/dist/typescript/commonjs/features/chatbot/components/Chat/FadeMask.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/Chat/FadeMask.native.d.ts +18 -0
- package/dist/typescript/commonjs/features/chatbot/components/Chat/FadeMask.native.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/Chat/FadeMask.web.d.ts +19 -0
- package/dist/typescript/commonjs/features/chatbot/components/Chat/FadeMask.web.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/Chat/useChatScroll.d.ts +1 -1
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +6 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +2 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Chat/FadeMask.d.ts +2 -14
- package/dist/typescript/module/features/chatbot/components/Chat/FadeMask.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Chat/FadeMask.native.d.ts +18 -0
- package/dist/typescript/module/features/chatbot/components/Chat/FadeMask.native.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/Chat/FadeMask.web.d.ts +19 -0
- package/dist/typescript/module/features/chatbot/components/Chat/FadeMask.web.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/Chat/useChatScroll.d.ts +1 -1
- package/dist/typescript/module/shared/translation/constants.d.ts +6 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +2 -0
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/chatbot/components/Chat/{FadeMask.tsx → FadeMask.native.tsx} +11 -36
- package/src/features/chatbot/components/Chat/FadeMask.ts +2 -0
- package/src/features/chatbot/components/Chat/FadeMask.web.tsx +37 -0
- package/src/features/chatbot/components/Chat/useChatScroll.ts +5 -5
- package/src/features/chatbot/helpers.ts +2 -2
- package/src/features/chatbot/model/ChatBoxTextManager.ts +1 -1
- package/src/shared/translation/localization/ca.json +2 -1
- package/src/shared/translation/localization/de.json +2 -1
- package/src/shared/translation/localization/en.json +2 -1
- package/src/shared/translation/localization/gb.json +2 -1
- package/src/shared/translation/localization/sct.json +2 -1
- package/src/shared/translation/localization/sw.json +1 -0
|
@@ -3,111 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
-
const WEB_MASKS = {
|
|
14
|
-
top: {
|
|
15
|
-
maskImage: 'linear-gradient(to top, transparent, black 10%, black)'
|
|
16
|
-
},
|
|
17
|
-
bottom: {
|
|
18
|
-
maskImage: 'linear-gradient(to bottom, transparent, black 10%, black)'
|
|
19
|
-
},
|
|
20
|
-
both: {
|
|
21
|
-
maskImage: 'linear-gradient(to top, transparent, black 10%, black 90%, transparent)'
|
|
6
|
+
Object.defineProperty(exports, "FadeOverlays", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _FadeMaskWeb.FadeOverlays;
|
|
22
10
|
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const showBottom = fade === 'bottom' || fade === 'both';
|
|
35
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
36
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(LinearGradient, {
|
|
37
|
-
colors: ['white', 'rgba(255,255,255,0)'],
|
|
38
|
-
start: {
|
|
39
|
-
x: 0,
|
|
40
|
-
y: 0
|
|
41
|
-
},
|
|
42
|
-
end: {
|
|
43
|
-
x: 0,
|
|
44
|
-
y: 1
|
|
45
|
-
},
|
|
46
|
-
style: [styles.gradient, styles.gradientTop, {
|
|
47
|
-
opacity: showTop ? 1 : 0
|
|
48
|
-
}],
|
|
49
|
-
pointerEvents: "none"
|
|
50
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(LinearGradient, {
|
|
51
|
-
colors: ['rgba(255,255,255,0)', 'white'],
|
|
52
|
-
start: {
|
|
53
|
-
x: 0,
|
|
54
|
-
y: 0
|
|
55
|
-
},
|
|
56
|
-
end: {
|
|
57
|
-
x: 0,
|
|
58
|
-
y: 1
|
|
59
|
-
},
|
|
60
|
-
style: [styles.gradient, styles.gradientBottom, {
|
|
61
|
-
opacity: showBottom ? 1 : 0
|
|
62
|
-
}],
|
|
63
|
-
pointerEvents: "none"
|
|
64
|
-
})]
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
const NoopOverlays = _ => null;
|
|
68
|
-
const FadeOverlays = exports.FadeOverlays = _reactNativeUi.IS_WEB ? NoopOverlays : NativeFadeOverlays;
|
|
69
|
-
const useWebFadeUpdate = () => {
|
|
70
|
-
const fadeRef = (0, _react.useRef)(null);
|
|
71
|
-
const lastFade = (0, _react.useRef)(undefined);
|
|
72
|
-
const [webMask, setWebMask] = (0, _react.useState)(undefined);
|
|
73
|
-
const updateFade = (0, _react.useCallback)(fade => {
|
|
74
|
-
if (fade === lastFade.current) return;
|
|
75
|
-
lastFade.current = fade;
|
|
76
|
-
setWebMask(fade ? WEB_MASKS[fade] : undefined);
|
|
77
|
-
}, []);
|
|
78
|
-
return {
|
|
79
|
-
fadeRef,
|
|
80
|
-
updateFade,
|
|
81
|
-
webMask
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
const useNativeFadeUpdate = () => {
|
|
85
|
-
const fadeRef = (0, _react.useRef)(null);
|
|
86
|
-
const lastFade = (0, _react.useRef)(undefined);
|
|
87
|
-
const updateFade = (0, _react.useCallback)(fade => {
|
|
88
|
-
if (fade === lastFade.current) return;
|
|
89
|
-
lastFade.current = fade;
|
|
90
|
-
fadeRef.current?.(fade);
|
|
91
|
-
}, []);
|
|
92
|
-
return {
|
|
93
|
-
fadeRef,
|
|
94
|
-
updateFade,
|
|
95
|
-
webMask: undefined
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
const useFadeUpdate = exports.useFadeUpdate = _reactNativeUi.IS_WEB ? useWebFadeUpdate : useNativeFadeUpdate;
|
|
99
|
-
const styles = _reactNative.StyleSheet.create({
|
|
100
|
-
gradient: {
|
|
101
|
-
position: 'absolute',
|
|
102
|
-
left: 0,
|
|
103
|
-
right: 0,
|
|
104
|
-
height: FADE_HEIGHT
|
|
105
|
-
},
|
|
106
|
-
gradientTop: {
|
|
107
|
-
top: 0
|
|
108
|
-
},
|
|
109
|
-
gradientBottom: {
|
|
110
|
-
bottom: 0
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "FadePosition", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _FadeMaskWeb.FadePosition;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "useFadeUpdate", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _FadeMaskWeb.useFadeUpdate;
|
|
111
22
|
}
|
|
112
23
|
});
|
|
24
|
+
var _FadeMaskWeb = require("./FadeMask.web.js");
|
|
113
25
|
//# sourceMappingURL=FadeMask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_FadeMaskWeb","require"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Chat/FadeMask.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useFadeUpdate = exports.FadePosition = exports.FadeOverlays = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeLinearGradient = require("react-native-linear-gradient");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
let FadePosition = exports.FadePosition = /*#__PURE__*/function (FadePosition) {
|
|
14
|
+
FadePosition["TOP"] = "top";
|
|
15
|
+
FadePosition["BOTTOM"] = "bottom";
|
|
16
|
+
FadePosition["BOTH"] = "both";
|
|
17
|
+
return FadePosition;
|
|
18
|
+
}({});
|
|
19
|
+
const FADE_HEIGHT = 35;
|
|
20
|
+
const FadeOverlays = ({
|
|
21
|
+
fadeRef
|
|
22
|
+
}) => {
|
|
23
|
+
const [fade, setFade] = (0, _react.useState)(undefined);
|
|
24
|
+
fadeRef.current = setFade;
|
|
25
|
+
const showTop = fade === FadePosition.TOP || fade === FadePosition.BOTH;
|
|
26
|
+
const showBottom = fade === FadePosition.BOTTOM || fade === FadePosition.BOTH;
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
28
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeLinearGradient.LinearGradient, {
|
|
29
|
+
colors: ['white', 'rgba(255,255,255,0)'],
|
|
30
|
+
start: {
|
|
31
|
+
x: 0,
|
|
32
|
+
y: 0
|
|
33
|
+
},
|
|
34
|
+
end: {
|
|
35
|
+
x: 0,
|
|
36
|
+
y: 1
|
|
37
|
+
},
|
|
38
|
+
style: [styles.gradient, styles.gradientTop, {
|
|
39
|
+
opacity: showTop ? 1 : 0
|
|
40
|
+
}],
|
|
41
|
+
pointerEvents: "none"
|
|
42
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeLinearGradient.LinearGradient, {
|
|
43
|
+
colors: ['rgba(255,255,255,0)', 'white'],
|
|
44
|
+
start: {
|
|
45
|
+
x: 0,
|
|
46
|
+
y: 0
|
|
47
|
+
},
|
|
48
|
+
end: {
|
|
49
|
+
x: 0,
|
|
50
|
+
y: 1
|
|
51
|
+
},
|
|
52
|
+
style: [styles.gradient, styles.gradientBottom, {
|
|
53
|
+
opacity: showBottom ? 1 : 0
|
|
54
|
+
}],
|
|
55
|
+
pointerEvents: "none"
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
exports.FadeOverlays = FadeOverlays;
|
|
60
|
+
const useFadeUpdate = () => {
|
|
61
|
+
const fadeRef = (0, _react.useRef)(null);
|
|
62
|
+
const lastFade = (0, _react.useRef)(undefined);
|
|
63
|
+
const updateFade = (0, _react.useCallback)(fade => {
|
|
64
|
+
if (fade === lastFade.current) return;
|
|
65
|
+
lastFade.current = fade;
|
|
66
|
+
fadeRef.current?.(fade);
|
|
67
|
+
}, []);
|
|
68
|
+
return {
|
|
69
|
+
fadeRef,
|
|
70
|
+
updateFade,
|
|
71
|
+
webMask: undefined
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
exports.useFadeUpdate = useFadeUpdate;
|
|
75
|
+
const styles = _reactNative.StyleSheet.create({
|
|
76
|
+
gradient: {
|
|
77
|
+
position: 'absolute',
|
|
78
|
+
left: 0,
|
|
79
|
+
right: 0,
|
|
80
|
+
height: FADE_HEIGHT
|
|
81
|
+
},
|
|
82
|
+
gradientTop: {
|
|
83
|
+
top: 0
|
|
84
|
+
},
|
|
85
|
+
gradientBottom: {
|
|
86
|
+
bottom: 0
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=FadeMask.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeLinearGradient","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","FadePosition","exports","FADE_HEIGHT","FadeOverlays","fadeRef","fade","setFade","useState","undefined","current","showTop","TOP","BOTH","showBottom","BOTTOM","jsxs","Fragment","children","jsx","LinearGradient","colors","start","x","y","end","style","styles","gradient","gradientTop","opacity","pointerEvents","gradientBottom","useFadeUpdate","useRef","lastFade","updateFade","useCallback","webMask","StyleSheet","create","position","left","right","height","top","bottom"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Chat/FadeMask.native.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAA6D,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAA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AQ,EAAE;IACRa,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAEzC;EACV,CAAC;EACD0B,WAAW,EAAE;IACXgB,GAAG,EAAE;EACP,CAAC;EACDb,cAAc,EAAE;IACdc,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useFadeUpdate = exports.FadePosition = exports.FadeOverlays = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
let FadePosition = exports.FadePosition = /*#__PURE__*/function (FadePosition) {
|
|
9
|
+
FadePosition["TOP"] = "top";
|
|
10
|
+
FadePosition["BOTTOM"] = "bottom";
|
|
11
|
+
FadePosition["BOTH"] = "both";
|
|
12
|
+
return FadePosition;
|
|
13
|
+
}({});
|
|
14
|
+
const WEB_MASKS = {
|
|
15
|
+
[FadePosition.TOP]: {
|
|
16
|
+
maskImage: 'linear-gradient(to top, transparent, black 10%, black)'
|
|
17
|
+
},
|
|
18
|
+
[FadePosition.BOTTOM]: {
|
|
19
|
+
maskImage: 'linear-gradient(to bottom, transparent, black 10%, black)'
|
|
20
|
+
},
|
|
21
|
+
[FadePosition.BOTH]: {
|
|
22
|
+
maskImage: 'linear-gradient(to top, transparent, black 10%, black 90%, transparent)'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const FadeOverlays = _ => null;
|
|
26
|
+
exports.FadeOverlays = FadeOverlays;
|
|
27
|
+
const useFadeUpdate = () => {
|
|
28
|
+
const fadeRef = (0, _react.useRef)(null);
|
|
29
|
+
const lastFade = (0, _react.useRef)(undefined);
|
|
30
|
+
const [webMask, setWebMask] = (0, _react.useState)(undefined);
|
|
31
|
+
const updateFade = (0, _react.useCallback)(fade => {
|
|
32
|
+
if (fade === lastFade.current) return;
|
|
33
|
+
lastFade.current = fade;
|
|
34
|
+
setWebMask(fade ? WEB_MASKS[fade] : undefined);
|
|
35
|
+
}, []);
|
|
36
|
+
return {
|
|
37
|
+
fadeRef,
|
|
38
|
+
updateFade,
|
|
39
|
+
webMask
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
exports.useFadeUpdate = useFadeUpdate;
|
|
43
|
+
//# sourceMappingURL=FadeMask.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","FadePosition","exports","WEB_MASKS","TOP","maskImage","BOTTOM","BOTH","FadeOverlays","_","useFadeUpdate","fadeRef","useRef","lastFade","undefined","webMask","setWebMask","useState","updateFade","useCallback","fade","current"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Chat/FadeMask.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAuE,IAG3DC,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAWxB,MAAME,SAA0C,GAAG;EACjD,CAACF,YAAY,CAACG,GAAG,GAAG;IAAEC,SAAS,EAAE;EAAyD,CAAQ;EAClG,CAACJ,YAAY,CAACK,MAAM,GAAG;IAAED,SAAS,EAAE;EAA4D,CAAQ;EACxG,CAACJ,YAAY,CAACM,IAAI,GAAG;IACnBF,SAAS,EAAE;EACb;AACF,CAAC;AAEM,MAAMG,YAAY,GAAIC,CAAoB,IAAK,IAAI;AAAAP,OAAA,CAAAM,YAAA,GAAAA,YAAA;AAEnD,MAAME,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAMC,OAAO,GAAG,IAAAC,aAAM,EAAsB,IAAI,CAAC;EACjD,MAAMC,QAAQ,GAAG,IAAAD,aAAM,EAA2BE,SAAS,CAAC;EAC5D,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAAwBH,SAAS,CAAC;EAExE,MAAMI,UAAU,GAAG,IAAAC,kBAAW,EAAEC,IAA8B,IAAK;IACjE,IAAIA,IAAI,KAAKP,QAAQ,CAACQ,OAAO,EAAE;IAC/BR,QAAQ,CAACQ,OAAO,GAAGD,IAAI;IACvBJ,UAAU,CAACI,IAAI,GAAGjB,SAAS,CAACiB,IAAI,CAAC,GAAGN,SAAS,CAAC;EAChD,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IAAEH,OAAO;IAAEO,UAAU;IAAEH;EAAQ,CAAC;AACzC,CAAC;AAAAb,OAAA,CAAAQ,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -14,11 +14,11 @@ const initialScrollState = {
|
|
|
14
14
|
listHeight: 0,
|
|
15
15
|
contentHeight: 0
|
|
16
16
|
};
|
|
17
|
-
const computeFade =
|
|
18
|
-
if (!
|
|
19
|
-
if (
|
|
20
|
-
if (
|
|
21
|
-
return
|
|
17
|
+
const computeFade = scrollState => {
|
|
18
|
+
if (!scrollState.isScrollable) return undefined;
|
|
19
|
+
if (scrollState.isAtTop) return _FadeMask.FadePosition.BOTTOM;
|
|
20
|
+
if (scrollState.isScrolledUp) return _FadeMask.FadePosition.BOTH;
|
|
21
|
+
return _FadeMask.FadePosition.TOP;
|
|
22
22
|
};
|
|
23
23
|
const useChatScroll = () => {
|
|
24
24
|
const listRef = (0, _react.useRef)(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_constants","_FadeMask","initialScrollState","isScrollable","isScrolledUp","isAtTop","listHeight","contentHeight","computeFade","
|
|
1
|
+
{"version":3,"names":["_react","require","_constants","_FadeMask","initialScrollState","isScrollable","isScrolledUp","isAtTop","listHeight","contentHeight","computeFade","scrollState","undefined","FadePosition","BOTTOM","BOTH","TOP","useChatScroll","listRef","useRef","scroll","setIsScrolledUp","useState","fadeRef","updateFade","webMask","useFadeUpdate","handleScroll","useCallback","e","contentOffset","contentSize","layoutMeasurement","nativeEvent","scrolledUp","y","SCROLL_BOTTOM_THRESHOLD","atTop","height","s","current","wasScrolledUp","handleLayout","layout","handleContentSizeChange","_","scrollToBottom","scrollToOffset","offset","animated","reset","exports"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Chat/useChatScroll.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAUA,MAAMG,kBAA+B,GAAG;EACtCC,YAAY,EAAE,KAAK;EACnBC,YAAY,EAAE,KAAK;EACnBC,OAAO,EAAE,KAAK;EACdC,UAAU,EAAE,CAAC;EACbC,aAAa,EAAE;AACjB,CAAC;AAED,MAAMC,WAAW,GAAIC,WAAwB,IAAK;EAChD,IAAI,CAACA,WAAW,CAACN,YAAY,EAAE,OAAOO,SAAS;EAC/C,IAAID,WAAW,CAACJ,OAAO,EAAE,OAAOM,sBAAY,CAACC,MAAM;EACnD,IAAIH,WAAW,CAACL,YAAY,EAAE,OAAOO,sBAAY,CAACE,IAAI;EACtD,OAAOF,sBAAY,CAACG,GAAG;AACzB,CAAC;AAEM,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAMC,OAAO,GAAG,IAAAC,aAAM,EAAW,IAAI,CAAC;EACtC,MAAMC,MAAM,GAAG,IAAAD,aAAM,EAAc;IAAE,GAAGf;EAAmB,CAAC,CAAC;EAC7D,MAAM,CAACE,YAAY,EAAEe,eAAe,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EACvD,MAAM;IAAEC,OAAO;IAAEC,UAAU;IAAEC;EAAQ,CAAC,GAAG,IAAAC,uBAAa,EAAC,CAAC;EAExD,MAAMC,YAAY,GAAG,IAAAC,kBAAW,EAC7BC,CAA0C,IAAK;IAC9C,MAAM;MAAEC,aAAa;MAAEC,WAAW;MAAEC;IAAkB,CAAC,GAAGH,CAAC,CAACI,WAAW;IACvE,MAAM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C;EAED,MAAMsB,cAAc,GAAG,IAAAlB,kBAAW,EAAC,MAAM;IACvC,IAAIR,MAAM,CAACoB,OAAO,CAAClC,YAAY,EAAE;MAC/BY,OAAO,CAACsB,OAAO,EAAEO,cAAc,CAAC;QAAEC,MAAM,EAAE,CAAC;QAAEC,QAAQ,EAAE;MAAK,CAAC,CAAC;IAChE;EACF,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,KAAK,GAAG,IAAAtB,kBAAW,EAAC,MAAM;IAC9BR,MAAM,CAACoB,OAAO,GAAG;MAAE,GAAGpC;IAAmB,CAAC;IAC1CiB,eAAe,CAAC,KAAK,CAAC;IACtBG,UAAU,CAACZ,SAAS,CAAC;EACvB,CAAC,EAAE,CAACY,UAAU,CAAC,CAAC;EAEhB,OAAO;IACLN,OAAO;IACPE,MAAM;IACNd,YAAY;IACZiB,OAAO;IACPE,OAAO;IACPE,YAAY;IACZe,YAAY;IACZE,uBAAuB;IACvBE,cAAc;IACdI;EACF,CAAC;AACH,CAAC;AAAAC,OAAA,CAAAlC,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -29,12 +29,12 @@ const transformAlternatives = payload => {
|
|
|
29
29
|
isOpenChatEnabled,
|
|
30
30
|
options: {
|
|
31
31
|
default: [{
|
|
32
|
-
text:
|
|
32
|
+
text: (0, _index.t)('chat.needHint'),
|
|
33
33
|
promptKey: payload.options.default[0].promptKey,
|
|
34
34
|
translatedText: payload.options.default[0].translatedText
|
|
35
35
|
}],
|
|
36
36
|
hints: [{
|
|
37
|
-
text: isOpenChatEnabled ? (0, _index.t)('chat.
|
|
37
|
+
text: isOpenChatEnabled ? (0, _index.t)('chat.needHint') : (0, _index.t)('chat.anotherHint'),
|
|
38
38
|
promptKey: payload.options.hints[0].promptKey,
|
|
39
39
|
translatedText: payload.options.hints[0].translatedText
|
|
40
40
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeUi","require","_constants","_index","_modelTypes","decodeHTMLEntities","input","replace","exports","replaceKatexSyntax","texts","reverse","replacements","Object","entries","KATEX_REPLACEMENTS_REVERSE","KATEX_REPLACEMENTS","map","text","reduce","newText","pattern","placeholder","RegExp","transformAlternatives","payload","isOpenChatEnabled","IS_WEB","options","default","t","promptKey","translatedText","hints","prepareChatRequestPayload","threadItem","conversationId","freeTextMessage","problemDescription","problemStandards","problemAnswer","language","imageCdnId","imageAltText","answerOptions","answer","type","ChatRequestType","FREETEXT","data","message","length","correctAnswer","altText","HINT","getNextHintProps","userAnswer"],"sourceRoot":"../../../../src","sources":["features/chatbot/helpers.ts"],"mappings":";;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AALA;;AAOO,MAAMI,kBAAkB,GAAIC,KAAa,IAAK;EACnD,OAAOA,KAAK,CAACC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;AACrC,CAAC;AAAAC,OAAA,CAAAH,kBAAA,GAAAA,kBAAA;AAEM,MAAMI,kBAAkB,GAAGA,CAACC,KAAe,EAAEC,OAAO,GAAG,KAAK,KAAK;EACtE,MAAMC,YAAY,GAAGD,OAAO,GACxBE,MAAM,CAACC,OAAO,CAACC,qCAA0B,CAAC,GAC1CF,MAAM,CAACC,OAAO,CAACE,6BAAkB,CAAC;EAEtC,OAAON,KAAK,CAACO,GAAG,CAAEC,IAAI,IACpBN,YAAY,CAACO,MAAM,CACjB,CAACC,OAAO,EAAE,CAACC,OAAO,EAAEC,WAAW,CAAC,KAAKF,OAAO,CAACb,OAAO,CAAC,IAAIgB,MAAM,CAACF,OAAO,EAAE,GAAG,CAAC,EAAEC,WAAW,CAAC,EAC3FJ,IACF,CACF,CAAC;AACH,CAAC;AAAAV,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAEM,MAAMe,qBAAqB,GAAIC,OAAuC,IAAK;EAChF,IAAI,CAACA,OAAO,EAAE,OAAOA,OAAO;EAE5B,MAAMC,iBAAiB,GAAG,CAAC,CAACD,OAAO,CAACC,iBAAiB,IAAIC,qBAAM;EAE/D,OAAO;IACL,GAAGF,OAAO;IACVC,iBAAiB;IACjBE,OAAO,EAAE;MACPC,OAAO,EAAE,CACP;QACEX,IAAI,
|
|
1
|
+
{"version":3,"names":["_reactNativeUi","require","_constants","_index","_modelTypes","decodeHTMLEntities","input","replace","exports","replaceKatexSyntax","texts","reverse","replacements","Object","entries","KATEX_REPLACEMENTS_REVERSE","KATEX_REPLACEMENTS","map","text","reduce","newText","pattern","placeholder","RegExp","transformAlternatives","payload","isOpenChatEnabled","IS_WEB","options","default","t","promptKey","translatedText","hints","prepareChatRequestPayload","threadItem","conversationId","freeTextMessage","problemDescription","problemStandards","problemAnswer","language","imageCdnId","imageAltText","answerOptions","answer","type","ChatRequestType","FREETEXT","data","message","length","correctAnswer","altText","HINT","getNextHintProps","userAnswer"],"sourceRoot":"../../../../src","sources":["features/chatbot/helpers.ts"],"mappings":";;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AALA;;AAOO,MAAMI,kBAAkB,GAAIC,KAAa,IAAK;EACnD,OAAOA,KAAK,CAACC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;AACrC,CAAC;AAAAC,OAAA,CAAAH,kBAAA,GAAAA,kBAAA;AAEM,MAAMI,kBAAkB,GAAGA,CAACC,KAAe,EAAEC,OAAO,GAAG,KAAK,KAAK;EACtE,MAAMC,YAAY,GAAGD,OAAO,GACxBE,MAAM,CAACC,OAAO,CAACC,qCAA0B,CAAC,GAC1CF,MAAM,CAACC,OAAO,CAACE,6BAAkB,CAAC;EAEtC,OAAON,KAAK,CAACO,GAAG,CAAEC,IAAI,IACpBN,YAAY,CAACO,MAAM,CACjB,CAACC,O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
14
|
messages = {
|
|
15
15
|
error: this.messagesCreator.createMessage('chat.errorMessage', {
|
|
16
|
-
options: [this.messagesCreator.createOption('chat.
|
|
16
|
+
options: [this.messagesCreator.createOption('chat.needHint')]
|
|
17
17
|
}),
|
|
18
18
|
start: this.messagesCreator.createMessage('chat.howCanIHelp'),
|
|
19
19
|
endMessage: this.messagesCreator.createMessage('chat.answerAgain'),
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"time.yearsAgo": "{{count}} years ago",
|
|
15
15
|
"chat": {
|
|
16
16
|
"anotherHint": "Give me another hint",
|
|
17
|
-
"giveHint": "
|
|
17
|
+
"giveHint": "Give me a hint",
|
|
18
|
+
"needHint": "I need a hint",
|
|
18
19
|
"giveHintOpenChat": "I need a hint",
|
|
19
20
|
"answerAgain": "Answer again to get another hint!",
|
|
20
21
|
"errorMessage": "Something went wrong! Try again",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"time.yearsAgo": "vor {{count}} Jahren",
|
|
15
15
|
"chat": {
|
|
16
16
|
"anotherHint": "Gib mir noch einen Hinweis",
|
|
17
|
-
"giveHint": "
|
|
17
|
+
"giveHint": "Gib mir bitte einen Hinweis",
|
|
18
|
+
"needHint": "Ich brauche einen Hinweis",
|
|
18
19
|
"giveHintOpenChat": "Ich brauche einen Hinweis",
|
|
19
20
|
"answerAgain": "Noch einmal antworten, um einen weiteren Hinweis zu bekommen!",
|
|
20
21
|
"errorMessage": "Etwas ist schiefgelaufen! Versuch es erneut",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"time.yearsAgo": "{{count}} years ago",
|
|
15
15
|
"chat": {
|
|
16
16
|
"anotherHint": "Give me another hint",
|
|
17
|
-
"giveHint": "
|
|
17
|
+
"giveHint": "Give me a hint",
|
|
18
|
+
"needHint": "I need a hint",
|
|
18
19
|
"giveHintOpenChat": "I need a hint",
|
|
19
20
|
"answerAgain": "Answer again to get another hint!",
|
|
20
21
|
"errorMessage": "Something went wrong! Try again",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"time.yearsAgo": "{{count}} years ago",
|
|
15
15
|
"chat": {
|
|
16
16
|
"anotherHint": "Give me another hint",
|
|
17
|
-
"giveHint": "
|
|
17
|
+
"giveHint": "Give me a hint",
|
|
18
|
+
"needHint": "I need a hint",
|
|
18
19
|
"giveHintOpenChat": "I need a hint",
|
|
19
20
|
"answerAgain": "Answer again to get another hint!",
|
|
20
21
|
"errorMessage": "Something went wrong! Try again",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"time.yearsAgo": "{{count}} years ago",
|
|
15
15
|
"chat": {
|
|
16
16
|
"anotherHint": "Give me another hint",
|
|
17
|
-
"giveHint": "
|
|
17
|
+
"giveHint": "Give me a hint",
|
|
18
|
+
"needHint": "I need a hint",
|
|
18
19
|
"giveHintOpenChat": "I need a hint",
|
|
19
20
|
"answerAgain": "Answer again to get another hint!",
|
|
20
21
|
"errorMessage": "Something went wrong! Try again",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"chat": {
|
|
16
16
|
"anotherHint": "Ge mig en till ledtråd",
|
|
17
17
|
"giveHint": "Ge mig en ledtråd",
|
|
18
|
+
"needHint": "Ge mig en ledtråd",
|
|
18
19
|
"giveHintOpenChat": "Ge ledtråd",
|
|
19
20
|
"answerAgain": "Svara igen för att få en till ledtråd!",
|
|
20
21
|
"errorMessage": "Något gick snett! Försök igen",
|
|
@@ -1,107 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import { StyleSheet } from 'react-native';
|
|
5
|
-
import { IS_WEB } from '@magmamath/react-native-ui';
|
|
6
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
const WEB_MASKS = {
|
|
8
|
-
top: {
|
|
9
|
-
maskImage: 'linear-gradient(to top, transparent, black 10%, black)'
|
|
10
|
-
},
|
|
11
|
-
bottom: {
|
|
12
|
-
maskImage: 'linear-gradient(to bottom, transparent, black 10%, black)'
|
|
13
|
-
},
|
|
14
|
-
both: {
|
|
15
|
-
maskImage: 'linear-gradient(to top, transparent, black 10%, black 90%, transparent)'
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const FADE_HEIGHT = 35;
|
|
19
|
-
const NativeFadeOverlays = ({
|
|
20
|
-
fadeRef
|
|
21
|
-
}) => {
|
|
22
|
-
const {
|
|
23
|
-
LinearGradient
|
|
24
|
-
} = require('react-native-linear-gradient');
|
|
25
|
-
const [fade, setFade] = useState(undefined);
|
|
26
|
-
fadeRef.current = setFade;
|
|
27
|
-
const showTop = fade === 'top' || fade === 'both';
|
|
28
|
-
const showBottom = fade === 'bottom' || fade === 'both';
|
|
29
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
30
|
-
children: [/*#__PURE__*/_jsx(LinearGradient, {
|
|
31
|
-
colors: ['white', 'rgba(255,255,255,0)'],
|
|
32
|
-
start: {
|
|
33
|
-
x: 0,
|
|
34
|
-
y: 0
|
|
35
|
-
},
|
|
36
|
-
end: {
|
|
37
|
-
x: 0,
|
|
38
|
-
y: 1
|
|
39
|
-
},
|
|
40
|
-
style: [styles.gradient, styles.gradientTop, {
|
|
41
|
-
opacity: showTop ? 1 : 0
|
|
42
|
-
}],
|
|
43
|
-
pointerEvents: "none"
|
|
44
|
-
}), /*#__PURE__*/_jsx(LinearGradient, {
|
|
45
|
-
colors: ['rgba(255,255,255,0)', 'white'],
|
|
46
|
-
start: {
|
|
47
|
-
x: 0,
|
|
48
|
-
y: 0
|
|
49
|
-
},
|
|
50
|
-
end: {
|
|
51
|
-
x: 0,
|
|
52
|
-
y: 1
|
|
53
|
-
},
|
|
54
|
-
style: [styles.gradient, styles.gradientBottom, {
|
|
55
|
-
opacity: showBottom ? 1 : 0
|
|
56
|
-
}],
|
|
57
|
-
pointerEvents: "none"
|
|
58
|
-
})]
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
const NoopOverlays = _ => null;
|
|
62
|
-
export const FadeOverlays = IS_WEB ? NoopOverlays : NativeFadeOverlays;
|
|
63
|
-
const useWebFadeUpdate = () => {
|
|
64
|
-
const fadeRef = useRef(null);
|
|
65
|
-
const lastFade = useRef(undefined);
|
|
66
|
-
const [webMask, setWebMask] = useState(undefined);
|
|
67
|
-
const updateFade = useCallback(fade => {
|
|
68
|
-
if (fade === lastFade.current) return;
|
|
69
|
-
lastFade.current = fade;
|
|
70
|
-
setWebMask(fade ? WEB_MASKS[fade] : undefined);
|
|
71
|
-
}, []);
|
|
72
|
-
return {
|
|
73
|
-
fadeRef,
|
|
74
|
-
updateFade,
|
|
75
|
-
webMask
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
const useNativeFadeUpdate = () => {
|
|
79
|
-
const fadeRef = useRef(null);
|
|
80
|
-
const lastFade = useRef(undefined);
|
|
81
|
-
const updateFade = useCallback(fade => {
|
|
82
|
-
if (fade === lastFade.current) return;
|
|
83
|
-
lastFade.current = fade;
|
|
84
|
-
fadeRef.current?.(fade);
|
|
85
|
-
}, []);
|
|
86
|
-
return {
|
|
87
|
-
fadeRef,
|
|
88
|
-
updateFade,
|
|
89
|
-
webMask: undefined
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
export const useFadeUpdate = IS_WEB ? useWebFadeUpdate : useNativeFadeUpdate;
|
|
93
|
-
const styles = StyleSheet.create({
|
|
94
|
-
gradient: {
|
|
95
|
-
position: 'absolute',
|
|
96
|
-
left: 0,
|
|
97
|
-
right: 0,
|
|
98
|
-
height: FADE_HEIGHT
|
|
99
|
-
},
|
|
100
|
-
gradientTop: {
|
|
101
|
-
top: 0
|
|
102
|
-
},
|
|
103
|
-
gradientBottom: {
|
|
104
|
-
bottom: 0
|
|
105
|
-
}
|
|
106
|
-
});
|
|
3
|
+
export { FadePosition, FadeOverlays, useFadeUpdate } from "./FadeMask.web.js";
|
|
107
4
|
//# sourceMappingURL=FadeMask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["FadePosition","FadeOverlays","useFadeUpdate"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Chat/FadeMask.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,YAAY,EAAEC,aAAa,QAAQ,mBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useCallback, useRef, useState } from 'react';
|
|
4
|
+
import { StyleSheet } from 'react-native';
|
|
5
|
+
import { LinearGradient } from 'react-native-linear-gradient';
|
|
6
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export let FadePosition = /*#__PURE__*/function (FadePosition) {
|
|
8
|
+
FadePosition["TOP"] = "top";
|
|
9
|
+
FadePosition["BOTTOM"] = "bottom";
|
|
10
|
+
FadePosition["BOTH"] = "both";
|
|
11
|
+
return FadePosition;
|
|
12
|
+
}({});
|
|
13
|
+
const FADE_HEIGHT = 35;
|
|
14
|
+
export const FadeOverlays = ({
|
|
15
|
+
fadeRef
|
|
16
|
+
}) => {
|
|
17
|
+
const [fade, setFade] = useState(undefined);
|
|
18
|
+
fadeRef.current = setFade;
|
|
19
|
+
const showTop = fade === FadePosition.TOP || fade === FadePosition.BOTH;
|
|
20
|
+
const showBottom = fade === FadePosition.BOTTOM || fade === FadePosition.BOTH;
|
|
21
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
22
|
+
children: [/*#__PURE__*/_jsx(LinearGradient, {
|
|
23
|
+
colors: ['white', 'rgba(255,255,255,0)'],
|
|
24
|
+
start: {
|
|
25
|
+
x: 0,
|
|
26
|
+
y: 0
|
|
27
|
+
},
|
|
28
|
+
end: {
|
|
29
|
+
x: 0,
|
|
30
|
+
y: 1
|
|
31
|
+
},
|
|
32
|
+
style: [styles.gradient, styles.gradientTop, {
|
|
33
|
+
opacity: showTop ? 1 : 0
|
|
34
|
+
}],
|
|
35
|
+
pointerEvents: "none"
|
|
36
|
+
}), /*#__PURE__*/_jsx(LinearGradient, {
|
|
37
|
+
colors: ['rgba(255,255,255,0)', 'white'],
|
|
38
|
+
start: {
|
|
39
|
+
x: 0,
|
|
40
|
+
y: 0
|
|
41
|
+
},
|
|
42
|
+
end: {
|
|
43
|
+
x: 0,
|
|
44
|
+
y: 1
|
|
45
|
+
},
|
|
46
|
+
style: [styles.gradient, styles.gradientBottom, {
|
|
47
|
+
opacity: showBottom ? 1 : 0
|
|
48
|
+
}],
|
|
49
|
+
pointerEvents: "none"
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
export const useFadeUpdate = () => {
|
|
54
|
+
const fadeRef = useRef(null);
|
|
55
|
+
const lastFade = useRef(undefined);
|
|
56
|
+
const updateFade = useCallback(fade => {
|
|
57
|
+
if (fade === lastFade.current) return;
|
|
58
|
+
lastFade.current = fade;
|
|
59
|
+
fadeRef.current?.(fade);
|
|
60
|
+
}, []);
|
|
61
|
+
return {
|
|
62
|
+
fadeRef,
|
|
63
|
+
updateFade,
|
|
64
|
+
webMask: undefined
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
const styles = StyleSheet.create({
|
|
68
|
+
gradient: {
|
|
69
|
+
position: 'absolute',
|
|
70
|
+
left: 0,
|
|
71
|
+
right: 0,
|
|
72
|
+
height: FADE_HEIGHT
|
|
73
|
+
},
|
|
74
|
+
gradientTop: {
|
|
75
|
+
top: 0
|
|
76
|
+
},
|
|
77
|
+
gradientBottom: {
|
|
78
|
+
bottom: 0
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=FadeMask.native.js.map
|