ublo-lib 1.38.34 → 1.38.36

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.
Files changed (82) hide show
  1. package/es/common/components/editable-map/editable-map.module.css +1 -1
  2. package/es/common/components/editable-map/index.d.ts.map +1 -1
  3. package/es/common/components/editable-map/index.js +5 -10
  4. package/es/esf/components/espace-prive/admin/client-links.d.ts +2 -0
  5. package/es/esf/components/espace-prive/admin/client-links.d.ts.map +1 -0
  6. package/es/esf/components/espace-prive/admin/client-links.js +34 -0
  7. package/es/esf/components/espace-prive/admin/client-links.module.css +42 -0
  8. package/es/esf/components/espace-prive/admin/config-field.d.ts +4 -0
  9. package/es/esf/components/espace-prive/admin/config-field.d.ts.map +1 -0
  10. package/es/esf/components/espace-prive/admin/config-field.js +41 -0
  11. package/es/esf/components/espace-prive/admin/config-field.module.css +30 -0
  12. package/es/esf/components/espace-prive/admin/config.d.ts +2 -0
  13. package/es/esf/components/espace-prive/admin/config.d.ts.map +1 -0
  14. package/es/esf/components/espace-prive/admin/config.js +17 -0
  15. package/es/esf/components/espace-prive/admin/config.module.css +40 -0
  16. package/es/esf/components/espace-prive/admin/link-form.d.ts +5 -0
  17. package/es/esf/components/espace-prive/admin/link-form.d.ts.map +1 -0
  18. package/es/esf/components/espace-prive/admin/link-form.js +97 -0
  19. package/es/esf/components/espace-prive/admin/link-form.module.css +60 -0
  20. package/es/esf/components/espace-prive/admin/link-row.d.ts +7 -0
  21. package/es/esf/components/espace-prive/admin/link-row.d.ts.map +1 -0
  22. package/es/esf/components/espace-prive/admin/link-row.js +29 -0
  23. package/es/esf/components/espace-prive/admin/link-row.module.css +59 -0
  24. package/es/esf/components/espace-prive/admin/mail-template.d.ts +2 -0
  25. package/es/esf/components/espace-prive/admin/mail-template.d.ts.map +1 -0
  26. package/es/esf/components/espace-prive/admin/mail-template.js +34 -0
  27. package/es/esf/components/espace-prive/admin/mail-template.module.css +33 -0
  28. package/es/esf/components/espace-prive/cart-link.d.ts +2 -0
  29. package/es/esf/components/espace-prive/cart-link.d.ts.map +1 -0
  30. package/es/esf/components/espace-prive/cart-link.js +14 -0
  31. package/es/esf/components/espace-prive/cart-link.module.css +2 -0
  32. package/es/esf/components/espace-prive/connexion.d.ts +4 -0
  33. package/es/esf/components/espace-prive/connexion.d.ts.map +1 -0
  34. package/es/esf/components/espace-prive/connexion.js +43 -0
  35. package/es/esf/components/espace-prive/connexion.module.css +79 -0
  36. package/es/esf/components/espace-prive/context.d.ts +6 -0
  37. package/es/esf/components/espace-prive/context.d.ts.map +1 -0
  38. package/es/esf/components/espace-prive/context.js +96 -0
  39. package/es/esf/components/espace-prive/custom-offers.d.ts +5 -0
  40. package/es/esf/components/espace-prive/custom-offers.d.ts.map +1 -0
  41. package/es/esf/components/espace-prive/custom-offers.js +8 -0
  42. package/es/esf/components/espace-prive/custom-offers.module.css +60 -0
  43. package/es/esf/components/espace-prive/discount-icon.svg +1 -0
  44. package/es/esf/components/espace-prive/index.d.ts +5 -0
  45. package/es/esf/components/espace-prive/index.d.ts.map +1 -0
  46. package/es/esf/components/espace-prive/index.js +6 -0
  47. package/es/esf/components/espace-prive/message.d.ts +6 -0
  48. package/es/esf/components/espace-prive/message.d.ts.map +1 -0
  49. package/es/esf/components/espace-prive/message.js +82 -0
  50. package/es/esf/components/espace-prive/panier.d.ts +2 -0
  51. package/es/esf/components/espace-prive/panier.d.ts.map +1 -0
  52. package/es/esf/components/espace-prive/panier.js +43 -0
  53. package/es/esf/components/espace-prive/partenaire.d.ts +6 -0
  54. package/es/esf/components/espace-prive/partenaire.d.ts.map +1 -0
  55. package/es/esf/components/espace-prive/partenaire.js +23 -0
  56. package/es/esf/components/espace-prive/partenaire.module.css +80 -0
  57. package/es/esf/components/espace-prive/services/config.d.ts +8 -0
  58. package/es/esf/components/espace-prive/services/config.d.ts.map +1 -0
  59. package/es/esf/components/espace-prive/services/config.js +76 -0
  60. package/es/esf/components/espace-prive/services/links.d.ts +5 -0
  61. package/es/esf/components/espace-prive/services/links.d.ts.map +1 -0
  62. package/es/esf/components/espace-prive/services/links.js +48 -0
  63. package/es/esf/components/espace-prive/services/mail.d.ts +2 -0
  64. package/es/esf/components/espace-prive/services/mail.d.ts.map +1 -0
  65. package/es/esf/components/espace-prive/services/mail.js +17 -0
  66. package/es/esf/components/espace-prive/tools.d.ts +4 -0
  67. package/es/esf/components/espace-prive/tools.d.ts.map +1 -0
  68. package/es/esf/components/espace-prive/tools.js +54 -0
  69. package/es/esf/components/espace-prive/tools.module.css +111 -0
  70. package/es/esf/components/espace-prive/tunnel.d.ts +2 -0
  71. package/es/esf/components/espace-prive/tunnel.d.ts.map +1 -0
  72. package/es/esf/components/espace-prive/tunnel.js +23 -0
  73. package/es/esf/components/espace-prive/utils/construct-link.d.ts +2 -0
  74. package/es/esf/components/espace-prive/utils/construct-link.d.ts.map +1 -0
  75. package/es/esf/components/espace-prive/utils/construct-link.js +3 -0
  76. package/es/esf/components/espace-prive/utils/path-includes-key.d.ts +2 -0
  77. package/es/esf/components/espace-prive/utils/path-includes-key.d.ts.map +1 -0
  78. package/es/esf/components/espace-prive/utils/path-includes-key.js +4 -0
  79. package/es/esf/components/espace-prive/utils/snackbar-message.d.ts +2 -0
  80. package/es/esf/components/espace-prive/utils/snackbar-message.d.ts.map +1 -0
  81. package/es/esf/components/espace-prive/utils/snackbar-message.js +14 -0
  82. package/package.json +1 -1
