ublo-lib 1.30.6 → 1.30.8
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/common/components/collapsible/collapsible.js +2 -1
- package/es/common/components/collapsible/collapsible.module.css +1 -0
- package/es/common/components/msem-preset-linker/hooks/use-msem-presets.js +10 -5
- package/es/common/components/msem-preset-linker/msem-preset-linker.js +2 -1
- package/es/esf/components/magic-box/services/api.js +2 -1
- package/package.json +1 -1
|
@@ -36,6 +36,7 @@ export default function Collapsible({
|
|
|
36
36
|
};
|
|
37
37
|
const messageLang = lang === "fr" ? "fr" : "en";
|
|
38
38
|
const message = opened ? messages[messageLang].close : messages[messageLang].open;
|
|
39
|
+
const Icon = opened ? Icons.ChevronUp : Icons.ChevronDown;
|
|
39
40
|
React.useEffect(() => {
|
|
40
41
|
const parentHeight = parentRef.current?.offsetHeight;
|
|
41
42
|
const childrenHeight = childrenRef.current?.offsetHeight;
|
|
@@ -62,7 +63,7 @@ export default function Collapsible({
|
|
|
62
63
|
}), hasOverflow && _jsxs(Button, {
|
|
63
64
|
className: styles.message,
|
|
64
65
|
onClick: toggleOpen,
|
|
65
|
-
children: [message,
|
|
66
|
+
children: [message, _jsx(Icon, {})]
|
|
66
67
|
})]
|
|
67
68
|
});
|
|
68
69
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
bottom: 0;
|
|
10
10
|
width: 100%;
|
|
11
11
|
height: calc(100% - 70px);
|
|
12
|
+
/* --gradient-color is defined in the collapsible.tsx props */
|
|
12
13
|
background: linear-gradient(to top, var(--gradient-color), transparent);
|
|
13
14
|
transition: opacity 320ms
|
|
14
15
|
var(--ds-transition-easing, cubic-bezier(0.4, 0.1, 0.2, 0.9));
|
|
@@ -4,7 +4,8 @@ import { MODES, PRESET_ATTRIBUTE } from "../msem-preset-linker";
|
|
|
4
4
|
import * as UrlParams from "../services/url-params";
|
|
5
5
|
import * as MseM from "../../../utils/msem-widget";
|
|
6
6
|
export default function useMsemPresets({
|
|
7
|
-
mode
|
|
7
|
+
mode,
|
|
8
|
+
defaultOptions
|
|
8
9
|
}) {
|
|
9
10
|
const {
|
|
10
11
|
lang,
|
|
@@ -19,23 +20,27 @@ export default function useMsemPresets({
|
|
|
19
20
|
if (!preset) return;
|
|
20
21
|
const {
|
|
21
22
|
widget,
|
|
22
|
-
options,
|
|
23
|
+
options = {},
|
|
23
24
|
presets,
|
|
24
25
|
url
|
|
25
26
|
} = JSON.parse(preset);
|
|
27
|
+
const allOptions = {
|
|
28
|
+
...defaultOptions,
|
|
29
|
+
...options
|
|
30
|
+
};
|
|
26
31
|
e.preventDefault();
|
|
27
32
|
e.stopPropagation();
|
|
28
33
|
if (url) {
|
|
29
34
|
const params = UrlParams.build({
|
|
30
|
-
options,
|
|
35
|
+
options: allOptions,
|
|
31
36
|
presets
|
|
32
37
|
});
|
|
33
38
|
const endpoint = url.concat(params);
|
|
34
39
|
window.open(endpoint, "_blank");
|
|
35
40
|
return;
|
|
36
41
|
}
|
|
37
|
-
MseM.loadWidget(widget,
|
|
38
|
-
}, []);
|
|
42
|
+
MseM.loadWidget(widget, allOptions, presets);
|
|
43
|
+
}, [defaultOptions]);
|
|
39
44
|
React.useEffect(() => {
|
|
40
45
|
const container = document.getElementById("__next");
|
|
41
46
|
if (isEnabled && container) {
|