ublo-lib 1.17.5 → 1.17.7
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/msem-preset-editor/msem-preset-editor.d.ts.map +1 -1
- package/es/common/components/msem-preset-editor/msem-preset-editor.js +12 -5
- package/es/common/hooks/use-packages.js +2 -0
- package/es/esf/components/cp-form.js +2 -0
- package/es/esf/components/magic-box/booking.js +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"msem-preset-editor.d.ts","sourceRoot":"","sources":["../../../../src/common/components/msem-preset-editor/msem-preset-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoB/B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACzB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;KACxB,CAAC;IACF,IAAI,CAAC,EAAE;QACL,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAC/C,QAAQ,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KAC/C,CAAC;IACF,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,cAAc,EACd,QAAQ,EACR,QAAQ,GACT,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"msem-preset-editor.d.ts","sourceRoot":"","sources":["../../../../src/common/components/msem-preset-editor/msem-preset-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoB/B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACzB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;KACxB,CAAC;IACF,IAAI,CAAC,EAAE;QACL,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAC/C,QAAQ,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KAC/C,CAAC;IACF,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,cAAc,EACd,QAAQ,EACR,QAAQ,GACT,EAAE,KAAK,kDAiMP"}
|
|
@@ -26,6 +26,7 @@ export default function MseMPresetEditor({ lang, options, urls, selectedPreset,
|
|
|
26
26
|
const [showPresetDialog, setShowPresetDialog] = React.useState(false);
|
|
27
27
|
const [presetUrl, setPresetUrl] = React.useState("");
|
|
28
28
|
const [resort, setResort] = React.useState(defaultResort);
|
|
29
|
+
const initialRender = React.useRef(true);
|
|
29
30
|
const showWidgetList = resort && facet !== "";
|
|
30
31
|
const baseUrl = getBaseUrl({
|
|
31
32
|
lang,
|
|
@@ -66,10 +67,10 @@ export default function MseMPresetEditor({ lang, options, urls, selectedPreset,
|
|
|
66
67
|
onChange?.(newPreset);
|
|
67
68
|
setPreset(newPreset);
|
|
68
69
|
}, [baseUrl, facet, onChange, options, stay, resort]);
|
|
69
|
-
const removePreset = () => {
|
|
70
|
+
const removePreset = React.useCallback(() => {
|
|
70
71
|
onChange?.(null);
|
|
71
72
|
setPreset(null);
|
|
72
|
-
};
|
|
73
|
+
}, [onChange]);
|
|
73
74
|
const testPreset = () => {
|
|
74
75
|
if (!preset)
|
|
75
76
|
return;
|
|
@@ -103,8 +104,13 @@ export default function MseMPresetEditor({ lang, options, urls, selectedPreset,
|
|
|
103
104
|
}
|
|
104
105
|
}, [baseUrl, lang, preset]);
|
|
105
106
|
React.useEffect(() => {
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
if (initialRender.current) {
|
|
108
|
+
initialRender.current = false;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
removePreset();
|
|
112
|
+
}
|
|
113
|
+
}, [removePreset, resort]);
|
|
108
114
|
if (!resort)
|
|
109
115
|
return null;
|
|
110
116
|
const CurrentEditor = preset?.widget && Editors[preset.widget];
|
|
@@ -132,7 +138,8 @@ function getBaseUrl({ lang, widget, facet, urls, slug }) {
|
|
|
132
138
|
if (slug) {
|
|
133
139
|
url = url.concat("/", slug);
|
|
134
140
|
}
|
|
135
|
-
|
|
141
|
+
const isExternalUrl = url?.startsWith("http");
|
|
142
|
+
if (!isExternalUrl && url && langPrefix) {
|
|
136
143
|
url = "/".concat(lang, url);
|
|
137
144
|
}
|
|
138
145
|
return url;
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { useUbloContext } from "ublo/with-ublo";
|
|
3
3
|
import PackagesSelector from "../components/packages-selector";
|
|
4
4
|
import { openMseM } from "../utils/msem-widget";
|
|
5
|
+
import * as Plausible from "../components/plausible";
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
const preview = typeof window !== "undefined" && window.location.search.indexOf("preview") !== -1;
|
|
7
8
|
const buttonStyles = `
|
|
@@ -79,6 +80,7 @@ const usePackages = (defaultPopupContent, setPopupContent, cartUrl, selector = "
|
|
|
79
80
|
packageId,
|
|
80
81
|
catalog: "PUBLIC",
|
|
81
82
|
preview,
|
|
83
|
+
analytics: Plausible.callback,
|
|
82
84
|
theme: "/theme.css",
|
|
83
85
|
cartUrl
|
|
84
86
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { memo, useEffect } from "react";
|
|
3
|
+
import * as Plausible from "../../common/components/plausible";
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
export const preview = typeof window !== "undefined" && window.location.search.indexOf("preview") !== -1;
|
|
5
6
|
export const loadJS = (url, id) => {
|
|
@@ -35,6 +36,7 @@ const CPForm = ({
|
|
|
35
36
|
fullWidth: true,
|
|
36
37
|
maxWidth: 1400,
|
|
37
38
|
groundedTo: "#msem-cp",
|
|
39
|
+
analytics: Plausible.callback,
|
|
38
40
|
cartUrl: cart[0].path,
|
|
39
41
|
scrollOffset: 300
|
|
40
42
|
};
|
|
@@ -4,6 +4,7 @@ import Button from "dt-design-system/es/button";
|
|
|
4
4
|
import * as Icons from "dt-design-system/es/icons";
|
|
5
5
|
import { message } from "./messages";
|
|
6
6
|
import { loadWigetMseM, preview } from "./services/widgets";
|
|
7
|
+
import * as Plausible from "../../../common/components/plausible";
|
|
7
8
|
import css from "./booking.module.css";
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -59,6 +60,7 @@ const Booking = ({
|
|
|
59
60
|
cartUrl,
|
|
60
61
|
fullWidth: true,
|
|
61
62
|
groundedTo: "#msem-magic-box",
|
|
63
|
+
analytics: Plausible.callback,
|
|
62
64
|
show: ["vel"]
|
|
63
65
|
};
|
|
64
66
|
const presets = {
|