@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/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 ne, E as W, s as re, F as G, a as _, b as l } from "./morceaux/constantes-BwBWlNYy.js";
2
- import { C as Le } from "./morceaux/constantes-BwBWlNYy.js";
3
- import { useRef as x, useEffect as p, useState as g, useCallback as C, useMemo as M, useContext as oe, createContext as ie } from "react";
4
- import { jsx as R, Fragment as Q, jsxs as Z } from "react/jsx-runtime";
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 je } from "./morceaux/sourceTexte-BMPMpNg9.js";
7
- function Ae(e) {
8
- return { [ne]: e };
6
+ import { adaptateurI18next as $e } from "./morceaux/sourceTexte-BMPMpNg9.js";
7
+ function je(e) {
8
+ return { [de]: e };
9
9
  }
10
- function Ee(e) {
11
- const t = x(e);
12
- t.current = e, p(() => {
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(W, n), () => window.removeEventListener(W, n);
17
+ return window.addEventListener(Q, n), () => window.removeEventListener(Q, n);
15
18
  }, []);
16
19
  }
17
- const X = ie(null), ce = "https://api.lystech.ca/api";
18
- function K() {
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 === G || new URL(window.location.href).searchParams.has(G));
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 se() {
29
+ function ye() {
27
30
  if (typeof window > "u") return null;
28
31
  try {
29
- return window.localStorage.getItem(_) ? 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);
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 ae() {
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(_), window.localStorage.removeItem(l);
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 c = new URLSearchParams(t), i = c.get(l);
59
- if (i) {
60
- c.delete(l);
61
- const s = c.toString();
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 + (s ? "#" + s : "")
66
- ), e(i);
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 be({
78
+ function De({
76
79
  site: e,
77
80
  page: t,
78
81
  langue: n = "fr",
79
- apiBaseUrl: r = ce,
80
- sectionsInitiales: c,
81
- sourceTexte: i,
82
- pagesPartagees: s,
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 [m, S] = g(
87
- c ?? []
88
- ), [L, y] = g(
89
- c?.length ? "pret" : "chargement"
90
- ), [I, P] = g(0), [k, Y] = g({}), [z, ee] = g(!1), [A] = g(K), [F, N] = g(null), [j] = g(
91
- () => K() ? null : se()
92
- ), $ = x(null);
93
- p(() => {
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
- $.current?.abort();
99
+ H.current?.abort();
96
100
  const o = new AbortController();
97
- $.current = o, y("chargement");
98
- const u = encodeURIComponent(e) + "/" + encodeURIComponent([t, ...s ?? []].join(",")), d = new Headers(h?.entetes ?? {});
99
- return j && d.set("Authorization", "Bearer " + j), fetch(
100
- r + "/site-sections/membre/" + u + (j ? "?toutes=1" : ""),
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
- (a) => a.ok ? a.json() : Promise.reject(new Error(String(a.status)))
104
- ).then((a) => {
105
- o.signal.aborted || (S(Array.isArray(a?.sections) ? a.sections : []), N(a?.viewer ?? null), y("pret"));
106
- }).catch((a) => {
107
- if (o.signal.aborted || a?.name === "AbortError") throw a;
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
- (E) => E.ok ? E.json() : Promise.reject(new Error(String(E.status)))
112
- ).then((E) => {
113
- o.signal.aborted || (S(Array.isArray(E) ? E : []), N(null), y("pret"));
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((a) => {
116
- o.signal.aborted || a?.name === "AbortError" || y("erreur");
119
+ }).catch((i) => {
120
+ o.signal.aborted || i?.name === "AbortError" || p("erreur");
117
121
  }), () => o.abort();
118
- }, [e, t, r, I, (s ?? []).join(","), h?.cle ?? null, j]);
119
- const O = C(() => P((o) => o + 1), []), q = x({}), H = C((o, u) => {
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
- p(() => {
123
- !i || !m.length || B(m, i);
124
- }, [m, i]);
125
- const v = C(
126
- (o, u) => Y((d) => ({ ...d, [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
- ), w = x({
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
- w.current.site = e, w.current.page = t, w.current.langue = n, w.current.poserApercu = v, w.current.sourceTexte = i, w.current.replis = q.current, w.current.recharger = O, p(() => {
138
- w.current.surChangementDePage?.(t);
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 T = x(null), J = C(
144
+ const U = v(null), $ = y(
141
145
  async (o, u = {}) => {
142
- const d = T.current;
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 a = await fetch(r + o, { ...u, headers: f });
151
- return a.status === 401 && re(), a;
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
- p(() => {
156
- if (!A) return;
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((a) => /^i18n:/.test(a.blockType));
162
- f.length && i && B(f, i);
163
- for (const a of d.blocs)
164
- /^i18n:/.test(a.blockType) || v(a.blockType, a.data);
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
- }, [A, i, v]);
173
- const V = C(
174
- (o) => w.current.ouvrirBoutique?.(o ?? null) ?? !1,
176
+ }, [I, c, L]);
177
+ const V = y(
178
+ (o) => m.current.ouvrirBoutique?.(o ?? null) ?? !1,
175
179
  []
176
180
  );
177
- p(() => {
178
- if (A) return;
179
- const o = ae();
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 && (T.current = o, ee(!0), d = f.monterEditeur({
187
+ u && (U.current = o, ce(!0), d = f.monterEditeur({
184
188
  jeton: o,
185
189
  site: e,
186
190
  apiBaseUrl: r,
187
- pont: w.current
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, T.current = null, d?.();
196
+ u = !1, U.current = null, d?.();
193
197
  };
194
- }, [e, r, A]);
195
- const te = M(
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: m,
202
- etat: L,
203
- recharger: O,
204
- apercu: k,
205
- poserApercu: v,
206
- modeEdition: z,
207
- declarerRepli: H,
208
- appelEdition: J,
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: A,
211
- visiteur: F
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
- m,
249
+ g,
250
+ _,
251
+ D,
252
+ F,
219
253
  L,
220
- O,
221
- k,
222
- v,
223
- z,
224
- H,
254
+ M,
225
255
  J,
256
+ $,
226
257
  V,
227
- A,
228
- F
258
+ I,
259
+ N,
260
+ W,
261
+ S,
262
+ Z
229
263
  ]
230
264
  );
231
- return /* @__PURE__ */ R(X.Provider, { value: te, children: b });
265
+ return /* @__PURE__ */ A(ne.Provider, { value: ue, children: b });
232
266
  }
233
- function U() {
234
- return oe(X);
267
+ function x() {
268
+ return he(ne);
235
269
  }
236
- function ue() {
237
- return U()?.visiteur ?? null;
270
+ function Ae() {
271
+ return x()?.visiteur ?? null;
238
272
  }
239
- function le(e, t, n = []) {
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 Se({ show: e, plans: t, fallback: n = null, children: r }) {
254
- const c = ue();
255
- return /* @__PURE__ */ R(Q, { children: le(c, e, t) ? r : n });
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 de = "https://api.lystech.ca/api";
258
- function Ie({
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: c = "Connexion",
264
- methodes: i
297
+ connexion: s = "Connexion",
298
+ methodes: c
265
299
  }) {
266
- const s = U(), h = e ?? s?.site ?? "", b = t ?? s?.apiBaseUrl ?? de, [m, S] = g(!1);
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 L = async () => {
269
- if (!m) {
270
- S(!0);
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: b,
275
- ...i ? { methodes: i } : {},
276
- surJeton: (P) => {
308
+ apiBaseUrl: S,
309
+ ...c ? { methodes: c } : {},
310
+ surJeton: (j) => {
277
311
  try {
278
- window.localStorage.removeItem(_), window.localStorage.setItem(l, P);
312
+ window.localStorage.removeItem(R), window.localStorage.setItem(l, j);
279
313
  } catch {
280
- window.location.hash = l + "=" + encodeURIComponent(P);
314
+ window.location.hash = l + "=" + encodeURIComponent(j);
281
315
  }
282
316
  window.location.reload();
283
317
  }
284
318
  });
285
- } catch (I) {
286
- console.error("[lystech] connexion indisponible:", I?.message ?? I);
319
+ } catch (p) {
320
+ console.error("[lystech] connexion indisponible:", p?.message ?? p);
287
321
  } finally {
288
- S(!1);
322
+ g(!1);
289
323
  }
290
324
  }
291
- }, y = {
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__ */ Z(
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__ */ R(
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
- !s?.modeEdition && /* @__PURE__ */ Z(Q, { children: [
326
- r !== null && /* @__PURE__ */ R("span", { "aria-hidden": "true", children: "·" }),
327
- /* @__PURE__ */ R("button", { type: "button", style: y, onClick: L, children: m ? "…" : c })
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
- function fe(e) {
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 D(e, t) {
337
- if (Array.isArray(e)) return e.map((n) => D(n, t));
338
- if (fe(e)) {
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((i) => i != null) ?? "";
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, c] of Object.entries(e))
345
- n[r] = D(c, t);
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 he(e, t) {
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, c] of Object.entries(t))
355
- c != null && (n[r] = c);
393
+ for (const [r, s] of Object.entries(t))
394
+ s != null && (n[r] = s);
356
395
  return n;
357
396
  }
358
- function me(e) {
397
+ function Le(e) {
359
398
  return (t) => ({ "data-lystech-champ": `${e}:${t}` });
360
399
  }
361
- function ve(e, t) {
362
- const n = U(), r = n?.apercu?.[e], c = n?.declarerRepli;
363
- return p(() => {
364
- c?.(e, t.defaut);
365
- }, [c, e, t.defaut]), M(() => {
366
- const i = n?.sections.find(
367
- (m) => m.blockType === e
368
- ), s = !!i?.hidden, h = s ? null : r ?? i?.data ?? null, b = h ? D(h, n?.langue ?? "fr") : null;
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: he(t.defaut, b),
371
- visible: !s,
372
- audience: i?.audience ?? null,
373
- publie: !!i?.data,
374
- UID: i?.UID ?? null,
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: me(e)
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 Ce(e, t) {
389
- const n = U();
390
- return M(() => {
391
- const r = { "data-lystech-section": e }, c = (n?.sections ?? []).filter(
392
- (s) => s.blockType === e
393
- ), i = c.filter((s) => !s.hidden);
394
- return c.length > 0 && i.length === 0 ? { items: [], publie: !0, chargement: n?.etat === "chargement", ancrage: r } : i.length === 0 ? {
395
- items: (t?.defaut ?? []).map((s, h) => ({
396
- ...s,
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: i.map((s) => ({
404
- ...D(s.data ?? {}, n?.langue ?? "fr"),
405
- __uid: s.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
- ne as ATTR_PRODUIT,
415
- Se as Audience,
416
- Le as CLASSE_HORS_EDITION,
417
- W as EVENEMENT_CATALOGUE,
418
- be as SectionsProvider,
419
- Ie as SignatureLystech,
420
- je as adaptateurI18next,
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
- Ae as marqueProduit,
423
- Ee as useCatalogueModifie,
424
- ve as useSection,
425
- Ce as useSectionList,
426
- U as useSectionsContext,
427
- ue as useVisiteur
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-BwBWlNYy.js";
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,