ublo-lib 1.39.39 → 1.40.1
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/editable-map/editable-map.d.ts.map +1 -1
- package/es/common/components/editable-map/editable-map.js +11 -2
- package/es/common/components/editable-map/input-marker.d.ts +4 -0
- package/es/common/components/editable-map/input-marker.d.ts.map +1 -0
- package/es/common/components/editable-map/input-marker.js +16 -0
- package/es/common/components/editable-map/input-marker.module.css +17 -0
- package/es/common/components/editable-map/map-events.d.ts +8 -0
- package/es/common/components/editable-map/map-events.js +1 -1
- package/es/esf/components/levels/levels.d.ts.map +1 -1
- package/es/esf/components/levels/levels.js +1 -0
- package/es/future/components/msem/elloha.d.ts +22 -0
- package/es/future/components/msem/elloha.d.ts.map +1 -0
- package/es/future/components/msem/elloha.js +19 -0
- package/es/future/components/msem/index.d.ts +4 -1
- package/es/future/components/msem/index.d.ts.map +1 -1
- package/es/future/components/msem/index.js +4 -1
- package/es/future/components/msem/other-products.d.ts +28 -0
- package/es/future/components/msem/other-products.d.ts.map +1 -0
- package/es/future/components/msem/other-products.js +19 -0
- package/es/future/components/msem/vakario.d.ts +25 -0
- package/es/future/components/msem/vakario.d.ts.map +1 -0
- package/es/future/components/msem/vakario.js +19 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editable-map.d.ts","sourceRoot":"","sources":["../../../../src/common/components/editable-map/editable-map.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editable-map.d.ts","sourceRoot":"","sources":["../../../../src/common/components/editable-map/editable-map.js"],"names":[],"mappings":"AAmBA;;;;4CA4HC"}
|
|
@@ -4,10 +4,11 @@ import { AttributionControl, MapContainer, TileLayer } from "react-leaflet";
|
|
|
4
4
|
import { useUbloContext } from "ublo/with-ublo";
|
|
5
5
|
import Button from "dt-design-system/es/button";
|
|
6
6
|
import * as Icons from "dt-design-system/es/icons";
|
|
7
|
-
import MapEvents from "./map-events";
|
|
7
|
+
import MapEvents, { DEFAULT_MARKER_DATA } from "./map-events";
|
|
8
8
|
import Markers from "./markers";
|
|
9
9
|
import Helper from "./helper";
|
|
10
10
|
import Cluster from "./cluster";
|
|
11
|
+
import InputMarker from "./input-marker";
|
|
11
12
|
import MarkerList from "./marker-list";
|
|
12
13
|
import FullScreenButton from "./full-screen-button";
|
|
13
14
|
import SlopesToggle from "./slopes-toggle";
|
|
@@ -49,8 +50,16 @@ export default function EditableMap({ format, iconSet, hideSlopes }) {
|
|
|
49
50
|
element.setAttribute("data-presets", JSON.stringify(newPresets));
|
|
50
51
|
}
|
|
51
52
|
}, [center, element, isEditing, markers, showSlopes, zoom]);
|
|
53
|
+
const addInitialMarker = (position) => {
|
|
54
|
+
const isFocused = Boolean(element.querySelector("cms-section-ui"));
|
|
55
|
+
if (!isEditing || !isFocused)
|
|
56
|
+
return;
|
|
57
|
+
setMarkers([{ id: 1, ...DEFAULT_MARKER_DATA, position }]);
|
|
58
|
+
ref.current.setView(position, 13);
|
|
59
|
+
};
|
|
52
60
|
const attribution = showSlopes
|
|
53
61
|
? '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> & <a href="https://www.opensnowmap.org/">OpenSnowMap</a> contributors'
|
|
54
62
|
: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';
|
|
55
|
-
|
|
63
|
+
const showInputMarker = isEditing && !markers.length;
|
|
64
|
+
return (_jsxs("div", { ref: containerRef, className: css.container, "data-cms-remove": "", children: [_jsxs(MapContainer, { ref: ref, center: center, zoom: zoom, scrollWheelZoom: scrollWheelZoom, className: css.map, attributionControl: false, children: [_jsx(TileLayer, { attribution: attribution, url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" }), showSlopes && (_jsx(TileLayer, { url: "https://tiles.opensnowmap.org/pistes/{z}/{x}/{y}.png" })), _jsx(MapEvents, { mapRef: ref, markers: markers, setMarkers: setMarkers, setZoom: setZoom, setCenter: setCenter, isEditing: isEditing, element: element }), _jsx(Cluster, { isEditing: isEditing, children: _jsx(Markers, { markers: markers, setMarkers: setMarkers, iconSet: iconSet, isEditing: isEditing }) }), _jsx(AttributionControl, { position: "bottomright", prefix: "" })] }), !isEditing && (_jsx(FullScreenButton, { fullScreen: fullScreen, setFullScreen: setFullScreen, containerRef: containerRef })), showInputMarker && _jsx(InputMarker, { callback: addInitialMarker }), _jsx(Button, { type: "button", variant: "secondary", className: css.resetCenter, onClick: resetCenter, children: _jsx(Icons.MyLocation, {}) }), !hideSlopes && (_jsx(SlopesToggle, { showSlopes: showSlopes, setShowSlopes: setShowSlopes })), !isEditing && markers.length > 2 && (_jsx(MarkerList, { mapRef: ref, markers: markers, iconSet: iconSet, isInDialog: !fullScreen && isInDialog })), isEditing && _jsx(Helper, {})] }));
|
|
56
65
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-marker.d.ts","sourceRoot":"","sources":["../../../../src/common/components/editable-map/input-marker.js"],"names":[],"mappings":"AAIA;;4CAqBC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Input from "dt-design-system/es/input";
|
|
3
|
+
import Button from "dt-design-system/es/button";
|
|
4
|
+
import styles from "./input-marker.module.css";
|
|
5
|
+
export default function InputMarker({ callback }) {
|
|
6
|
+
const addMarker = (event) => {
|
|
7
|
+
event.preventDefault();
|
|
8
|
+
const form = event.target;
|
|
9
|
+
const lat = form[0].value;
|
|
10
|
+
const lng = form[1].value;
|
|
11
|
+
if (lat && lng) {
|
|
12
|
+
callback({ lat, lng });
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
return (_jsxs("form", { className: styles.form, onSubmit: addMarker, children: [_jsx("div", { children: "Ajouter un point d'int\u00E9r\u00EAt" }), _jsx(Input, { label: "Latitude", placeholder: "48.132", type: "number", step: "any" }), _jsx(Input, { label: "Longitude", placeholder: "3.524", type: "number", step: "any" }), _jsx(Button, { className: styles.button, type: "submit", children: "OK" })] }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.form {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 10px;
|
|
4
|
+
left: 50px;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: 5px;
|
|
8
|
+
width: 210px;
|
|
9
|
+
background-color: var(--ds-grey-000, #fff);
|
|
10
|
+
padding: 20px 10px;
|
|
11
|
+
border-radius: var(--ds-radius-100, 4px);
|
|
12
|
+
box-shadow: var(--ds-shadow-100, 0px 3px 6px rgba(0, 0, 0, 0.12));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.form button.button {
|
|
16
|
+
margin-left: auto;
|
|
17
|
+
}
|
|
@@ -7,4 +7,12 @@ export default function MapEvents({ mapRef, markers, setMarkers, setCenter, setZ
|
|
|
7
7
|
isEditing: any;
|
|
8
8
|
element: any;
|
|
9
9
|
}): any;
|
|
10
|
+
export namespace DEFAULT_MARKER_DATA {
|
|
11
|
+
let icon: string;
|
|
12
|
+
let title: string;
|
|
13
|
+
let description: string;
|
|
14
|
+
let url: string;
|
|
15
|
+
let label: string;
|
|
16
|
+
let tooltipOpened: boolean;
|
|
17
|
+
}
|
|
10
18
|
//# sourceMappingURL=map-events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"levels.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/levels/levels.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"levels.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/levels/levels.js"],"names":[],"mappings":";AAgPA;;4CA6FC"}
|
|
@@ -21,6 +21,7 @@ const LEVELS = {
|
|
|
21
21
|
"1-degree": "skialpin-esfexperiences-classe1",
|
|
22
22
|
"2-degree": "skialpin-esfexperiences-classe2",
|
|
23
23
|
"3-degree": "skialpin-esfexperiences-classe3",
|
|
24
|
+
"4-degree": "skialpin-esfexperiences-classe4",
|
|
24
25
|
"ski-beginner": "skialpin-esfexperiences-decouverte",
|
|
25
26
|
"ski-intermediate": "skialpin-esfexperiences-intermediaire",
|
|
26
27
|
"ski-confirmed": "skialpin-esfexperiences-confirme",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { GlobalOptions, GlobalPresets } from "./types";
|
|
3
|
+
type Show = "banner" | "category" | "title" | "description";
|
|
4
|
+
type Options = GlobalOptions & {
|
|
5
|
+
merchant: string;
|
|
6
|
+
cartUrl?: string;
|
|
7
|
+
cartChanged?: (cart: any) => void;
|
|
8
|
+
show?: Show;
|
|
9
|
+
hide?: Show;
|
|
10
|
+
};
|
|
11
|
+
type Presets = GlobalPresets & {
|
|
12
|
+
groupNames?: string[];
|
|
13
|
+
};
|
|
14
|
+
type Props = {
|
|
15
|
+
options?: Options;
|
|
16
|
+
presets?: Presets;
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
declare const _default: React.MemoExoticComponent<typeof Elloha>;
|
|
20
|
+
export default _default;
|
|
21
|
+
declare function Elloha({ options, presets, children }: Props): React.ReactNode;
|
|
22
|
+
//# sourceMappingURL=elloha.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elloha.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/elloha.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE5D,KAAK,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,aAAa,CAAC;AAE5D,KAAK,OAAO,GAAG,aAAa,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,KAAK,OAAO,GAAG,aAAa,GAAG;IAC7B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;;AAEF,wBAAkC;AAElC,iBAAS,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,KAAK,mBAiBpD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Utils from "./utils";
|
|
3
|
+
import * as Plausible from "../plausible";
|
|
4
|
+
export default React.memo(Elloha);
|
|
5
|
+
function Elloha({ options, presets, children }) {
|
|
6
|
+
React.useEffect(() => {
|
|
7
|
+
const lang = options?.lang === "fr" ? "fr" : "en";
|
|
8
|
+
const patchedOptions = {
|
|
9
|
+
...options,
|
|
10
|
+
lang,
|
|
11
|
+
analytics: (...args) => {
|
|
12
|
+
options?.analytics?.apply(null, args);
|
|
13
|
+
Plausible.callback.apply(null, args);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
Utils.loadWidget("elloha", patchedOptions, presets);
|
|
17
|
+
}, [options, presets]);
|
|
18
|
+
return children;
|
|
19
|
+
}
|
|
@@ -4,8 +4,11 @@ import SkiRental from "./ski-rental";
|
|
|
4
4
|
import SkiPass from "./ski-pass";
|
|
5
5
|
import LiftJb from "./lift-jb";
|
|
6
6
|
import Esf from "./esf";
|
|
7
|
+
import Vakario from "./vakario";
|
|
8
|
+
import Elloha from "./elloha";
|
|
9
|
+
import OtherProducts from "./other-products";
|
|
7
10
|
import Tunnel from "./tunnel";
|
|
8
11
|
import Account from "./account";
|
|
9
12
|
import { loadWidget } from "./utils";
|
|
10
|
-
export { Script, loadWidget, Lodging, SkiRental, SkiPass, LiftJb, Esf, Tunnel, Account, };
|
|
13
|
+
export { Script, loadWidget, Lodging, SkiRental, SkiPass, LiftJb, Esf, Vakario, Elloha, OtherProducts, Tunnel, Account, };
|
|
11
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,EACT,OAAO,EACP,MAAM,EACN,GAAG,EACH,MAAM,EACN,OAAO,GACR,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,EACT,OAAO,EACP,MAAM,EACN,GAAG,EACH,OAAO,EACP,MAAM,EACN,aAAa,EACb,MAAM,EACN,OAAO,GACR,CAAC"}
|
|
@@ -4,7 +4,10 @@ import SkiRental from "./ski-rental";
|
|
|
4
4
|
import SkiPass from "./ski-pass";
|
|
5
5
|
import LiftJb from "./lift-jb";
|
|
6
6
|
import Esf from "./esf";
|
|
7
|
+
import Vakario from "./vakario";
|
|
8
|
+
import Elloha from "./elloha";
|
|
9
|
+
import OtherProducts from "./other-products";
|
|
7
10
|
import Tunnel from "./tunnel";
|
|
8
11
|
import Account from "./account";
|
|
9
12
|
import { loadWidget } from "./utils";
|
|
10
|
-
export { Script, loadWidget, Lodging, SkiRental, SkiPass, LiftJb, Esf, Tunnel, Account, };
|
|
13
|
+
export { Script, loadWidget, Lodging, SkiRental, SkiPass, LiftJb, Esf, Vakario, Elloha, OtherProducts, Tunnel, Account, };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { GlobalOptions, GlobalPresets } from "./types";
|
|
3
|
+
type Show = "banner" | "category" | "title" | "description";
|
|
4
|
+
type Options = GlobalOptions & {
|
|
5
|
+
merchant: string;
|
|
6
|
+
cartUrl?: string;
|
|
7
|
+
cartChanged?: (cart: any) => void;
|
|
8
|
+
show?: Show;
|
|
9
|
+
hide?: Show;
|
|
10
|
+
categoryGroup?: string;
|
|
11
|
+
catalog?: string;
|
|
12
|
+
};
|
|
13
|
+
type Presets = GlobalPresets & {
|
|
14
|
+
merchantSlug?: string;
|
|
15
|
+
merchantCategories?: string;
|
|
16
|
+
productCategory?: string;
|
|
17
|
+
productId?: number;
|
|
18
|
+
merchants?: string[];
|
|
19
|
+
};
|
|
20
|
+
type Props = {
|
|
21
|
+
options?: Options;
|
|
22
|
+
presets?: Presets;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
};
|
|
25
|
+
declare const _default: React.MemoExoticComponent<typeof OtherProducts>;
|
|
26
|
+
export default _default;
|
|
27
|
+
declare function OtherProducts({ options, presets, children }: Props): React.ReactNode;
|
|
28
|
+
//# sourceMappingURL=other-products.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"other-products.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/other-products.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE5D,KAAK,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,aAAa,CAAC;AAE5D,KAAK,OAAO,GAAG,aAAa,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,OAAO,GAAG,aAAa,GAAG;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;;AAEF,wBAAyC;AAEzC,iBAAS,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,KAAK,mBAiB3D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Utils from "./utils";
|
|
3
|
+
import * as Plausible from "../plausible";
|
|
4
|
+
export default React.memo(OtherProducts);
|
|
5
|
+
function OtherProducts({ options, presets, children }) {
|
|
6
|
+
React.useEffect(() => {
|
|
7
|
+
const lang = options?.lang === "fr" ? "fr" : "en";
|
|
8
|
+
const patchedOptions = {
|
|
9
|
+
...options,
|
|
10
|
+
lang,
|
|
11
|
+
analytics: (...args) => {
|
|
12
|
+
options?.analytics?.apply(null, args);
|
|
13
|
+
Plausible.callback.apply(null, args);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
Utils.loadWidget("otherProducts", patchedOptions, presets);
|
|
17
|
+
}, [options, presets]);
|
|
18
|
+
return children;
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { GlobalOptions, GlobalPresets } from "./types";
|
|
3
|
+
type Show = "merchantInfoOn";
|
|
4
|
+
type Options = GlobalOptions & {
|
|
5
|
+
merchant: string;
|
|
6
|
+
cartUrl?: string;
|
|
7
|
+
cartChanged?: (cart: any) => void;
|
|
8
|
+
show?: Show;
|
|
9
|
+
hide?: Show;
|
|
10
|
+
};
|
|
11
|
+
type Presets = GlobalPresets & {
|
|
12
|
+
kindCodes?: string[];
|
|
13
|
+
ageCodes?: string[];
|
|
14
|
+
categoryCodes?: string[];
|
|
15
|
+
levelCodes?: string[];
|
|
16
|
+
};
|
|
17
|
+
type Props = {
|
|
18
|
+
options?: Options;
|
|
19
|
+
presets?: Presets;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
declare const _default: React.MemoExoticComponent<typeof Vakario>;
|
|
23
|
+
export default _default;
|
|
24
|
+
declare function Vakario({ options, presets, children }: Props): React.ReactNode;
|
|
25
|
+
//# sourceMappingURL=vakario.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vakario.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/vakario.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE5D,KAAK,IAAI,GAAG,gBAAgB,CAAC;AAE7B,KAAK,OAAO,GAAG,aAAa,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,KAAK,OAAO,GAAG,aAAa,GAAG;IAC7B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;;AAEF,wBAAmC;AAEnC,iBAAS,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,KAAK,mBAiBrD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Utils from "./utils";
|
|
3
|
+
import * as Plausible from "../plausible";
|
|
4
|
+
export default React.memo(Vakario);
|
|
5
|
+
function Vakario({ options, presets, children }) {
|
|
6
|
+
React.useEffect(() => {
|
|
7
|
+
const lang = options?.lang === "fr" ? "fr" : "en";
|
|
8
|
+
const patchedOptions = {
|
|
9
|
+
...options,
|
|
10
|
+
lang,
|
|
11
|
+
analytics: (...args) => {
|
|
12
|
+
options?.analytics?.apply(null, args);
|
|
13
|
+
Plausible.callback.apply(null, args);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
Utils.loadWidget("vakario", patchedOptions, presets);
|
|
17
|
+
}, [options, presets]);
|
|
18
|
+
return children;
|
|
19
|
+
}
|