@@ -0,0 +1,4 @@
1
+ export default function Connexion({ logo }: {
2
+ logo: any;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=connexion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connexion.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/connexion.js"],"names":[],"mappings":"AAQA;;4CA+CC"}
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import Button from "dt-design-system/es/button";
4
+ import Input from "dt-design-system/es/input";
5
+ import { useUbloContext } from "ublo/with-ublo";
6
+ import Message, { message } from "./message";
7
+ import { useContext } from "./context";
8
+ import styles from "./connexion.module.css";
9
+ export default function Connexion({ logo }) {
10
+ const { lang } = useUbloContext();
11
+ const { partnerID } = useContext();
12
+ const [error, setError] = React.useState("");
13
+ const submitForm = async (e) => {
14
+ e.preventDefault();
15
+ const password = e.target[0].value;
16
+ setCookie("password", password, 365);
17
+ setError(undefined);
18
+ window.location.href = `/espace-prive/${partnerID}/tunnel`;
19
+ };
20
+ React.useEffect(() => {
21
+ const { searchParams } = new URL(window.location.href);
22
+ const error = searchParams.get("error") === "1";
23
+ if (error) {
24
+ setError(message(lang, "partner-space-login-error"));
25
+ eraseCookie("password");
26
+ }
27
+ }, [lang]);
28
+ return (_jsxs("main", { className: styles.main, children: [_jsx("header", { className: styles.header, children: _jsx("div", { className: styles.logo, children: logo }) }), _jsxs("div", { className: styles.login, children: [_jsx("div", { className: styles.loginTitle, children: _jsx(Message, { id: "partner-space-login-title" }) }), _jsx("div", { className: styles.loginMessage, dangerouslySetInnerHTML: {
29
+ __html: message(lang, "partner-space-login-message"),
30
+ } }), _jsxs("form", { className: styles.loginForm, onSubmit: submitForm, children: [_jsx(Input, { className: styles.loginInput, type: "password" }), _jsx(Button, { type: "submit", className: styles.loginFormButton, children: _jsx(Message, { id: "partner-space-login-button" }) }), error && _jsx("div", { className: styles.loginFormError, children: error })] })] })] }));
31
+ }
32
+ function setCookie(name, value, days) {
33
+ let expires = "";
34
+ if (days) {
35
+ const date = new Date();
36
+ date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
37
+ expires = "; expires=" + date.toUTCString();
38
+ }
39
+ document.cookie = name + "=" + (value || "") + expires + "; path=/";
40
+ }
41
+ function eraseCookie(name) {
42
+ document.cookie = name + "=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";
43
+ }
@@ -0,0 +1,79 @@
1
+ .main {
2
+ height: 100vh;
3
+ width: 100vw;
4
+ display: grid;
5
+ }
6
+
7
+ .header {
8
+ display: flex;
9
+ padding: 10px;
10
+ }
11
+
12
+ .login {
13
+ position: relative;
14
+ height: fit-content;
15
+ width: 300px;
16
+ justify-self: center;
17
+ display: flex;
18
+ flex-direction: column;
19
+ gap: 20px;
20
+ margin: 0 auto;
21
+ padding: 16px;
22
+ background-color: hsl(var(--grey-000));
23
+ box-shadow: var(--shadow-200);
24
+ border-radius: var(--radius-200);
25
+ text-align: center;
26
+ }
27
+
28
+ @media (min-width: 768px) {
29
+ .login {
30
+ width: 400px;
31
+ }
32
+ }
33
+
34
+ .loginTitle {
35
+ font-size: 18px;
36
+ font-weight: bold;
37
+ }
38
+
39
+ @media (min-width: 768px) {
40
+ .loginTitle {
41
+ font-size: 20px;
42
+ }
43
+ }
44
+
45
+ .loginMessage {
46
+ font-size: 14px;
47
+ }
48
+
49
+ @media (min-width: 768px) {
50
+ .loginMessage {
51
+ font-size: 16px;
52
+ }
53
+ }
54
+
55
+ .loginMessage > a {
56
+ color: hsl(var(--primary));
57
+ text-decoration: underline;
58
+ }
59
+
60
+ .loginForm {
61
+ display: flex;
62
+ flex-direction: column;
63
+ gap: 8px;
64
+ }
65
+
66
+ .loginInput input {
67
+ text-align: center;
68
+ }
69
+
70
+ button.loginFormButton {
71
+ width: 100%;
72
+ align-self: stretch;
73
+ padding: 12px;
74
+ border-radius: var(--radius-100);
75
+ }
76
+
77
+ .loginFormError {
78
+ /* @include label(hsl(var(--red))); */
79
+ }
@@ -0,0 +1,6 @@
1
+ export function useContext(): any;
2
+ export default ContextProvider;
3
+ declare function ContextProvider({ children }: {
4
+ children: any;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/context.js"],"names":[],"mappings":"AAOO,kCAKN;;AAID;;4CA2GC"}
@@ -0,0 +1,96 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { useUbloContext } from "ublo/with-ublo";
4
+ import { SnackbarProvider } from "dt-design-system/es/snackbar";
5
+ import * as Services from "./services/config";
6
+ const Context = React.createContext();
7
+ export const useContext = () => {
8
+ const context = React.useContext(Context);
9
+ if (!context)
10
+ throw new Error(`useSiteContext must be used within a SiteContextProvider`);
11
+ return context;
12
+ };
13
+ const UBLO_CONTENT_AUTH_API = "https://ublo-auth.valraiso.net/api";
14
+ const ContextProvider = ({ children }) => {
15
+ const [cmsToken, setCmsToken] = React.useState(null);
16
+ const [intermediary, setIntermediary] = React.useState(null);
17
+ const [replyTo, setReplyTo] = React.useState(null);
18
+ const [mailTemplate, setMailTemplate] = React.useState(null);
19
+ const [mode, setMode] = React.useState(null);
20
+ const [error, setError] = React.useState(false);
21
+ const { menuPath, site } = useUbloContext();
22
+ const { path } = menuPath;
23
+ const partnerID = getPartnerID(path);
24
+ const allowClientAPICall = site && partnerID;
25
+ const allowAdminAPICall = allowClientAPICall && Boolean(cmsToken);
26
+ React.useEffect(() => {
27
+ const token = window.sessionStorage.getItem("cms_token");
28
+ setCmsToken(token);
29
+ }, []);
30
+ React.useEffect(() => {
31
+ const fetchConfigMode = async () => {
32
+ const data = await Services.getMode(UBLO_CONTENT_AUTH_API, site, partnerID, cmsToken);
33
+ setMode(data?.mode);
34
+ };
35
+ if (allowAdminAPICall) {
36
+ fetchConfigMode();
37
+ }
38
+ }, [allowAdminAPICall, partnerID, site, cmsToken]);
39
+ React.useEffect(() => {
40
+ async function getExistingIntermediary() {
41
+ const existingIntermediary = await Services.getIntermediary(UBLO_CONTENT_AUTH_API, site, partnerID, cmsToken);
42
+ if (existingIntermediary) {
43
+ setIntermediary(existingIntermediary);
44
+ }
45
+ else {
46
+ setError(true);
47
+ }
48
+ }
49
+ if (allowClientAPICall) {
50
+ getExistingIntermediary();
51
+ }
52
+ }, [allowClientAPICall, partnerID, site, cmsToken]);
53
+ React.useEffect(() => {
54
+ async function getReplyTo() {
55
+ const template = await Services.getReplyTo(UBLO_CONTENT_AUTH_API, site, partnerID, cmsToken);
56
+ if (template)
57
+ setReplyTo(template);
58
+ }
59
+ if (allowAdminAPICall) {
60
+ getReplyTo();
61
+ }
62
+ }, [allowAdminAPICall, cmsToken, site, partnerID]);
63
+ React.useEffect(() => {
64
+ async function getMailTemplate() {
65
+ const template = await Services.getMailTemplate(UBLO_CONTENT_AUTH_API, site, partnerID, cmsToken);
66
+ if (template)
67
+ setMailTemplate(template);
68
+ }
69
+ if (allowAdminAPICall) {
70
+ getMailTemplate();
71
+ }
72
+ }, [allowAdminAPICall, cmsToken, site, partnerID]);
73
+ return (_jsx(Context.Provider, { value: {
74
+ apiURL: UBLO_CONTENT_AUTH_API,
75
+ partnerID,
76
+ site,
77
+ cmsToken,
78
+ mode,
79
+ intermediary,
80
+ setIntermediary,
81
+ replyTo,
82
+ setReplyTo,
83
+ mailTemplate,
84
+ setMailTemplate,
85
+ error,
86
+ }, children: _jsx(SnackbarProvider, { children: children }) }));
87
+ };
88
+ export default ContextProvider;
89
+ const getPartnerID = (path) => {
90
+ const regex = /^\/espace-prive\/([^/]+)\/[^/]*\/?$/;
91
+ const match = path.match(regex);
92
+ if (match) {
93
+ return match[1];
94
+ }
95
+ return null;
96
+ };
@@ -0,0 +1,5 @@
1
+ export default function CustomOffers({ partnerID, lang }: {
2
+ partnerID: any;
3
+ lang: any;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=custom-offers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-offers.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/custom-offers.js"],"names":[],"mappings":"AAIA;;;4CAgBC"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Link from "ublo/link";
3
+ import { message } from "./message";
4
+ import styles from "./custom-offers.module.css";
5
+ export default function CustomOffers({ partnerID, lang }) {
6
+ const href = `/espace-prive/${partnerID}/tunnel`;
7
+ return (_jsx(Link, { href: href, className: styles.link, children: _jsxs("div", { className: styles.offer, children: [_jsx("div", { className: styles.offerImage, children: _jsx("img", { src: "https://widget.msem.tech/images/tunnel/offers/offer_corner.jpg", alt: "offre" }) }), _jsx("div", { className: styles.text, children: message(lang, "custom-offers") })] }) }));
8
+ }
@@ -0,0 +1,60 @@
1
+ .link {
2
+ display: block;
3
+ width: fit-content;
4
+ margin: 20px auto;
5
+ }
6
+
7
+ .icon {
8
+ width: 32px;
9
+ height: 32px;
10
+ }
11
+
12
+ .offer {
13
+ width: 250px;
14
+ height: 200px;
15
+ border-radius: var(--ds-radius-200, 8px);
16
+ }
17
+
18
+ .offerImage {
19
+ position: relative;
20
+ height: 70%;
21
+ width: 100%;
22
+ }
23
+
24
+ .offerImage > img {
25
+ position: absolute;
26
+ top: 0;
27
+ left: 0;
28
+ width: 100%;
29
+ height: 100%;
30
+ object-fit: cover;
31
+ border-top-right-radius: var(--ds-radius-200, 8px);
32
+ border-top-left-radius: var(--ds-radius-200, 8px);
33
+ }
34
+
35
+ .text {
36
+ position: relative;
37
+ height: 30%;
38
+ background-color: var(--ds-grey-000, #fff);
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ border-bottom-right-radius: var(--ds-radius-200, 8px);
43
+ border-bottom-left-radius: var(--ds-radius-200, 8px);
44
+ }
45
+
46
+ .text::before {
47
+ content: url("https://widget.msem.tech/images/tunnel/offers/logo_corner.svg");
48
+ position: absolute;
49
+ top: -40px;
50
+ left: 50%;
51
+ transform: translateX(-50%);
52
+ width: 50px;
53
+ height: 50px;
54
+ display: flex;
55
+ align-items: center;
56
+ justify-content: center;
57
+ border-top-right-radius: var(--ds-radius-200, 8px);
58
+ border-top-left-radius: var(--ds-radius-200, 8px);
59
+ background-color: var(--ds-grey-000, #fff);
60
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M10.0544 2.0941C11.1756 1.13856 12.8248 1.13855 13.9461 2.09411L15.2941 3.24286C15.4542 3.37935 15.6533 3.46182 15.8631 3.47856L17.6286 3.61945C19.0971 3.73663 20.2633 4.9028 20.3805 6.37131L20.5214 8.13679C20.5381 8.34654 20.6205 8.54568 20.757 8.70585L21.9058 10.0539C22.8614 11.1751 22.8614 12.8243 21.9058 13.9456L20.757 15.2935C20.6206 15.4537 20.538 15.6529 20.5213 15.8627L20.3805 17.6281C20.2633 19.0967 19.0971 20.2628 17.6286 20.3799L15.8631 20.5208C15.6533 20.5376 15.4542 20.6201 15.2941 20.7566L13.9461 21.9053C12.8248 22.8609 11.1756 22.8608 10.0543 21.9053L8.70631 20.7566C8.54615 20.6201 8.34705 20.5376 8.1373 20.5209L6.37184 20.3799C4.9033 20.2627 3.73716 19.0966 3.61997 17.6281L3.47906 15.8627C3.46232 15.6529 3.37983 15.4538 3.24336 15.2936L2.0946 13.9455C1.13905 12.8243 1.13904 11.1752 2.09458 10.0539L3.24334 8.70589C3.37983 8.54573 3.46234 8.34654 3.47907 8.13678L3.61996 6.3713C3.73714 4.90278 4.90327 3.73665 6.3718 3.61946L8.13729 3.47857C8.34705 3.46183 8.54619 3.37935 8.70636 3.24286L10.0544 2.0941ZM12.6488 3.61632C12.2751 3.29782 11.7253 3.29781 11.3516 3.61632L10.0036 4.76509C9.5231 5.17456 8.92568 5.42201 8.29637 5.47223L6.5309 5.61312C6.04139 5.65219 5.65268 6.04089 5.61362 6.53041L5.47272 8.29593C5.4225 8.92521 5.17505 9.52259 4.76559 10.0031L3.61683 11.3511C3.29832 11.7248 3.29831 12.2746 3.61683 12.6483L4.76559 13.9963C5.17506 14.4768 5.4225 15.0743 5.47275 15.7035L5.61363 17.469C5.65268 17.9585 6.04139 18.3473 6.53092 18.3863L8.29636 18.5272C8.92563 18.5774 9.5231 18.8249 10.0036 19.2344L11.3516 20.3831C11.7254 20.7016 12.2751 20.7016 12.6488 20.3831L13.9969 19.2343C14.4773 18.8249 15.0747 18.5774 15.704 18.5272L17.4695 18.3863C17.959 18.3472 18.3478 17.9585 18.3868 17.469L18.5277 15.7035C18.5779 15.0742 18.8253 14.4768 19.2349 13.9964L20.3836 12.6483C20.7022 12.2746 20.7021 11.7249 20.3836 11.3511L19.2348 10.0031C18.8253 9.52259 18.5779 8.92519 18.5277 8.2959L18.3868 6.53041C18.3478 6.0409 17.959 5.65219 17.4695 5.61312L15.704 5.47224C15.0748 5.42203 14.4773 5.17455 13.9968 4.76508L12.6488 3.61632ZM14.8284 7.75718L16.2426 9.1714L9.17154 16.2425L7.75733 14.8282L14.8284 7.75718ZM10.2322 10.232C9.64641 10.8178 8.69667 10.8178 8.11088 10.232C7.52509 9.6463 7.52509 8.69652 8.11088 8.11073C8.69667 7.52494 9.64641 7.52494 10.2322 8.11073C10.818 8.69652 10.818 9.6463 10.2322 10.232ZM13.7677 15.8889C14.3535 16.4747 15.3032 16.4747 15.889 15.8889C16.4748 15.3031 16.4748 14.3534 15.889 13.7676C15.3032 13.1818 14.3535 13.1818 13.7677 13.7676C13.1819 14.3534 13.1819 15.3031 13.7677 15.8889Z"></path></svg>
@@ -0,0 +1,5 @@
1
+ export default function Index({ logo, tools }: {
2
+ logo: any;
3
+ tools: any;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/index.js"],"names":[],"mappings":"AAGA;;;4CAMC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Partenaire from "./partenaire";
3
+ import ContextProvider from "./context";
4
+ export default function Index({ logo, tools }) {
5
+ return (_jsx(ContextProvider, { children: _jsx(Partenaire, { logo: logo, tools: tools }) }));
6
+ }
@@ -0,0 +1,6 @@
1
+ export function message(lang: any, id: any): any;
2
+ export function Message({ id }: {
3
+ id: any;
4
+ }): any;
5
+ export default Message;
6
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/message.js"],"names":[],"mappings":"AAiFO,iDAIN;AAEM;;QAGN"}
@@ -0,0 +1,82 @@
1
+ import { useUbloContext } from "ublo/with-ublo";
2
+ const messages = {
3
+ fr: {
4
+ "partner-space-login-title": "Espace partenaire",
5
+ "partner-space-login-message": "Connectez-vous avec le mot de passe qui vous a été fourni pour accéder aux informations de l'espace partenaire. Vous n'avez pas le mot de passe ? <a href='/contact'>Contactez-nous</a>.",
6
+ "partner-space-login-button": "Je me connecte",
7
+ "partner-space-login-error": "Mot de passe incorrect",
8
+ "go-to-cart": "Aller au panier",
9
+ "table-head-emails": "Emails",
10
+ "table-head-links": "Liens d'accès",
11
+ "table-head-actions": "Actions",
12
+ "hover-copy-button": "Copier le lien",
13
+ "delete-button": "Supprimer",
14
+ "cancel-button": "Annuler",
15
+ "confirm-delete-link": "Êtes-vous sûr de vouloir supprimer le lien ?",
16
+ "link-input-placeholder": "exemple@email.com",
17
+ "link-textarea-label": "Emails des clients",
18
+ "links-form-submit": "Générer les liens",
19
+ "custom-offers": "Ajouter une prestation",
20
+ "label-intermediary-input": "Code intermédiaire",
21
+ "label-reply-to-input": "E-mail émetteur",
22
+ "button-modify": "Modifier",
23
+ "send-email": "Envoyer le(s) lien(s) par mail",
24
+ "mail-text": "Contenu de l'e-mail :",
25
+ "send-mail-button": "Envoyer",
26
+ "snackbar-content-saved": "Contenu sauvegardé",
27
+ "snackbar-links-sent": "Les liens ont bien été envoyés",
28
+ "snackbar-links-created": "Les liens ont bien été créés",
29
+ "snackbar-error": "Une erreur est survenue",
30
+ "show-config": "Afficher la configuration",
31
+ "hide-config": "Masquer la configuration",
32
+ "mail-template-label": "Contenu de l'e-mail",
33
+ "mail-template-placeholder": "Bonjour,\n\nVous trouverez en bas de ce mail un lien vous permettant d'accéder à l'espace partenaire\n\nCordialement,\nL'équipe",
34
+ "mail-pattern-error": "Un ou plusieurs e-mail ne respectent pas le bon format",
35
+ "intermediary-error": "Une erreur est survenue lors de la récupération du code intermédiaire, veuillez contacter l'école.",
36
+ },
37
+ en: {
38
+ "partner-space-login-title": "Partner space",
39
+ "partner-space-login-message": "Log in with the password that was provided to you to access the partner space information. Don't have the password? <a href='/contact'>Contact us</a>.",
40
+ "partner-space-login-button": "Log in",
41
+ "partner-space-login-error": "Incorrect password",
42
+ "go-to-cart": "Go to cart",
43
+ "table-head-emails": "Emails",
44
+ "table-head-links": "Access links",
45
+ "table-head-actions": "Actions",
46
+ "hover-copy-button": "Copy the link",
47
+ "delete-button": "Delete",
48
+ "cancel-button": "Cancel",
49
+ "confirm-delete-link": "Are you sure you want to delete the link?",
50
+ "link-input-placeholder": "example@email.com",
51
+ "link-textarea-label": "Client's mails",
52
+ "links-form-submit": "Generate links",
53
+ "custom-offers": "Add an offer",
54
+ "label-intermediary-input": "Intermediary code",
55
+ "label-reply-to-input": "Sender email",
56
+ "button-modify": "Modify",
57
+ "send-email": "Send the link(s) by email",
58
+ "mail-text": "Email content",
59
+ "send-mail-button": "Send",
60
+ "snackbar-content-saved": "Content saved",
61
+ "snackbar-links-sent": "The links have been sent",
62
+ "snackbar-links-created": "The links have been created",
63
+ "snackbar-error": "An error has occurred",
64
+ "show-config": "Show configuration",
65
+ "hide-config": "Hide configuration",
66
+ "mail-template-label": "Email content",
67
+ "mail-template-placeholder": "Hello,\n\nYou will find at the bottom of this email a link allowing you to access the partner space\n\nBest regards,\nThe team",
68
+ "mail-pattern-error": "One or more emails do not respect the correct format",
69
+ "intermediary-error": "An error occurred while retrieving the intermediary code, please contact the school.",
70
+ },
71
+ };
72
+ export const message = (lang, id) => {
73
+ if (!messages || !messages[lang])
74
+ return id;
75
+ const langMessages = messages[lang];
76
+ return langMessages[id] || `??${id}??`;
77
+ };
78
+ export const Message = ({ id }) => {
79
+ const { lang } = useUbloContext();
80
+ return message(lang, id);
81
+ };
82
+ export default Message;
@@ -0,0 +1,2 @@
1
+ export default function Panier(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=panier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panier.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/panier.js"],"names":[],"mappings":"AAOA,0EAoCC"}
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { renderToString } from "react-dom/server";
3
+ import * as MseM from "ublo-lib/es/future/components/msem";
4
+ import { useUbloContext } from "ublo/with-ublo";
5
+ import CustomOffers from "./custom-offers";
6
+ import * as Services from "./services/links";
7
+ import { useContext } from "./context";
8
+ export default function Panier() {
9
+ const { lang, config } = useUbloContext();
10
+ const { partnerID, apiURL, cmsToken } = useContext();
11
+ const { channel, resort } = config;
12
+ const stringOffers = renderToString(_jsx(CustomOffers, { partnerID: partnerID, lang: lang }));
13
+ return (_jsx("div", { children: _jsx(MseM.Tunnel, { options: {
14
+ lang,
15
+ channel,
16
+ resort,
17
+ groundedTo: "#msem-tunnel",
18
+ esfUrl: "/",
19
+ customOffers: stringOffers,
20
+ analytics: async (data) => {
21
+ const { event, execcode } = data;
22
+ if (event === "purchase" && execcode === "0000") {
23
+ await Services.setLinkUsed(apiURL, getCookie("id"), cmsToken);
24
+ try {
25
+ }
26
+ catch {
27
+ console.error("Failed to mark link as used");
28
+ }
29
+ }
30
+ },
31
+ facet: 0,
32
+ }, children: _jsx("div", { id: "msem-tunnel" }) }) }));
33
+ }
34
+ function getCookie(name) {
35
+ const cookies = document.cookie.split("; ");
36
+ for (const cookie of cookies) {
37
+ const [cookieName, cookieValue] = cookie.split("=");
38
+ if (cookieName === name) {
39
+ return cookieValue;
40
+ }
41
+ }
42
+ return null;
43
+ }
@@ -0,0 +1,6 @@
1
+ export default Partenaire;
2
+ declare function Partenaire({ logo, tools }: {
3
+ logo: any;
4
+ tools: any;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=partenaire.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partenaire.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/partenaire.js"],"names":[],"mappings":";AAYA;;;4CAwCC"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import Login from "ublo/login";
4
+ import Zone from "ublo/zone";
5
+ import { useUbloContext } from "ublo/with-ublo";
6
+ import CartLink from "./cart-link";
7
+ import Connexion from "./connexion";
8
+ import Tunnel from "./tunnel";
9
+ import Panier from "./panier";
10
+ import Tools from "./tools";
11
+ import { pathIncludesKey } from "./utils/path-includes-key";
12
+ import styles from "./partenaire.module.css";
13
+ const Partenaire = ({ logo, tools }) => {
14
+ const { menuPath } = useUbloContext();
15
+ const { menu } = menuPath;
16
+ const isConnexion = pathIncludesKey(menu, "connexion");
17
+ const isTunnel = pathIncludesKey(menu, "tunnel");
18
+ const isCart = pathIncludesKey(menu, "panier");
19
+ if (isConnexion)
20
+ return _jsx(Connexion, { logo: logo });
21
+ return (_jsxs("div", { className: styles.partenaire, children: [_jsxs("header", { className: styles.header, children: [_jsx("div", { className: styles.logo, children: logo }), _jsx(Zone, { id: "hero", className: styles.heroZone, maxSections: 1, tooltip: "Zone d'\u00E9dition : Banni\u00E8re", fixed: true })] }), _jsxs("main", { className: styles.main, children: [_jsx("nav", { className: styles.nav, children: _jsx(CartLink, {}) }), _jsx(Zone, { id: "introduction", className: styles.introductionZone, maxSections: 1, tooltip: "Zone d'\u00E9dition : Texte de pr\u00E9sentation" }), isTunnel && _jsx(Tunnel, {}), isCart && _jsx(Panier, {})] }), _jsx("footer", { className: styles.footer, children: _jsx(Tools, { tools: tools }) }), _jsx(Login, {})] }));
22
+ };
23
+ export default Partenaire;
@@ -0,0 +1,80 @@
1
+ .partenaire {
2
+ --content-width: 1080px;
3
+
4
+ position: relative;
5
+ height: 100%;
6
+ width: 100%;
7
+ display: flex;
8
+ flex-direction: column;
9
+ gap: 40px;
10
+ }
11
+
12
+ @media (min-width: 720px) {
13
+ .partenaire {
14
+ gap: 70px;
15
+ }
16
+ }
17
+
18
+ .header {
19
+ position: relative;
20
+ height: 350px;
21
+ }
22
+
23
+ .logo {
24
+ position: relative;
25
+ width: fit-content;
26
+ padding: 10px;
27
+ pointer-events: none;
28
+ z-index: 2;
29
+ }
30
+
31
+ :global(.cms--editing) .logo {
32
+ display: none;
33
+ }
34
+
35
+ .heroZone {
36
+ position: absolute;
37
+ height: 100%;
38
+ width: 100%;
39
+ top: 0;
40
+ left: 0;
41
+ z-index: 1;
42
+ }
43
+
44
+ .heroZone > * {
45
+ height: 100%;
46
+ max-height: 100%;
47
+ }
48
+
49
+ .nav {
50
+ width: fit-content;
51
+ margin-left: auto;
52
+ }
53
+
54
+ .main {
55
+ width: 100%;
56
+ height: 100%;
57
+ max-width: var(--content-width);
58
+ margin: 0 auto;
59
+ display: flex;
60
+ flex-direction: column;
61
+ gap: 50px;
62
+ padding: 0 10px;
63
+ }
64
+
65
+ @media (min-width: 992px) {
66
+ .main {
67
+ padding: 0;
68
+ }
69
+ }
70
+
71
+ .footer {
72
+ padding: 0 10px;
73
+ margin-bottom: 20px;
74
+ }
75
+
76
+ @media (min-width: 992px) {
77
+ .footer {
78
+ padding: 0;
79
+ }
80
+ }
@@ -0,0 +1,8 @@
1
+ export function getIntermediary(apiURL: any, site: any, partnerID: any, cmsToken: any): Promise<any>;
2
+ export function setIntermediary(apiURL: any, site: any, partnerID: any, intermediary: any, cmsToken: any): Promise<void>;
3
+ export function getMailTemplate(apiURL: any, site: any, partnerID: any, cmsToken: any): Promise<any>;
4
+ export function setMailTemplate(apiURL: any, site: any, partnerID: any, text: any, cmsToken: any): Promise<void>;
5
+ export function getReplyTo(apiURL: any, site: any, partnerID: any, cmsToken: any): Promise<any>;
6
+ export function setReplyTo(apiURL: any, site: any, partnerID: any, reply_to: any, cmsToken: any): Promise<void>;
7
+ export function getMode(apiURL: any, site: any, partnerID: any, cmsToken: any): Promise<any>;
8
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/espace-prive/services/config.js"],"names":[],"mappings":"AAAO,qGAYN;AAEM,yHAoBN;AAEM,qGAWN;AAEM,iHAqBN;AAEM,gGAWN;AAEM,gHAqBN;AAEM,6FAUN"}