@lystech/sections 0.8.0 → 0.9.0
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/README.md +65 -0
- package/dist/BoutonEdition.d.ts +13 -0
- package/dist/BoutonEditionCorps.d.ts +12 -0
- package/dist/SectionsProvider.d.ts +24 -1
- package/dist/catalogue.d.ts +12 -0
- package/dist/constantes.d.ts +15 -0
- package/dist/editeur/MarquesBoutique.d.ts +24 -16
- package/dist/editeur/boutique/Collections.d.ts +5 -8
- package/dist/editeur/boutique/FicheCollection.d.ts +23 -0
- package/dist/editeur/boutique/FicheProduit.d.ts +15 -6
- package/dist/editeur/boutique/ListeVirtuelle.d.ts +13 -0
- package/dist/editeur/boutique/ModuleBoutique.d.ts +34 -3
- package/dist/editeur/boutique/Publier.d.ts +15 -0
- package/dist/editeur/boutique/Selecteur.d.ts +10 -0
- package/dist/editeur/boutique/api.d.ts +48 -0
- package/dist/editeur/boutique/commun.d.ts +19 -0
- package/dist/editeur/boutique/styles.d.ts +1 -1
- package/dist/editeur/styles.d.ts +1 -1
- package/dist/editeur.js +2 -2
- package/dist/index.d.ts +5 -3
- package/dist/index.js +226 -183
- package/dist/morceaux/{ApercuMobile-RzxSOXyF.js → ApercuMobile-CSoo4dpM.js} +1 -1
- package/dist/morceaux/BoutonEditionCorps-B57eJtJn.js +112 -0
- package/dist/morceaux/ModuleBoutique-CgqcQjIb.js +1509 -0
- package/dist/morceaux/{constantes-BwBWlNYy.js → constantes-BAdpe1ss.js} +8 -6
- package/dist/morceaux/index-C_uFDnBO.js +2217 -0
- package/package.json +1 -1
- package/dist/morceaux/ModuleBoutique-BYBYDBN0.js +0 -867
- package/dist/morceaux/index-BicM0J3j.js +0 -2096
package/dist/index.d.ts
CHANGED
|
@@ -9,14 +9,16 @@
|
|
|
9
9
|
* Le paquet ne dépend PAS de @lystech/core : une clinique qui veut modifier
|
|
10
10
|
* trois textes n'a aucune raison de charger un magasin, un panier et PayPal.
|
|
11
11
|
*/
|
|
12
|
-
export { ATTR_PRODUIT, CLASSE_HORS_EDITION, EVENEMENT_CATALOGUE, } from './constantes';
|
|
13
|
-
export { marqueProduit, useCatalogueModifie } from './catalogue';
|
|
14
|
-
export type { ChangementCatalogue, MarqueProduit } from './catalogue';
|
|
12
|
+
export { ATTR_COLLECTION, ATTR_COLLECTION_AFFICHEE, ATTR_PRODUIT, CLASSE_HORS_EDITION, EVENEMENT_CATALOGUE, } from './constantes';
|
|
13
|
+
export { marqueCollection, marqueProduit, useCatalogueModifie } from './catalogue';
|
|
14
|
+
export type { ChangementCatalogue, MarqueCollection, MarqueProduit } from './catalogue';
|
|
15
15
|
export { SectionsProvider, useSectionsContext } from './SectionsProvider';
|
|
16
16
|
export type { SessionSections } from './SectionsProvider';
|
|
17
17
|
export { Audience, useVisiteur } from './Audience';
|
|
18
18
|
export type { AudienceProps } from './Audience';
|
|
19
19
|
export { SignatureLystech } from './SignatureLystech';
|
|
20
|
+
export { BoutonEdition } from './BoutonEdition';
|
|
21
|
+
export type { BoutonEditionProps } from './BoutonEdition';
|
|
20
22
|
export { adaptateurI18next, appliquerAuxTextes } from './sourceTexte';
|
|
21
23
|
export type { Dictionnaire, SourceTexte } from './sourceTexte';
|
|
22
24
|
export { useSection, useSectionList } from './useSection';
|
package/dist/index.js
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { C as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { jsx as
|
|
1
|
+
import { b as le, a as K, A as de, E as Q, s as fe, c as R, d as l, F as X } from "./morceaux/constantes-BAdpe1ss.js";
|
|
2
|
+
import { C as qe } from "./morceaux/constantes-BAdpe1ss.js";
|
|
3
|
+
import { useRef as v, useEffect as E, useState as w, useCallback as y, useMemo as k, useContext as he, createContext as me, Suspense as we, lazy as ge } from "react";
|
|
4
|
+
import { jsx as A, Fragment as te, jsxs as Y } from "react/jsx-runtime";
|
|
5
5
|
import { appliquerAuxTextes as B } from "./morceaux/sourceTexte-BMPMpNg9.js";
|
|
6
|
-
import { adaptateurI18next as
|
|
7
|
-
function
|
|
8
|
-
return { [
|
|
6
|
+
import { adaptateurI18next as $e } from "./morceaux/sourceTexte-BMPMpNg9.js";
|
|
7
|
+
function je(e) {
|
|
8
|
+
return { [de]: e };
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
function Oe(e, t = !1) {
|
|
11
|
+
return t ? { [K]: e, [le]: "" } : { [K]: e };
|
|
12
|
+
}
|
|
13
|
+
function Te(e) {
|
|
14
|
+
const t = v(e);
|
|
15
|
+
t.current = e, E(() => {
|
|
13
16
|
const n = (r) => t.current(r.detail);
|
|
14
|
-
return window.addEventListener(
|
|
17
|
+
return window.addEventListener(Q, n), () => window.removeEventListener(Q, n);
|
|
15
18
|
}, []);
|
|
16
19
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
20
|
+
const ne = me(null), pe = "https://api.lystech.ca/api";
|
|
21
|
+
function ee() {
|
|
19
22
|
if (typeof window > "u") return !1;
|
|
20
23
|
try {
|
|
21
|
-
return window.self !== window.top && (window.name ===
|
|
24
|
+
return window.self !== window.top && (window.name === X || new URL(window.location.href).searchParams.has(X));
|
|
22
25
|
} catch {
|
|
23
26
|
return !1;
|
|
24
27
|
}
|
|
25
28
|
}
|
|
26
|
-
function
|
|
29
|
+
function ye() {
|
|
27
30
|
if (typeof window > "u") return null;
|
|
28
31
|
try {
|
|
29
|
-
return window.localStorage.getItem(
|
|
32
|
+
return window.localStorage.getItem(R) ? null : new URLSearchParams(window.location.hash.replace(/^#/, "")).get(l) ?? new URL(window.location.href).searchParams.get(l) ?? window.localStorage.getItem(l) ?? window.sessionStorage.getItem(l);
|
|
30
33
|
} catch {
|
|
31
34
|
return null;
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
|
-
function
|
|
37
|
+
function Ee() {
|
|
35
38
|
if (typeof window > "u") return null;
|
|
36
39
|
const e = (t) => {
|
|
37
40
|
try {
|
|
@@ -45,8 +48,8 @@ function ae() {
|
|
|
45
48
|
return t;
|
|
46
49
|
};
|
|
47
50
|
try {
|
|
48
|
-
if (window.localStorage.getItem(
|
|
49
|
-
window.localStorage.removeItem(
|
|
51
|
+
if (window.localStorage.getItem(R)) {
|
|
52
|
+
window.localStorage.removeItem(R), window.localStorage.removeItem(l);
|
|
50
53
|
try {
|
|
51
54
|
window.sessionStorage.removeItem(l);
|
|
52
55
|
} catch {
|
|
@@ -55,15 +58,15 @@ function ae() {
|
|
|
55
58
|
}
|
|
56
59
|
const t = window.location.hash.replace(/^#/, "");
|
|
57
60
|
if (t.includes(l + "=")) {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
const
|
|
61
|
+
const s = new URLSearchParams(t), c = s.get(l);
|
|
62
|
+
if (c) {
|
|
63
|
+
s.delete(l);
|
|
64
|
+
const a = s.toString();
|
|
62
65
|
return window.history.replaceState(
|
|
63
66
|
{},
|
|
64
67
|
"",
|
|
65
|
-
window.location.pathname + window.location.search + (
|
|
66
|
-
), e(
|
|
68
|
+
window.location.pathname + window.location.search + (a ? "#" + a : "")
|
|
69
|
+
), e(c);
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
const n = new URL(window.location.href), r = n.searchParams.get(l);
|
|
@@ -72,60 +75,61 @@ function ae() {
|
|
|
72
75
|
return null;
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
|
-
function
|
|
78
|
+
function De({
|
|
76
79
|
site: e,
|
|
77
80
|
page: t,
|
|
78
81
|
langue: n = "fr",
|
|
79
|
-
apiBaseUrl: r =
|
|
80
|
-
sectionsInitiales:
|
|
81
|
-
sourceTexte:
|
|
82
|
-
pagesPartagees:
|
|
82
|
+
apiBaseUrl: r = pe,
|
|
83
|
+
sectionsInitiales: s,
|
|
84
|
+
sourceTexte: c,
|
|
85
|
+
pagesPartagees: a,
|
|
83
86
|
session: h,
|
|
87
|
+
connexionPropre: S = !1,
|
|
84
88
|
children: b
|
|
85
89
|
}) {
|
|
86
|
-
const [
|
|
87
|
-
|
|
88
|
-
), [
|
|
89
|
-
|
|
90
|
-
), [
|
|
91
|
-
() =>
|
|
92
|
-
),
|
|
93
|
-
|
|
90
|
+
const [g, P] = w(
|
|
91
|
+
s ?? []
|
|
92
|
+
), [_, p] = w(
|
|
93
|
+
s?.length ? "pret" : "chargement"
|
|
94
|
+
), [j, re] = w(0), [F, oe] = w({}), [M, ce] = w(!1), [I] = w(ee), [N, z] = w(null), [O, se] = w(
|
|
95
|
+
() => ee() ? null : ye()
|
|
96
|
+
), [ie, ae] = w(0), H = v(null);
|
|
97
|
+
E(() => {
|
|
94
98
|
if (!e || !t) return;
|
|
95
|
-
|
|
99
|
+
H.current?.abort();
|
|
96
100
|
const o = new AbortController();
|
|
97
|
-
|
|
98
|
-
const u = encodeURIComponent(e) + "/" + encodeURIComponent([t, ...
|
|
99
|
-
return
|
|
100
|
-
r + "/site-sections/membre/" + u + (
|
|
101
|
+
H.current = o, p("chargement");
|
|
102
|
+
const u = encodeURIComponent(e) + "/" + encodeURIComponent([t, ...a ?? []].join(",")), d = new Headers(h?.entetes ?? {});
|
|
103
|
+
return O && d.set("Authorization", "Bearer " + O), fetch(
|
|
104
|
+
r + "/site-sections/membre/" + u + (O ? "?toutes=1" : ""),
|
|
101
105
|
{ signal: o.signal, credentials: "include", headers: d }
|
|
102
106
|
).then(
|
|
103
|
-
(
|
|
104
|
-
).then((
|
|
105
|
-
o.signal.aborted || (
|
|
106
|
-
}).catch((
|
|
107
|
-
if (o.signal.aborted ||
|
|
107
|
+
(i) => i.ok ? i.json() : Promise.reject(new Error(String(i.status)))
|
|
108
|
+
).then((i) => {
|
|
109
|
+
o.signal.aborted || (P(Array.isArray(i?.sections) ? i.sections : []), z(i?.viewer ?? null), p("pret"));
|
|
110
|
+
}).catch((i) => {
|
|
111
|
+
if (o.signal.aborted || i?.name === "AbortError") throw i;
|
|
108
112
|
return fetch(r + "/site-sections/public/" + u, {
|
|
109
113
|
signal: o.signal
|
|
110
114
|
}).then(
|
|
111
|
-
(
|
|
112
|
-
).then((
|
|
113
|
-
o.signal.aborted || (
|
|
115
|
+
(C) => C.ok ? C.json() : Promise.reject(new Error(String(C.status)))
|
|
116
|
+
).then((C) => {
|
|
117
|
+
o.signal.aborted || (P(Array.isArray(C) ? C : []), z(null), p("pret"));
|
|
114
118
|
});
|
|
115
|
-
}).catch((
|
|
116
|
-
o.signal.aborted ||
|
|
119
|
+
}).catch((i) => {
|
|
120
|
+
o.signal.aborted || i?.name === "AbortError" || p("erreur");
|
|
117
121
|
}), () => o.abort();
|
|
118
|
-
}, [e, t, r,
|
|
119
|
-
const
|
|
122
|
+
}, [e, t, r, j, (a ?? []).join(","), h?.cle ?? null, O]);
|
|
123
|
+
const D = y(() => re((o) => o + 1), []), q = v({}), J = y((o, u) => {
|
|
120
124
|
q.current[o] = u;
|
|
121
125
|
}, []);
|
|
122
|
-
|
|
123
|
-
!
|
|
124
|
-
}, [
|
|
125
|
-
const
|
|
126
|
-
(o, u) =>
|
|
126
|
+
E(() => {
|
|
127
|
+
!c || !g.length || B(g, c);
|
|
128
|
+
}, [g, c]);
|
|
129
|
+
const L = y(
|
|
130
|
+
(o, u) => oe((d) => ({ ...d, [o]: u })),
|
|
127
131
|
[]
|
|
128
|
-
),
|
|
132
|
+
), m = v({
|
|
129
133
|
site: e,
|
|
130
134
|
page: t,
|
|
131
135
|
langue: n,
|
|
@@ -134,12 +138,12 @@ function be({
|
|
|
134
138
|
recharger: () => {
|
|
135
139
|
}
|
|
136
140
|
});
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
m.current.site = e, m.current.page = t, m.current.langue = n, m.current.poserApercu = L, m.current.sourceTexte = c, m.current.replis = q.current, m.current.recharger = D, E(() => {
|
|
142
|
+
m.current.surChangementDePage?.(t);
|
|
139
143
|
}, [t]);
|
|
140
|
-
const
|
|
144
|
+
const U = v(null), $ = y(
|
|
141
145
|
async (o, u = {}) => {
|
|
142
|
-
const d =
|
|
146
|
+
const d = U.current;
|
|
143
147
|
if (!d) throw new Error("Aucune connexion d'édition active.");
|
|
144
148
|
if (!o.startsWith("/"))
|
|
145
149
|
throw new Error(
|
|
@@ -147,21 +151,21 @@ function be({
|
|
|
147
151
|
);
|
|
148
152
|
const f = new Headers(u.headers);
|
|
149
153
|
f.set("Authorization", "Bearer " + d), typeof u.body == "string" && !f.has("Content-Type") && f.set("Content-Type", "application/json");
|
|
150
|
-
const
|
|
151
|
-
return
|
|
154
|
+
const i = await fetch(r + o, { ...u, headers: f });
|
|
155
|
+
return i.status === 401 && fe(), i;
|
|
152
156
|
},
|
|
153
157
|
[r]
|
|
154
158
|
);
|
|
155
|
-
|
|
156
|
-
if (!
|
|
159
|
+
E(() => {
|
|
160
|
+
if (!I) return;
|
|
157
161
|
const o = (u) => {
|
|
158
162
|
if (u.source !== window.parent || u.origin !== window.location.origin) return;
|
|
159
163
|
const d = u.data;
|
|
160
164
|
if (d?.lystech !== "apercu" || !Array.isArray(d.blocs)) return;
|
|
161
|
-
const f = d.blocs.filter((
|
|
162
|
-
f.length &&
|
|
163
|
-
for (const
|
|
164
|
-
/^i18n:/.test(
|
|
165
|
+
const f = d.blocs.filter((i) => /^i18n:/.test(i.blockType));
|
|
166
|
+
f.length && c && B(f, c);
|
|
167
|
+
for (const i of d.blocs)
|
|
168
|
+
/^i18n:/.test(i.blockType) || L(i.blockType, i.data);
|
|
165
169
|
};
|
|
166
170
|
window.addEventListener("message", o);
|
|
167
171
|
try {
|
|
@@ -169,74 +173,104 @@ function be({
|
|
|
169
173
|
} catch {
|
|
170
174
|
}
|
|
171
175
|
return () => window.removeEventListener("message", o);
|
|
172
|
-
}, [
|
|
173
|
-
const V =
|
|
174
|
-
(o) =>
|
|
176
|
+
}, [I, c, L]);
|
|
177
|
+
const V = y(
|
|
178
|
+
(o) => m.current.ouvrirBoutique?.(o ?? null) ?? !1,
|
|
175
179
|
[]
|
|
176
180
|
);
|
|
177
|
-
|
|
178
|
-
if (
|
|
179
|
-
const o =
|
|
181
|
+
E(() => {
|
|
182
|
+
if (I) return;
|
|
183
|
+
const o = Ee();
|
|
180
184
|
if (!o) return;
|
|
181
185
|
let u = !0, d;
|
|
182
186
|
return import("@lystech/sections/editeur").then((f) => {
|
|
183
|
-
u && (
|
|
187
|
+
u && (U.current = o, ce(!0), d = f.monterEditeur({
|
|
184
188
|
jeton: o,
|
|
185
189
|
site: e,
|
|
186
190
|
apiBaseUrl: r,
|
|
187
|
-
pont:
|
|
191
|
+
pont: m.current
|
|
188
192
|
}));
|
|
189
193
|
}).catch((f) => {
|
|
190
194
|
console.error("[lystech] éditeur indisponible:", f?.message ?? f);
|
|
191
195
|
}), () => {
|
|
192
|
-
u = !1,
|
|
196
|
+
u = !1, U.current = null, d?.();
|
|
193
197
|
};
|
|
194
|
-
}, [e, r,
|
|
195
|
-
const
|
|
198
|
+
}, [e, r, I, ie]);
|
|
199
|
+
const W = y((o) => {
|
|
200
|
+
if (o) {
|
|
201
|
+
try {
|
|
202
|
+
window.localStorage.removeItem(R), window.localStorage.setItem(l, o);
|
|
203
|
+
} catch {
|
|
204
|
+
try {
|
|
205
|
+
window.sessionStorage.setItem(l, o);
|
|
206
|
+
} catch {
|
|
207
|
+
window.location.hash = l + "=" + encodeURIComponent(o);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
se(o), ae((u) => u + 1);
|
|
211
|
+
}
|
|
212
|
+
}, []), G = v(h?.entetes);
|
|
213
|
+
G.current = h?.entetes;
|
|
214
|
+
const Z = y(
|
|
215
|
+
(o, u = {}) => {
|
|
216
|
+
if (!o.startsWith("/"))
|
|
217
|
+
return Promise.reject(new Error("appelSession attend un chemin de l'API."));
|
|
218
|
+
const d = new Headers(u.headers);
|
|
219
|
+
for (const [f, i] of Object.entries(G.current ?? {})) d.set(f, i);
|
|
220
|
+
return fetch(r + o, { ...u, headers: d, credentials: "include" });
|
|
221
|
+
},
|
|
222
|
+
[r]
|
|
223
|
+
), ue = k(
|
|
196
224
|
() => ({
|
|
197
225
|
site: e,
|
|
198
226
|
page: t,
|
|
199
227
|
langue: n,
|
|
200
228
|
apiBaseUrl: r,
|
|
201
|
-
sections:
|
|
202
|
-
etat:
|
|
203
|
-
recharger:
|
|
204
|
-
apercu:
|
|
205
|
-
poserApercu:
|
|
206
|
-
modeEdition:
|
|
207
|
-
declarerRepli:
|
|
208
|
-
appelEdition:
|
|
229
|
+
sections: g,
|
|
230
|
+
etat: _,
|
|
231
|
+
recharger: D,
|
|
232
|
+
apercu: F,
|
|
233
|
+
poserApercu: L,
|
|
234
|
+
modeEdition: M,
|
|
235
|
+
declarerRepli: J,
|
|
236
|
+
appelEdition: $,
|
|
209
237
|
ouvrirBoutique: V,
|
|
210
|
-
modeApercu:
|
|
211
|
-
visiteur:
|
|
238
|
+
modeApercu: I,
|
|
239
|
+
visiteur: N,
|
|
240
|
+
entrerEnEdition: W,
|
|
241
|
+
connexionPropre: S,
|
|
242
|
+
appelSession: Z
|
|
212
243
|
}),
|
|
213
244
|
[
|
|
214
245
|
e,
|
|
215
246
|
t,
|
|
216
247
|
n,
|
|
217
248
|
r,
|
|
218
|
-
|
|
249
|
+
g,
|
|
250
|
+
_,
|
|
251
|
+
D,
|
|
252
|
+
F,
|
|
219
253
|
L,
|
|
220
|
-
|
|
221
|
-
k,
|
|
222
|
-
v,
|
|
223
|
-
z,
|
|
224
|
-
H,
|
|
254
|
+
M,
|
|
225
255
|
J,
|
|
256
|
+
$,
|
|
226
257
|
V,
|
|
227
|
-
|
|
228
|
-
|
|
258
|
+
I,
|
|
259
|
+
N,
|
|
260
|
+
W,
|
|
261
|
+
S,
|
|
262
|
+
Z
|
|
229
263
|
]
|
|
230
264
|
);
|
|
231
|
-
return /* @__PURE__ */
|
|
265
|
+
return /* @__PURE__ */ A(ne.Provider, { value: ue, children: b });
|
|
232
266
|
}
|
|
233
|
-
function
|
|
234
|
-
return
|
|
267
|
+
function x() {
|
|
268
|
+
return he(ne);
|
|
235
269
|
}
|
|
236
|
-
function
|
|
237
|
-
return
|
|
270
|
+
function Ae() {
|
|
271
|
+
return x()?.visiteur ?? null;
|
|
238
272
|
}
|
|
239
|
-
function
|
|
273
|
+
function Se(e, t, n = []) {
|
|
240
274
|
if (t === "everyone") return !0;
|
|
241
275
|
if (!e) return !1;
|
|
242
276
|
switch (t) {
|
|
@@ -250,45 +284,45 @@ function le(e, t, n = []) {
|
|
|
250
284
|
return n.some((r) => e.activePlanUIDs.includes(r));
|
|
251
285
|
}
|
|
252
286
|
}
|
|
253
|
-
function
|
|
254
|
-
const
|
|
255
|
-
return /* @__PURE__ */
|
|
287
|
+
function Ue({ show: e, plans: t, fallback: n = null, children: r }) {
|
|
288
|
+
const s = Ae();
|
|
289
|
+
return /* @__PURE__ */ A(te, { children: Se(s, e, t) ? r : n });
|
|
256
290
|
}
|
|
257
|
-
const
|
|
258
|
-
function
|
|
291
|
+
const be = "https://api.lystech.ca/api";
|
|
292
|
+
function ke({
|
|
259
293
|
site: e,
|
|
260
294
|
apiBaseUrl: t,
|
|
261
295
|
className: n,
|
|
262
296
|
mention: r = "Réalisé avec Lystech",
|
|
263
|
-
connexion:
|
|
264
|
-
methodes:
|
|
297
|
+
connexion: s = "Connexion",
|
|
298
|
+
methodes: c
|
|
265
299
|
}) {
|
|
266
|
-
const
|
|
300
|
+
const a = x(), h = e ?? a?.site ?? "", S = t ?? a?.apiBaseUrl ?? be, [b, g] = w(!1);
|
|
267
301
|
if (!h) return null;
|
|
268
|
-
const
|
|
269
|
-
if (!
|
|
270
|
-
|
|
302
|
+
const P = async () => {
|
|
303
|
+
if (!b) {
|
|
304
|
+
g(!0);
|
|
271
305
|
try {
|
|
272
306
|
(await import("@lystech/sections/editeur")).monterConnexion({
|
|
273
307
|
site: h,
|
|
274
|
-
apiBaseUrl:
|
|
275
|
-
...
|
|
276
|
-
surJeton: (
|
|
308
|
+
apiBaseUrl: S,
|
|
309
|
+
...c ? { methodes: c } : {},
|
|
310
|
+
surJeton: (j) => {
|
|
277
311
|
try {
|
|
278
|
-
window.localStorage.removeItem(
|
|
312
|
+
window.localStorage.removeItem(R), window.localStorage.setItem(l, j);
|
|
279
313
|
} catch {
|
|
280
|
-
window.location.hash = l + "=" + encodeURIComponent(
|
|
314
|
+
window.location.hash = l + "=" + encodeURIComponent(j);
|
|
281
315
|
}
|
|
282
316
|
window.location.reload();
|
|
283
317
|
}
|
|
284
318
|
});
|
|
285
|
-
} catch (
|
|
286
|
-
console.error("[lystech] connexion indisponible:",
|
|
319
|
+
} catch (p) {
|
|
320
|
+
console.error("[lystech] connexion indisponible:", p?.message ?? p);
|
|
287
321
|
} finally {
|
|
288
|
-
|
|
322
|
+
g(!1);
|
|
289
323
|
}
|
|
290
324
|
}
|
|
291
|
-
},
|
|
325
|
+
}, _ = {
|
|
292
326
|
color: "inherit",
|
|
293
327
|
font: "inherit",
|
|
294
328
|
background: "none",
|
|
@@ -298,7 +332,7 @@ function Ie({
|
|
|
298
332
|
textDecoration: "underline",
|
|
299
333
|
textUnderlineOffset: "0.2em"
|
|
300
334
|
};
|
|
301
|
-
return /* @__PURE__ */
|
|
335
|
+
return /* @__PURE__ */ Y(
|
|
302
336
|
"div",
|
|
303
337
|
{
|
|
304
338
|
className: n,
|
|
@@ -312,7 +346,7 @@ function Ie({
|
|
|
312
346
|
lineHeight: 1.5
|
|
313
347
|
},
|
|
314
348
|
children: [
|
|
315
|
-
r !== null && /* @__PURE__ */
|
|
349
|
+
r !== null && /* @__PURE__ */ A(
|
|
316
350
|
"a",
|
|
317
351
|
{
|
|
318
352
|
href: "https://lystech.ca",
|
|
@@ -322,59 +356,64 @@ function Ie({
|
|
|
322
356
|
children: r
|
|
323
357
|
}
|
|
324
358
|
),
|
|
325
|
-
!
|
|
326
|
-
r !== null && /* @__PURE__ */
|
|
327
|
-
/* @__PURE__ */
|
|
359
|
+
!a?.modeEdition && !a?.connexionPropre && /* @__PURE__ */ Y(te, { children: [
|
|
360
|
+
r !== null && /* @__PURE__ */ A("span", { "aria-hidden": "true", children: "·" }),
|
|
361
|
+
/* @__PURE__ */ A("button", { type: "button", style: _, onClick: P, children: b ? "…" : s })
|
|
328
362
|
] })
|
|
329
363
|
]
|
|
330
364
|
}
|
|
331
365
|
);
|
|
332
366
|
}
|
|
333
|
-
|
|
367
|
+
const Ie = ge(() => import("./morceaux/BoutonEditionCorps-B57eJtJn.js"));
|
|
368
|
+
function Fe(e) {
|
|
369
|
+
const t = x();
|
|
370
|
+
return !t || !e.connecte || t.modeEdition || t.modeApercu || e.peutEditer === !1 ? null : /* @__PURE__ */ A(we, { fallback: null, children: /* @__PURE__ */ A(Ie, { ...e }) });
|
|
371
|
+
}
|
|
372
|
+
function Ce(e) {
|
|
334
373
|
return !!e && typeof e == "object" && !Array.isArray(e) && Object.keys(e).every((t) => /^[a-z]{2}(-[A-Za-z]{2})?$/.test(t));
|
|
335
374
|
}
|
|
336
|
-
function
|
|
337
|
-
if (Array.isArray(e)) return e.map((n) =>
|
|
338
|
-
if (
|
|
375
|
+
function T(e, t) {
|
|
376
|
+
if (Array.isArray(e)) return e.map((n) => T(n, t));
|
|
377
|
+
if (Ce(e)) {
|
|
339
378
|
const n = e, r = t.slice(0, 2);
|
|
340
|
-
return n[t] ?? n[r] ?? Object.values(n).find((
|
|
379
|
+
return n[t] ?? n[r] ?? Object.values(n).find((c) => c != null) ?? "";
|
|
341
380
|
}
|
|
342
381
|
if (e && typeof e == "object") {
|
|
343
382
|
const n = {};
|
|
344
|
-
for (const [r,
|
|
345
|
-
n[r] =
|
|
383
|
+
for (const [r, s] of Object.entries(e))
|
|
384
|
+
n[r] = T(s, t);
|
|
346
385
|
return n;
|
|
347
386
|
}
|
|
348
387
|
return e;
|
|
349
388
|
}
|
|
350
|
-
function
|
|
389
|
+
function ve(e, t) {
|
|
351
390
|
if (!t || typeof t != "object" || Array.isArray(t))
|
|
352
391
|
return e;
|
|
353
392
|
const n = { ...e };
|
|
354
|
-
for (const [r,
|
|
355
|
-
|
|
393
|
+
for (const [r, s] of Object.entries(t))
|
|
394
|
+
s != null && (n[r] = s);
|
|
356
395
|
return n;
|
|
357
396
|
}
|
|
358
|
-
function
|
|
397
|
+
function Le(e) {
|
|
359
398
|
return (t) => ({ "data-lystech-champ": `${e}:${t}` });
|
|
360
399
|
}
|
|
361
|
-
function
|
|
362
|
-
const n =
|
|
363
|
-
return
|
|
364
|
-
|
|
365
|
-
}, [
|
|
366
|
-
const
|
|
367
|
-
(
|
|
368
|
-
),
|
|
400
|
+
function Me(e, t) {
|
|
401
|
+
const n = x(), r = n?.apercu?.[e], s = n?.declarerRepli;
|
|
402
|
+
return E(() => {
|
|
403
|
+
s?.(e, t.defaut);
|
|
404
|
+
}, [s, e, t.defaut]), k(() => {
|
|
405
|
+
const c = n?.sections.find(
|
|
406
|
+
(b) => b.blockType === e
|
|
407
|
+
), a = !!c?.hidden, h = a ? null : r ?? c?.data ?? null, S = h ? T(h, n?.langue ?? "fr") : null;
|
|
369
408
|
return {
|
|
370
|
-
contenu:
|
|
371
|
-
visible: !
|
|
372
|
-
audience:
|
|
373
|
-
publie: !!
|
|
374
|
-
UID:
|
|
409
|
+
contenu: ve(t.defaut, S),
|
|
410
|
+
visible: !a,
|
|
411
|
+
audience: c?.audience ?? null,
|
|
412
|
+
publie: !!c?.data,
|
|
413
|
+
UID: c?.UID ?? null,
|
|
375
414
|
chargement: n?.etat === "chargement",
|
|
376
415
|
ancrage: { "data-lystech-section": e },
|
|
377
|
-
champ:
|
|
416
|
+
champ: Le(e)
|
|
378
417
|
};
|
|
379
418
|
}, [
|
|
380
419
|
n?.sections,
|
|
@@ -385,24 +424,24 @@ function ve(e, t) {
|
|
|
385
424
|
t.defaut
|
|
386
425
|
]);
|
|
387
426
|
}
|
|
388
|
-
function
|
|
389
|
-
const n =
|
|
390
|
-
return
|
|
391
|
-
const r = { "data-lystech-section": e },
|
|
392
|
-
(
|
|
393
|
-
),
|
|
394
|
-
return
|
|
395
|
-
items: (t?.defaut ?? []).map((
|
|
396
|
-
...
|
|
427
|
+
function Ne(e, t) {
|
|
428
|
+
const n = x();
|
|
429
|
+
return k(() => {
|
|
430
|
+
const r = { "data-lystech-section": e }, s = (n?.sections ?? []).filter(
|
|
431
|
+
(a) => a.blockType === e
|
|
432
|
+
), c = s.filter((a) => !a.hidden);
|
|
433
|
+
return s.length > 0 && c.length === 0 ? { items: [], publie: !0, chargement: n?.etat === "chargement", ancrage: r } : c.length === 0 ? {
|
|
434
|
+
items: (t?.defaut ?? []).map((a, h) => ({
|
|
435
|
+
...a,
|
|
397
436
|
__uid: `defaut-${h}`
|
|
398
437
|
})),
|
|
399
438
|
publie: !1,
|
|
400
439
|
chargement: n?.etat === "chargement",
|
|
401
440
|
ancrage: r
|
|
402
441
|
} : {
|
|
403
|
-
items:
|
|
404
|
-
...
|
|
405
|
-
__uid:
|
|
442
|
+
items: c.map((a) => ({
|
|
443
|
+
...T(a.data ?? {}, n?.langue ?? "fr"),
|
|
444
|
+
__uid: a.UID
|
|
406
445
|
})),
|
|
407
446
|
publie: !0,
|
|
408
447
|
chargement: n?.etat === "chargement",
|
|
@@ -411,18 +450,22 @@ function Ce(e, t) {
|
|
|
411
450
|
}, [n?.sections, n?.langue, n?.etat, e, t?.defaut]);
|
|
412
451
|
}
|
|
413
452
|
export {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
453
|
+
K as ATTR_COLLECTION,
|
|
454
|
+
le as ATTR_COLLECTION_AFFICHEE,
|
|
455
|
+
de as ATTR_PRODUIT,
|
|
456
|
+
Ue as Audience,
|
|
457
|
+
Fe as BoutonEdition,
|
|
458
|
+
qe as CLASSE_HORS_EDITION,
|
|
459
|
+
Q as EVENEMENT_CATALOGUE,
|
|
460
|
+
De as SectionsProvider,
|
|
461
|
+
ke as SignatureLystech,
|
|
462
|
+
$e as adaptateurI18next,
|
|
421
463
|
B as appliquerAuxTextes,
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
464
|
+
Oe as marqueCollection,
|
|
465
|
+
je as marqueProduit,
|
|
466
|
+
Te as useCatalogueModifie,
|
|
467
|
+
Me as useSection,
|
|
468
|
+
Ne as useSectionList,
|
|
469
|
+
x as useSectionsContext,
|
|
470
|
+
Ae as useVisiteur
|
|
428
471
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as a, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as p, useState as E, useEffect as s } from "react";
|
|
3
|
-
import { F as m, E as u } from "./constantes-
|
|
3
|
+
import { F as m, E as u } from "./constantes-BAdpe1ss.js";
|
|
4
4
|
const v = 390;
|
|
5
5
|
function A({
|
|
6
6
|
brouillons: r,
|