@lystech/sections 0.6.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.
Files changed (36) hide show
  1. package/README.md +188 -1
  2. package/dist/Audience.d.ts +14 -0
  3. package/dist/BoutonEdition.d.ts +13 -0
  4. package/dist/BoutonEditionCorps.d.ts +12 -0
  5. package/dist/SectionsProvider.d.ts +62 -2
  6. package/dist/catalogue.d.ts +30 -0
  7. package/dist/constantes.d.ts +38 -0
  8. package/dist/editeur/ApercuMobile.d.ts +7 -0
  9. package/dist/editeur/ChoixAudience.d.ts +6 -0
  10. package/dist/editeur/MarquesBoutique.d.ts +26 -0
  11. package/dist/editeur/api.d.ts +16 -1
  12. package/dist/editeur/boutique/Collections.d.ts +8 -0
  13. package/dist/editeur/boutique/FicheCollection.d.ts +23 -0
  14. package/dist/editeur/boutique/FicheProduit.d.ts +23 -0
  15. package/dist/editeur/boutique/ListeVirtuelle.d.ts +13 -0
  16. package/dist/editeur/boutique/ModuleBoutique.d.ts +44 -0
  17. package/dist/editeur/boutique/Publier.d.ts +15 -0
  18. package/dist/editeur/boutique/Selecteur.d.ts +10 -0
  19. package/dist/editeur/boutique/api.d.ts +131 -0
  20. package/dist/editeur/boutique/commun.d.ts +19 -0
  21. package/dist/editeur/boutique/photos.d.ts +9 -0
  22. package/dist/editeur/boutique/styles.d.ts +1 -0
  23. package/dist/editeur/pont.d.ts +7 -0
  24. package/dist/editeur/styles.d.ts +1 -1
  25. package/dist/editeur.js +6 -1736
  26. package/dist/index.d.ts +9 -2
  27. package/dist/index.js +351 -209
  28. package/dist/morceaux/ApercuMobile-CSoo4dpM.js +63 -0
  29. package/dist/morceaux/BoutonEditionCorps-B57eJtJn.js +112 -0
  30. package/dist/morceaux/ModuleBoutique-CgqcQjIb.js +1509 -0
  31. package/dist/morceaux/constantes-BAdpe1ss.js +24 -0
  32. package/dist/morceaux/index-C_uFDnBO.js +2217 -0
  33. package/dist/types.d.ts +30 -0
  34. package/dist/useSection.d.ts +15 -0
  35. package/package.json +46 -46
  36. package/dist/morceaux/constantes-BPZxUYge.js +0 -19
package/dist/editeur.js CHANGED
@@ -1,1738 +1,8 @@
1
- import { jsx as t, jsxs as x, Fragment as ue } from "react/jsx-runtime";
2
- import { createRoot as de } from "react-dom/client";
3
- import { C as pe, s as fe } from "./morceaux/constantes-BPZxUYge.js";
4
- import { useState as q, useRef as Q, useEffect as X, useCallback as Y, useMemo as se } from "react";
5
- function Ce({
6
- jeton: n,
7
- site: e,
8
- apiBaseUrl: o,
9
- surJetonRefuse: s
10
- }) {
11
- const a = {
12
- "Content-Type": "application/json",
13
- Authorization: "Bearer " + n
14
- };
15
- function c(r, u) {
16
- if (u && (r.status === 401 || r.status === 403) && s(), !r.ok) throw new Error(String(r.status));
17
- }
18
- async function l(r, u = !0) {
19
- const A = await fetch(o + r, {
20
- headers: u ? a : void 0
21
- });
22
- return c(A, u), await A.json();
23
- }
24
- async function y(r, u, A) {
25
- const S = await fetch(o + r, {
26
- method: u,
27
- headers: a,
28
- body: A === void 0 ? void 0 : JSON.stringify(A)
29
- });
30
- return c(S, !0), await S.json();
31
- }
32
- return {
33
- /** Les blocs que le site a déclaré savoir afficher. Route publique. */
34
- schemas: () => l("/site-sections/public/" + encodeURIComponent(e) + "/schemas", !1),
35
- /** Ce qui existe sur une page, brouillons compris. */
36
- pourPage: (r) => l("/site-sections?page=" + encodeURIComponent(r)),
37
- creer: (r, u, A) => y("/site-sections", "POST", { page: r, blockType: u, draft: A }),
38
- enregistrerBrouillon: (r, u) => y("/site-sections/" + r + "/draft", "PUT", { draft: u }),
39
- publier: (r) => y("/site-sections/" + r + "/publish", "POST"),
40
- /** Ramène le brouillon à ce qui est en ligne. */
41
- annuler: (r) => y("/site-sections/" + r + "/revert", "POST")
42
- };
43
- }
44
- const we = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAW+UlEQVR42u17aZBc13Xed859r7tn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8t6/t2fDlXTzhAgD/HG4Ln5lxmIy3IV394NdvmW+G95V/+cjl3DO/3DJ1zFEilAsawvNSFE8GX+wU7W5//bLw+EOzs+0BgVNMbJd/nreRk1LdsiCoqgsFSXXxwPDLh+r4eAb847td/NVjE2dcf24z4OgnJhzGp7KB++cF3+dLzoNwfp1f59f5dX6dX6/m+r8Cl0QchG1LcQAAAABJRU5ErkJggg==", Ee = {
45
- apiKey: "AIzaSyCpAeHlt1wZvM5KtYg7X7MDVnWVJT86gvc",
46
- authDomain: "lystech.firebaseapp.com",
47
- projectId: "lystech",
48
- storageBucket: "lystech.appspot.com",
49
- messagingSenderId: "237347321732",
50
- appId: "1:237347321732:web:7f9586d48e488d73ddcfd1"
51
- };
52
- function Ne() {
53
- return /* @__PURE__ */ x("span", { className: "marque", children: [
54
- /* @__PURE__ */ t("img", { src: we, alt: "", width: 22, height: 22 }),
55
- /* @__PURE__ */ t("span", { className: "marque__mot", children: "Lystech" })
56
- ] });
57
- }
58
- function Se() {
59
- return /* @__PURE__ */ x("svg", { viewBox: "0 0 18 18", "aria-hidden": "true", focusable: "false", className: "logo", children: [
60
- /* @__PURE__ */ t("path", { fill: "#4285F4", d: "M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.48h4.84a4.14 4.14 0 0 1-1.8 2.72v2.26h2.91c1.7-1.57 2.69-3.88 2.69-6.62z" }),
61
- /* @__PURE__ */ t("path", { fill: "#34A853", d: "M9 18c2.43 0 4.47-.8 5.96-2.18l-2.91-2.26c-.81.54-1.84.86-3.05.86-2.34 0-4.33-1.58-5.04-3.71H.96v2.33A9 9 0 0 0 9 18z" }),
62
- /* @__PURE__ */ t("path", { fill: "#FBBC05", d: "M3.96 10.71a5.41 5.41 0 0 1 0-3.42V4.96H.96a9 9 0 0 0 0 8.08l3-2.33z" }),
63
- /* @__PURE__ */ t("path", { fill: "#EA4335", d: "M9 3.58c1.32 0 2.5.45 3.44 1.35l2.58-2.59C13.46.89 11.43 0 9 0A9 9 0 0 0 .96 4.96l3 2.33C4.67 5.16 6.66 3.58 9 3.58z" })
64
- ] });
65
- }
66
- function Le() {
67
- return /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", className: "logo", children: /* @__PURE__ */ t(
68
- "path",
69
- {
70
- fill: "#fff",
71
- d: "M22 12.06C22 6.5 17.52 2 12 2S2 6.5 2 12.06c0 5.02 3.66 9.18 8.44 9.94v-7.03H7.9v-2.91h2.54V9.85c0-2.52 1.49-3.91 3.77-3.91 1.09 0 2.24.2 2.24.2v2.46h-1.26c-1.24 0-1.63.78-1.63 1.57v1.89h2.78l-.45 2.91h-2.33V22c4.78-.76 8.44-4.92 8.44-9.94z"
72
- }
73
- ) });
74
- }
75
- function Te({
76
- site: n,
77
- apiBaseUrl: e,
78
- methodes: o = ["google", "facebook"],
79
- surJeton: s,
80
- surFermer: a
81
- }) {
82
- const [c, l] = q({ nom: "repos" }), y = (S) => {
83
- switch (S) {
84
- case "auth/popup-blocked":
85
- return "Votre navigateur a bloqué la fenêtre de connexion. Autorisez les fenêtres pour ce site, puis réessayez.";
86
- case "auth/popup-closed-by-user":
87
- case "auth/cancelled-popup-request":
88
- return "Connexion annulée.";
89
- case "auth/unauthorized-domain":
90
- return "Ce domaine n'est pas encore autorisé côté Lystech. Prévenez la personne qui gère le site.";
91
- case "auth/account-exists-with-different-credential":
92
- return "Cette adresse est déjà associée à un autre mode de connexion. Essayez l'autre bouton.";
93
- case "auth/network-request-failed":
94
- return "Connexion au réseau impossible. Vérifiez votre lien Internet.";
95
- default:
96
- return "La connexion a échoué. Réessayez dans un instant.";
97
- }
98
- }, r = async (S, N = !1) => {
99
- const I = await fetch(e + "/site-sections/edit-login/third-party", {
100
- method: "POST",
101
- headers: { "Content-Type": "application/json" },
102
- body: JSON.stringify({
103
- site: n,
104
- token: S,
105
- tokenType: "firebase",
106
- demanderAcces: N
107
- })
108
- });
109
- if (I.status === 429) {
110
- l({
111
- nom: "erreur",
112
- texte: "Trop de tentatives. Réessayez dans quelques minutes."
113
- });
114
- return;
115
- }
116
- const L = await I.json().catch(() => null);
117
- if (L?.ok && L?.token) {
118
- s(L.token);
119
- return;
120
- }
121
- switch (L?.raison) {
122
- case "sans_acces":
123
- l({ nom: "sans-acces", jeton: S });
124
- return;
125
- case "demande_envoyee":
126
- l({ nom: "demande-envoyee" });
127
- return;
128
- case "trop_de_demandes":
129
- l({
130
- nom: "erreur",
131
- texte: "Trop de demandes aujourd'hui. Réessayez demain."
132
- });
133
- return;
134
- case "aucun_compte":
135
- l({ nom: "aucun-compte", adresse: "" });
136
- return;
137
- case "adresse_non_verifiee":
138
- l({
139
- nom: "erreur",
140
- texte: "Votre fournisseur n'a pas confirmé cette adresse courriel. Vérifiez-la chez lui, puis réessayez."
141
- });
142
- return;
143
- default:
144
- l({
145
- nom: "erreur",
146
- texte: "La connexion a échoué. Réessayez dans un instant."
147
- });
148
- }
149
- }, u = async (S) => {
150
- l({ nom: "envoi", quoi: S });
151
- try {
152
- const [{ initializeApp: N, getApps: I }, L] = await Promise.all([
153
- import("./morceaux/index.esm-B4AB50RA.js"),
154
- import("./morceaux/index.esm-B4hL1FOE.js")
155
- ]), b = I().find((g) => g.name === "lystech-edition") ?? N(Ee, "lystech-edition"), M = S === "google" ? new L.GoogleAuthProvider() : new L.FacebookAuthProvider(), B = await (await L.signInWithPopup(L.getAuth(b), M)).user.getIdToken();
156
- await r(B);
157
- } catch (N) {
158
- l({ nom: "erreur", texte: y(String(N?.code ?? "")) });
159
- }
160
- }, A = c.nom === "envoi";
161
- return /* @__PURE__ */ t("div", { className: "voile", role: "dialog", "aria-modal": "true", "aria-label": "Modifier ce site", children: /* @__PURE__ */ x("div", { className: "fenetre", children: [
162
- /* @__PURE__ */ t(
163
- "button",
164
- {
165
- type: "button",
166
- className: "fenetre__fermer",
167
- onClick: a,
168
- "aria-label": "Fermer",
169
- children: "✕"
170
- }
171
- ),
172
- /* @__PURE__ */ x("div", { className: "fenetre__tete", children: [
173
- /* @__PURE__ */ t(Ne, {}),
174
- /* @__PURE__ */ t("h2", { className: "fenetre__titre", children: "Modifier ce site" }),
175
- /* @__PURE__ */ t("p", { className: "fenetre__sous", children: "Vous vous connectez à Lystech. Cet accès ne sert qu'à modifier le contenu de ce site." })
176
- ] }),
177
- /* @__PURE__ */ x("div", { className: "fenetre__corps", children: [
178
- c.nom === "erreur" && /* @__PURE__ */ t("p", { className: "message message--erreur", children: c.texte }),
179
- c.nom === "aucun-compte" && /* @__PURE__ */ t("p", { className: "message message--info", children: "Aucun compte Lystech ne correspond à cette adresse. Adressez-vous à la personne responsable du site." }),
180
- c.nom === "sans-acces" && /* @__PURE__ */ t("p", { className: "message message--info", children: "Vous êtes bien reconnu, mais vous n'avez pas encore le droit de modifier ce site. Vous pouvez le demander : la personne responsable recevra un courriel." }),
181
- c.nom === "demande-envoyee" && /* @__PURE__ */ t("p", { className: "message message--ok", children: "Demande envoyée. La personne responsable du site vous répondra." }),
182
- c.nom === "sans-acces" ? /* @__PURE__ */ t(
183
- "button",
184
- {
185
- type: "button",
186
- className: "bouton bouton--principal bouton--large",
187
- onClick: () => {
188
- r(c.jeton, !0);
189
- },
190
- children: "Demander l'accès"
191
- }
192
- ) : c.nom === "demande-envoyee" || c.nom === "aucun-compte" ? /* @__PURE__ */ t(
193
- "button",
194
- {
195
- type: "button",
196
- className: "bouton bouton--large",
197
- onClick: a,
198
- children: "Fermer"
199
- }
200
- ) : /* @__PURE__ */ x("div", { className: "fournisseurs", children: [
201
- o.includes("google") && /* @__PURE__ */ x(
202
- "button",
203
- {
204
- type: "button",
205
- className: "fournisseur fournisseur--google",
206
- disabled: A,
207
- onClick: () => {
208
- u("google");
209
- },
210
- children: [
211
- /* @__PURE__ */ t(Se, {}),
212
- /* @__PURE__ */ t("span", { children: c.nom === "envoi" && c.quoi === "google" ? "Connexion…" : "Continuer avec Google" })
213
- ]
214
- }
215
- ),
216
- o.includes("facebook") && /* @__PURE__ */ x(
217
- "button",
218
- {
219
- type: "button",
220
- className: "fournisseur fournisseur--facebook",
221
- disabled: A,
222
- onClick: () => {
223
- u("facebook");
224
- },
225
- children: [
226
- /* @__PURE__ */ t(Le, {}),
227
- /* @__PURE__ */ t("span", { children: c.nom === "envoi" && c.quoi === "facebook" ? "Connexion…" : "Continuer avec Facebook" })
228
- ]
229
- }
230
- )
231
- ] })
232
- ] })
233
- ] }) });
234
- }
235
- function De(n, e) {
236
- const o = n && typeof n == "object" && !Array.isArray(n) ? Object.keys(n).filter((a) => /^[a-z]{2}(-[A-Za-z]{2})?$/.test(a)) : [], s = e.slice(0, 2);
237
- return Array.from(/* @__PURE__ */ new Set([s, ...o]));
238
- }
239
- function ze(n) {
240
- switch (n.type) {
241
- case "number":
242
- return 0;
243
- case "boolean":
244
- return !1;
245
- case "list":
246
- return [];
247
- default:
248
- return "";
249
- }
250
- }
251
- function ie({ champ: n, valeur: e, changer: o }) {
252
- switch (n.type) {
253
- case "richText":
254
- return /* @__PURE__ */ t(
255
- "textarea",
256
- {
257
- value: String(e ?? ""),
258
- onChange: (s) => o(s.target.value)
259
- }
260
- );
261
- case "number":
262
- return /* @__PURE__ */ t(
263
- "input",
264
- {
265
- type: "number",
266
- value: e === "" || e == null ? "" : String(e),
267
- onChange: (s) => o(s.target.value === "" ? "" : Number(s.target.value))
268
- }
269
- );
270
- case "boolean":
271
- return /* @__PURE__ */ x("label", { className: "bascule", children: [
272
- /* @__PURE__ */ t(
273
- "input",
274
- {
275
- type: "checkbox",
276
- checked: e === !0,
277
- onChange: (s) => o(s.target.checked)
278
- }
279
- ),
280
- /* @__PURE__ */ t("span", { children: e === !0 ? "Oui" : "Non" })
281
- ] });
282
- case "date":
283
- return /* @__PURE__ */ t(
284
- "input",
285
- {
286
- type: "date",
287
- value: String(e ?? "").slice(0, 10),
288
- onChange: (s) => o(s.target.value)
289
- }
290
- );
291
- case "choice":
292
- return /* @__PURE__ */ x(
293
- "select",
294
- {
295
- value: String(e ?? ""),
296
- onChange: (s) => o(s.target.value),
297
- children: [
298
- /* @__PURE__ */ t("option", { value: "", children: "—" }),
299
- (n.options ?? []).map((s) => /* @__PURE__ */ t("option", { value: s, children: s }, s))
300
- ]
301
- }
302
- );
303
- case "url":
304
- return /* @__PURE__ */ t(
305
- "input",
306
- {
307
- type: "url",
308
- value: String(e ?? ""),
309
- onChange: (s) => o(s.target.value),
310
- placeholder: "https://"
311
- }
312
- );
313
- case "image":
314
- return /* @__PURE__ */ x(ue, { children: [
315
- /* @__PURE__ */ t(
316
- "input",
317
- {
318
- type: "url",
319
- value: String(e ?? ""),
320
- onChange: (s) => o(s.target.value),
321
- placeholder: "https://…"
322
- }
323
- ),
324
- String(e ?? "").startsWith("http") && /* @__PURE__ */ t("img", { className: "vignette", src: String(e), alt: "" })
325
- ] });
326
- default:
327
- return /* @__PURE__ */ t(
328
- "input",
329
- {
330
- type: "text",
331
- value: String(e ?? ""),
332
- onChange: (s) => o(s.target.value)
333
- }
334
- );
335
- }
336
- }
337
- function me({ champ: n, valeur: e, changer: o, langue: s }) {
338
- if (n.type === "list") {
339
- const a = Array.isArray(e) ? e : [], c = n.of ?? [], l = (y, r, u) => {
340
- const A = a.map((S, N) => N === y ? { ...S, [r]: u } : S);
341
- o(A);
342
- };
343
- return /* @__PURE__ */ x("div", { className: "champ", children: [
344
- /* @__PURE__ */ t("span", { className: "champ__etiquette", children: n.label }),
345
- n.help && /* @__PURE__ */ t("p", { className: "champ__aide", children: n.help }),
346
- a.map((y, r) => /* @__PURE__ */ x("div", { className: "liste__item", children: [
347
- /* @__PURE__ */ x("div", { className: "liste__tete", children: [
348
- /* @__PURE__ */ t("span", { className: "liste__rang", children: r + 1 }),
349
- /* @__PURE__ */ x("span", { style: { display: "flex", gap: 4 }, children: [
350
- /* @__PURE__ */ t(
351
- "button",
352
- {
353
- type: "button",
354
- className: "bouton bouton--icone bouton--discret",
355
- title: "Monter",
356
- disabled: r === 0,
357
- onClick: () => {
358
- const u = [...a];
359
- [u[r - 1], u[r]] = [u[r], u[r - 1]], o(u);
360
- },
361
- children: "↑"
362
- }
363
- ),
364
- /* @__PURE__ */ t(
365
- "button",
366
- {
367
- type: "button",
368
- className: "bouton bouton--icone bouton--discret",
369
- title: "Descendre",
370
- disabled: r === a.length - 1,
371
- onClick: () => {
372
- const u = [...a];
373
- [u[r], u[r + 1]] = [u[r + 1], u[r]], o(u);
374
- },
375
- children: "↓"
376
- }
377
- ),
378
- /* @__PURE__ */ t(
379
- "button",
380
- {
381
- type: "button",
382
- className: "bouton bouton--icone bouton--discret",
383
- title: "Retirer",
384
- onClick: () => o(a.filter((u, A) => A !== r)),
385
- children: "✕"
386
- }
387
- )
388
- ] })
389
- ] }),
390
- c.map((u) => /* @__PURE__ */ t(
391
- me,
392
- {
393
- champ: u,
394
- langue: s,
395
- valeur: y?.[u.key],
396
- changer: (A) => l(r, u.key, A)
397
- },
398
- u.key
399
- ))
400
- ] }, r)),
401
- /* @__PURE__ */ t(
402
- "button",
403
- {
404
- type: "button",
405
- className: "bouton",
406
- onClick: () => o([
407
- ...a,
408
- Object.fromEntries(c.map((y) => [y.key, ze(y)]))
409
- ]),
410
- children: "+ Ajouter"
411
- }
412
- )
413
- ] });
414
- }
415
- if (n.localized) {
416
- const a = De(e, s), c = e && typeof e == "object" && !Array.isArray(e) ? e : {};
417
- return /* @__PURE__ */ x("div", { className: "champ", children: [
418
- /* @__PURE__ */ t("span", { className: "champ__etiquette", children: n.label }),
419
- n.help && /* @__PURE__ */ t("p", { className: "champ__aide", children: n.help }),
420
- a.map((l) => /* @__PURE__ */ x("div", { style: { marginBottom: 8 }, children: [
421
- /* @__PURE__ */ t("span", { className: "champ__langue", children: l }),
422
- /* @__PURE__ */ t(
423
- ie,
424
- {
425
- champ: n,
426
- valeur: c[l],
427
- changer: (y) => o({ ...c, [l]: y })
428
- }
429
- )
430
- ] }, l))
431
- ] });
432
- }
433
- return /* @__PURE__ */ x("div", { className: "champ", children: [
434
- /* @__PURE__ */ t("label", { className: "champ__etiquette", children: n.label }),
435
- /* @__PURE__ */ t(ie, { champ: n, valeur: e, changer: o }),
436
- n.help && /* @__PURE__ */ t("p", { className: "champ__aide", children: n.help })
437
- ] });
438
- }
439
- const be = "data-lystech-champ", _e = ["lystech-editeur-hote", "lystech-connexion-hote"], Oe = ["number", "text", "url", "date"], Pe = "outline:2px dashed rgba(59,165,141,.85);outline-offset:3px;border-radius:3px;cursor:text;";
440
- function te(n) {
441
- if (!(n instanceof Element)) return null;
442
- const e = n.closest(`[${be}]`);
443
- return !e || e.closest("." + pe) || _e.some((o) => e.closest("#" + o)) ? null : e;
444
- }
445
- function ce(n) {
446
- const e = n.getAttribute(be) ?? "", o = e.lastIndexOf(":");
447
- return o <= 0 || o === e.length - 1 ? null : { blockType: e.slice(0, o), champ: e.slice(o + 1) };
448
- }
449
- function ne(n) {
450
- const e = n.dataset.lysStyleAvant;
451
- e !== void 0 && (delete n.dataset.lysStyleAvant, e ? n.setAttribute("style", e) : n.removeAttribute("style"));
452
- }
453
- function Ie(n, e) {
454
- if (n === "number") {
455
- const o = e.replace(/\s/g, "").replace(",", "."), s = Number(o);
456
- return o === "" || !Number.isFinite(s) ? { ok: !1, erreur: "Un nombre, en chiffres — par exemple 85 ou 85,50." } : { ok: !0, valeur: s };
457
- }
458
- return { ok: !0, valeur: e.trim() };
459
- }
460
- function Me({
461
- actif: n,
462
- lire: e,
463
- enregistrer: o,
464
- ouvrirPanneau: s
465
- }) {
466
- const [a, c] = q(null), l = Q(null), y = Q(1), r = Q(null), u = Q(null), A = Q({ lire: e, enregistrer: o, ouvrirPanneau: s });
467
- A.current = { lire: e, enregistrer: o, ouvrirPanneau: s }, X(() => {
468
- if (!n) {
469
- c(null);
470
- return;
471
- }
472
- const b = /* @__PURE__ */ new Set(), M = (v) => {
473
- const h = te(v.target);
474
- if (!h) return;
475
- const z = ce(h);
476
- !z || !A.current.lire(z.blockType, z.champ) || (h.dataset.lysStyleAvant === void 0 && (h.dataset.lysStyleAvant = h.getAttribute("style") ?? ""), h.setAttribute("style", h.dataset.lysStyleAvant + Pe), b.add(h));
477
- }, D = (v) => {
478
- const h = te(v.target);
479
- if (!h) return;
480
- const z = v.relatedTarget;
481
- z instanceof Node && h.contains(z) || (ne(h), b.delete(h));
482
- }, B = (v) => {
483
- const h = te(v.target);
484
- if (!h) return;
485
- const z = ce(h);
486
- if (!z) return;
487
- const R = A.current.lire(z.blockType, z.champ);
488
- if (!R) return;
489
- if (v.preventDefault(), v.stopPropagation(), ne(h), b.delete(h), !Oe.includes(R.type)) {
490
- A.current.ouvrirPanneau(z.blockType);
491
- return;
492
- }
493
- const d = getComputedStyle(h);
494
- c({
495
- jeton: y.current++,
496
- ...z,
497
- info: R,
498
- el: h,
499
- rect: h.getBoundingClientRect(),
500
- police: {
501
- fontFamily: d.fontFamily,
502
- fontSize: d.fontSize,
503
- fontWeight: d.fontWeight,
504
- letterSpacing: d.letterSpacing
505
- },
506
- texte: R.valeur == null ? "" : String(R.valeur),
507
- erreur: null,
508
- envoi: !1
509
- });
510
- }, g = () => c((v) => v && { ...v, rect: v.el.getBoundingClientRect() });
511
- return document.addEventListener("mouseover", M, !0), document.addEventListener("mouseout", D, !0), document.addEventListener("click", B, !0), window.addEventListener("scroll", g, { capture: !0, passive: !0 }), window.addEventListener("resize", g), () => {
512
- document.removeEventListener("mouseover", M, !0), document.removeEventListener("mouseout", D, !0), document.removeEventListener("click", B, !0), window.removeEventListener("scroll", g, { capture: !0 }), window.removeEventListener("resize", g);
513
- for (const v of b) ne(v);
514
- };
515
- }, [n]);
516
- const S = a?.jeton;
517
- if (X(() => {
518
- S != null && (l.current?.focus(), l.current?.select());
519
- }, [S]), !a) return null;
520
- const N = (b) => c((M) => M && M.jeton === b ? null : M);
521
- async function I(b) {
522
- if (r.current === b.jeton || u.current === b.jeton) return;
523
- const M = b.info.valeur == null ? "" : String(b.info.valeur);
524
- if (b.texte.trim() === M.trim()) {
525
- N(b.jeton);
526
- return;
527
- }
528
- const D = Ie(b.info.type, b.texte);
529
- if (!D.ok) {
530
- c((g) => g && g.jeton === b.jeton ? { ...g, erreur: D.erreur } : g);
531
- return;
532
- }
533
- c((g) => g && g.jeton === b.jeton ? { ...g, envoi: !0, erreur: null } : g), r.current = b.jeton;
534
- let B = !1;
535
- try {
536
- B = await A.current.enregistrer(b.blockType, b.champ, D.valeur);
537
- } finally {
538
- r.current = null;
539
- }
540
- B ? N(b.jeton) : c(
541
- (g) => g && g.jeton === b.jeton ? { ...g, envoi: !1, erreur: "Enregistrement impossible — la valeur en ligne n'a pas changé." } : g
542
- );
543
- }
544
- const L = Math.max(a.rect.width + 40, 110);
545
- return /* @__PURE__ */ x(
546
- "form",
547
- {
548
- className: "saisie",
549
- style: { top: a.rect.top - 28, left: a.rect.left - 8 },
550
- onSubmit: (b) => {
551
- b.preventDefault(), I(a);
552
- },
553
- children: [
554
- /* @__PURE__ */ t("span", { className: "saisie__libelle", children: a.info.libelle }),
555
- /* @__PURE__ */ t(
556
- "input",
557
- {
558
- ref: l,
559
- className: "saisie__champ",
560
- style: { ...a.police, width: L },
561
- value: a.texte,
562
- inputMode: a.info.type === "number" ? "decimal" : void 0,
563
- disabled: a.envoi,
564
- "aria-label": a.info.libelle,
565
- onChange: (b) => {
566
- const M = b.target.value;
567
- c((D) => D && { ...D, texte: M, erreur: null });
568
- },
569
- onKeyDown: (b) => {
570
- if (b.key === "Enter") {
571
- b.preventDefault(), I(a);
572
- return;
573
- }
574
- b.key === "Escape" && (b.preventDefault(), u.current = a.jeton, N(a.jeton));
575
- },
576
- onBlur: () => {
577
- I(a);
578
- }
579
- }
580
- ),
581
- a.erreur ? /* @__PURE__ */ t("span", { className: "saisie__erreur", children: a.erreur }) : /* @__PURE__ */ t("span", { className: "saisie__aide", children: "Entrée pour enregistrer · Échap pour annuler" })
582
- ]
583
- }
584
- );
585
- }
586
- const Be = ["lystech-editeur-hote", "lystech-connexion-hote"];
587
- function qe(n, e) {
588
- const o = /* @__PURE__ */ new Map();
589
- for (const [s, a] of Object.entries(n))
590
- for (const [c, l] of Object.entries(a)) {
591
- const y = String(l ?? "").trim();
592
- if (y.length < 2 || y.includes("{{")) continue;
593
- const r = e(s, c);
594
- if (r <= 0) continue;
595
- const u = o.get(y);
596
- u ? u.push({ ns: s, chemin: c, rang: r }) : o.set(y, [{ ns: s, chemin: c, rang: r }]);
597
- }
598
- return o;
599
- }
600
- function Ue(n) {
601
- const e = /* @__PURE__ */ new Map(), o = document.body.querySelectorAll("*");
602
- for (const s of o) {
603
- if (Be.some((l) => s.id === l || s.closest("#" + l)) || s.closest("." + pe) || s.closest("[data-lystech-champ]") || s.children.length > 0) continue;
604
- const a = (s.textContent ?? "").trim();
605
- if (a.length < 2) continue;
606
- const c = n.get(a);
607
- c && e.set(s, { valeur: a, candidats: c });
608
- }
609
- return e;
610
- }
611
- function je({
612
- source: n,
613
- actif: e,
614
- pertinence: o,
615
- surModification: s
616
- }) {
617
- const a = Q(/* @__PURE__ */ new Map()), c = Q(null), [l, y] = q(null), r = Q(n);
618
- r.current = n;
619
- const u = Q(s);
620
- u.current = s;
621
- const A = Q(o);
622
- A.current = o;
623
- const S = Q(null);
624
- return X(() => {
625
- if (!e) return;
626
- const N = () => {
627
- const d = r.current, p = qe(
628
- d.dictionnaire(d.langueCourante()),
629
- A.current
630
- );
631
- a.current = Ue(p);
632
- };
633
- S.current = N, N();
634
- let I;
635
- const L = new MutationObserver(() => {
636
- c.current || (clearTimeout(I), I = setTimeout(N, 250));
637
- });
638
- L.observe(document.body, { childList: !0, subtree: !0 });
639
- const b = "outline:2px dashed rgba(59,165,141,.85);outline-offset:3px;border-radius:3px;cursor:text;", M = (d) => {
640
- const p = d.target;
641
- !(p instanceof HTMLElement) || c.current || a.current.has(p) && (p.dataset.lysStyleAvant || (p.dataset.lysStyleAvant = p.getAttribute("style") ?? ""), p.setAttribute(
642
- "style",
643
- (p.dataset.lysStyleAvant ?? "") + b
644
- ));
645
- }, D = (d) => {
646
- const p = d.target;
647
- if (!(p instanceof HTMLElement) || c.current?.el === p || p.dataset.lysStyleAvant === void 0) return;
648
- const w = p.dataset.lysStyleAvant;
649
- delete p.dataset.lysStyleAvant, w ? p.setAttribute("style", w) : p.removeAttribute("style");
650
- }, B = (d, p) => {
651
- const w = d.getAttribute("style") ?? "";
652
- c.current = {
653
- el: d,
654
- avant: (d.textContent ?? "").trim(),
655
- ns: p.ns,
656
- chemin: p.chemin,
657
- styleAvant: d.dataset.lysStyleAvant ?? w
658
- }, d.setAttribute("contenteditable", "plaintext-only"), d.setAttribute(
659
- "style",
660
- (d.dataset.lysStyleAvant ?? "") + "outline:2px solid #3ba58d;outline-offset:3px;border-radius:3px;"
661
- ), d.focus();
662
- const F = window.getSelection(), U = document.createRange();
663
- U.selectNodeContents(d), F?.removeAllRanges(), F?.addRange(U);
664
- }, g = async (d) => {
665
- const p = c.current;
666
- if (!p) return;
667
- c.current = null;
668
- const w = (p.el.textContent ?? "").trim();
669
- p.el.removeAttribute("contenteditable");
670
- const F = p.el.dataset.lysStyleAvant;
671
- if (delete p.el.dataset.lysStyleAvant, F ? p.el.setAttribute("style", F) : p.el.removeAttribute("style"), d || w === p.avant) {
672
- d && (p.el.textContent = p.avant);
673
- return;
674
- }
675
- const U = r.current.langueCourante();
676
- r.current.poser(U, p.ns, p.chemin, w), await u.current(p.ns, p.chemin, U, w);
677
- }, v = (d) => {
678
- const p = d.target;
679
- if (!(p instanceof HTMLElement)) return;
680
- if (c.current) {
681
- if (c.current.el === p) return;
682
- g(!1);
683
- }
684
- const w = a.current.get(p);
685
- if (!w) return;
686
- d.preventDefault(), d.stopPropagation();
687
- const F = Math.max(...w.candidats.map((Z) => Z.rang)), U = w.candidats.filter((Z) => Z.rang === F);
688
- if (U.length === 1) {
689
- B(p, U[0]);
690
- return;
691
- }
692
- y({
693
- el: p,
694
- candidats: U,
695
- x: d.clientX,
696
- y: d.clientY
697
- });
698
- }, h = (d) => {
699
- c.current && (d.key === "Escape" ? (d.preventDefault(), g(!0)) : d.key === "Enter" && !d.shiftKey && (d.preventDefault(), g(!1)));
700
- }, z = () => {
701
- c.current && g(!1);
702
- };
703
- document.addEventListener("mouseover", M, !0), document.addEventListener("mouseout", D, !0), document.addEventListener("click", v, !0);
704
- const R = (d) => {
705
- if (!c.current) return;
706
- const p = d.inputType;
707
- (p === "insertParagraph" || p === "insertLineBreak") && (d.preventDefault(), g(!1));
708
- };
709
- return document.addEventListener("beforeinput", R, !0), document.addEventListener("keydown", h, !0), document.addEventListener("focusout", z, !0), window.__lysChoisir = (d, p) => {
710
- y(null), B(p, d);
711
- }, () => {
712
- S.current = null, clearTimeout(I), L.disconnect(), document.removeEventListener("mouseover", M, !0), document.removeEventListener("mouseout", D, !0), document.removeEventListener("click", v, !0), document.removeEventListener("beforeinput", R, !0), document.removeEventListener("keydown", h, !0), document.removeEventListener("focusout", z, !0), c.current && g(!0), delete window.__lysChoisir;
713
- };
714
- }, [e]), X(() => {
715
- c.current || S.current?.();
716
- }, [o]), l ? /* @__PURE__ */ x(
717
- "div",
718
- {
719
- className: "choix",
720
- style: {
721
- top: Math.min(l.y + 10, window.innerHeight - 200),
722
- left: Math.min(l.x, window.innerWidth - 280)
723
- },
724
- children: [
725
- /* @__PURE__ */ t("p", { className: "choix__titre", children: "Ce texte apparaît à plusieurs endroits." }),
726
- /* @__PURE__ */ t("p", { className: "choix__aide", children: "Lequel corrigez-vous ?" }),
727
- l.candidats.map((N) => /* @__PURE__ */ x(
728
- "button",
729
- {
730
- type: "button",
731
- className: "choix__option",
732
- onClick: () => window.__lysChoisir?.(N, l.el),
733
- children: [
734
- /* @__PURE__ */ t("span", { className: "choix__chemin", children: N.chemin }),
735
- /* @__PURE__ */ t("span", { className: "choix__ns", children: N.ns })
736
- ]
737
- },
738
- N.ns + ":" + N.chemin
739
- )),
740
- /* @__PURE__ */ t(
741
- "button",
742
- {
743
- type: "button",
744
- className: "bouton bouton--discret",
745
- onClick: () => y(null),
746
- children: "Annuler"
747
- }
748
- )
749
- ]
750
- }
751
- ) : null;
752
- }
753
- const H = /^i18n:([^:]+):(.*)$/, re = "commun", oe = "lystech-edit-mode";
754
- function le(n, e) {
755
- return JSON.stringify(n ?? {}) === JSON.stringify(e ?? {});
756
- }
757
- function Qe({ api: n, pont: e }) {
758
- const [o, s] = q([]), [a, c] = q([]), [l, y] = q(e.page), [r, u] = q(null), [A, S] = q({}), [N, I] = q(!1), [L, b] = q(() => {
759
- try {
760
- return window.localStorage.getItem(oe) === "circuler" ? "circuler" : "modifier";
761
- } catch {
762
- return "modifier";
763
- }
764
- }), M = () => b((i) => {
765
- const f = i === "modifier" ? "circuler" : "modifier";
766
- try {
767
- window.localStorage.setItem(oe, f);
768
- } catch {
769
- }
770
- return f;
771
- }), [D, B] = q(!1), [g, v] = q(
772
- null
773
- );
774
- X(() => (e.surChangementDePage = (i) => {
775
- y(i), u(null), I(!1);
776
- }, () => {
777
- e.surChangementDePage = void 0;
778
- }), [e]);
779
- const h = Y(async () => {
780
- try {
781
- const [i, f] = await Promise.all([
782
- n.pourPage(l),
783
- l === re ? Promise.resolve([]) : n.pourPage(re)
784
- ]), m = [...i, ...f];
785
- return c(m), m;
786
- } catch {
787
- return v({
788
- ton: "erreur",
789
- texte: "Impossible de lire le contenu du site."
790
- }), [];
791
- }
792
- }, [n, l]);
793
- X(() => {
794
- n.schemas().then(s).catch(() => s([]));
795
- }, [n]), X(() => {
796
- h();
797
- }, [h]);
798
- const z = Y(
799
- (i, f) => {
800
- let m = null, k = -1;
801
- for (const O of o) {
802
- const C = H.exec(O.blockType);
803
- if (!C || C[1] !== i) continue;
804
- const E = C[2];
805
- (E === "" || f === E || f.startsWith(E + ".")) && E.length > k && (m = O, k = E.length);
806
- }
807
- if (!m) return null;
808
- const T = H.exec(m.blockType)?.[2] ?? "", _ = T ? f.slice(T.length + 1) : f;
809
- return { bloc: m, champ: _ };
810
- },
811
- [o]
812
- ), R = Y(
813
- (i, f) => {
814
- const m = z(i, f);
815
- return m ? (m.bloc.pages ?? []).includes(l) ? 2 : 1 : 0;
816
- },
817
- [z, l]
818
- ), d = Y(
819
- (i) => o.find((f) => f.blockType === i),
820
- [o]
821
- ), p = se(
822
- () => o.filter((i) => {
823
- const f = i.pages ?? [];
824
- return f.includes(l) || f.includes(re);
825
- }),
826
- [o, l]
827
- ), w = se(
828
- () => a.filter((i) => i.draft && !le(i.draft, i.data)),
829
- [a]
830
- );
831
- X(() => {
832
- if (w.length === 0) return;
833
- for (const m of w)
834
- H.test(m.blockType) || e.poserApercu(m.blockType, m.draft);
835
- const i = w.filter((m) => H.test(m.blockType)), f = e.sourceTexte;
836
- i.length && f && import("./morceaux/sourceTexte-BMPMpNg9.js").then(
837
- ({ appliquerAuxTextes: m }) => m(
838
- i.map((k) => ({ blockType: k.blockType, data: k.draft })),
839
- f
840
- )
841
- );
842
- }, [w, e]);
843
- const F = Y(
844
- async (i, f, m, k) => {
845
- const T = z(i, f);
846
- if (!T) {
847
- v({
848
- ton: "erreur",
849
- texte: `Ce texte (${i}:${f}) n'appartient à aucun bloc déclaré.`
850
- });
851
- return;
852
- }
853
- const _ = a.find((P) => P.blockType === T.bloc.blockType), O = _?.draft ?? _?.data ?? {}, C = O[T.champ], E = T.bloc.fields.find((P) => P.key === T.champ), j = (
854
- /* `!declare.localized` et non `=== false` : un champ non traduit
855
- OMET la cle plutot que de la mettre a faux. Tester l'egalite
856
- stricte ne se declenchait donc jamais. */
857
- E && !E.localized ? k : C && typeof C == "object" && !Array.isArray(C) ? { ...C, [m]: k } : { [m]: k }
858
- ), V = { ...O, [T.champ]: j };
859
- try {
860
- if (_?.UID)
861
- await n.enregistrerBrouillon(_.UID, V);
862
- else {
863
- const P = T.bloc.pages?.[0] ?? l;
864
- await n.creer(P, T.bloc.blockType, V);
865
- }
866
- await h(), v(null);
867
- } catch {
868
- v({
869
- ton: "erreur",
870
- texte: "Enregistrement impossible. Votre texte est toujours à l'écran."
871
- });
872
- }
873
- },
874
- [n, z, l, h, a]
875
- ), U = Y(
876
- (i, f) => {
877
- const m = d(i), k = m?.fields.find((E) => E.key === f);
878
- if (!m || !k) return null;
879
- const T = a.find((E) => E.blockType === i);
880
- let C = {
881
- ...e.replis?.[i] ?? {},
882
- ...T?.data ?? {},
883
- ...T?.draft ?? {}
884
- }[f];
885
- return k.localized && C && typeof C == "object" && !Array.isArray(C) && (C = C[e.langue]), { libelle: k.label, type: k.type, valeur: C };
886
- },
887
- [d, a, e]
888
- ), Z = Y(
889
- async (i, f, m) => {
890
- const k = d(i), T = k?.fields.find((P) => P.key === f);
891
- if (!k || !T) return !1;
892
- const _ = a.find((P) => P.blockType === i), C = {
893
- ...e.replis?.[i] ?? {},
894
- ..._?.data ?? {},
895
- ..._?.draft ?? {}
896
- }, E = C[f], j = T.localized ? {
897
- ...E && typeof E == "object" && !Array.isArray(E) ? E : {},
898
- [e.langue]: m
899
- } : m, V = { ...C, [f]: j };
900
- try {
901
- return _?.UID ? await n.enregistrerBrouillon(_.UID, V) : await n.creer(k.pages?.[0] ?? l, i, V), await h(), e.poserApercu(i, V), v(null), !0;
902
- } catch {
903
- return v({
904
- ton: "erreur",
905
- texte: "Enregistrement impossible. La valeur en ligne n'a pas changé."
906
- }), !1;
907
- }
908
- },
909
- [n, l, e, h, d, a]
910
- ), xe = async () => {
911
- if (!w.length) return;
912
- B(!0), v(null);
913
- const i = w.length;
914
- try {
915
- for (const f of w) await n.publier(f.UID);
916
- await h();
917
- for (const f of w) e.poserApercu(f.blockType, null);
918
- e.recharger(), v({
919
- ton: "ok",
920
- texte: i === 1 ? "Publié. Vos visiteurs le voient maintenant." : `${i} modifications publiées.`
921
- });
922
- } catch {
923
- v({
924
- ton: "erreur",
925
- texte: "La publication a échoué. Rien n'a été mis en ligne."
926
- });
927
- } finally {
928
- B(!1);
929
- }
930
- }, ve = async () => {
931
- B(!0);
932
- try {
933
- const i = w.map((m) => m.blockType);
934
- for (const m of w) await n.annuler(m.UID);
935
- const f = await h();
936
- for (const m of i) e.poserApercu(m, null);
937
- if (e.sourceTexte) {
938
- const { appliquerAuxTextes: m } = await import("./morceaux/sourceTexte-BMPMpNg9.js");
939
- m(
940
- f.map((k) => ({ blockType: k.blockType, data: k.data })),
941
- e.sourceTexte
942
- );
943
- }
944
- v({
945
- ton: "info",
946
- texte: "Modifications abandonnées. On est revenu à ce qui est en ligne."
947
- });
948
- } finally {
949
- B(!1);
950
- }
951
- }, ae = (i) => {
952
- const f = a.find((O) => O.blockType === i), m = f?.draft ?? f?.data ?? {}, k = d(i), T = H.exec(i), _ = {};
953
- if (!T) {
954
- const O = e.replis?.[i];
955
- O && typeof O == "object" && !Array.isArray(O) && Object.assign(_, O);
956
- }
957
- if (T && k && e.sourceTexte) {
958
- const O = T[1], C = T[2], E = e.sourceTexte.langues(), j = {};
959
- for (const P of E)
960
- j[P] = e.sourceTexte.dictionnaire(P)[O] ?? {};
961
- const V = e.sourceTexte.langueCourante();
962
- for (const P of k.fields) {
963
- const $ = C ? C + "." + P.key : P.key;
964
- if (!P.localized) {
965
- const J = j[V]?.[$] ?? E.map((G) => j[G]?.[$]).find((G) => typeof G == "string");
966
- typeof J == "string" && (_[P.key] = J);
967
- continue;
968
- }
969
- const ee = {};
970
- for (const J of E) {
971
- const G = j[J]?.[$];
972
- typeof G == "string" && (ee[J] = G);
973
- }
974
- Object.keys(ee).length && (_[P.key] = ee);
975
- }
976
- }
977
- for (const [O, C] of Object.entries(m)) {
978
- const E = _[O], j = C && typeof C == "object" && !Array.isArray(C) && E && typeof E == "object" && !Array.isArray(E);
979
- _[O] = j ? { ...E, ...C } : C;
980
- }
981
- S(_), u(i), I(!1), v(null);
982
- }, ye = (i, f) => S((m) => ({ ...m, [i]: f })), Ae = async () => {
983
- if (r) {
984
- B(!0);
985
- try {
986
- const i = a.find((m) => m.blockType === r);
987
- if (i?.UID) await n.enregistrerBrouillon(i.UID, A);
988
- else {
989
- const m = d(r)?.pages?.[0] ?? l;
990
- await n.creer(m, r, A);
991
- }
992
- const f = await h();
993
- if (e.sourceTexte) {
994
- const { appliquerAuxTextes: m } = await import("./morceaux/sourceTexte-BMPMpNg9.js");
995
- m(
996
- f.map((k) => ({ blockType: k.blockType, data: k.draft ?? k.data })),
997
- e.sourceTexte
998
- );
999
- }
1000
- H.test(r) || e.poserApercu(r, A), v({
1001
- ton: "ok",
1002
- texte: "Enregistré. Rien n'a encore changé pour vos visiteurs."
1003
- });
1004
- } catch {
1005
- v({ ton: "erreur", texte: "L'enregistrement a échoué." });
1006
- } finally {
1007
- B(!1);
1008
- }
1009
- }
1010
- }, ke = () => {
1011
- try {
1012
- window.localStorage.removeItem(oe);
1013
- } catch {
1014
- }
1015
- fe();
1016
- }, W = r ? d(r) : void 0, K = !r && !N;
1017
- return /* @__PURE__ */ x("div", { className: "calque", children: [
1018
- /* @__PURE__ */ t(
1019
- "div",
1020
- {
1021
- className: "cadre-global" + (L === "circuler" ? " cadre-global--circuler" : ""),
1022
- "aria-hidden": "true"
1023
- }
1024
- ),
1025
- e.sourceTexte && /* @__PURE__ */ t(
1026
- je,
1027
- {
1028
- source: e.sourceTexte,
1029
- actif: K && !D && L === "modifier",
1030
- pertinence: R,
1031
- surModification: F
1032
- }
1033
- ),
1034
- /* @__PURE__ */ t(
1035
- Me,
1036
- {
1037
- actif: K && !D && L === "modifier",
1038
- lire: U,
1039
- enregistrer: Z,
1040
- ouvrirPanneau: ae
1041
- }
1042
- ),
1043
- K && /* @__PURE__ */ x("div", { className: "barre", children: [
1044
- /* @__PURE__ */ t("span", { className: "barre__point" }),
1045
- /* @__PURE__ */ t("span", { className: "barre__texte", children: L === "modifier" ? "Cliquez un texte pour le corriger" : "Navigation libre — les clics ouvrent les liens" }),
1046
- /* @__PURE__ */ t(
1047
- "button",
1048
- {
1049
- type: "button",
1050
- className: "bouton " + (L === "circuler" ? "bouton--principal" : ""),
1051
- onClick: M,
1052
- title: L === "modifier" ? "Passer en navigation pour changer de page" : "Revenir a la modification des textes",
1053
- children: L === "modifier" ? "Circuler" : "Modifier"
1054
- }
1055
- ),
1056
- w.length > 0 ? /* @__PURE__ */ x(ue, { children: [
1057
- /* @__PURE__ */ t("span", { className: "barre__compte", children: w.length === 1 ? "1 modification non publiée" : `${w.length} modifications non publiées` }),
1058
- /* @__PURE__ */ t(
1059
- "button",
1060
- {
1061
- type: "button",
1062
- className: "bouton bouton--principal",
1063
- onClick: xe,
1064
- disabled: D,
1065
- children: "Publier"
1066
- }
1067
- ),
1068
- /* @__PURE__ */ t(
1069
- "button",
1070
- {
1071
- type: "button",
1072
- className: "bouton bouton--discret",
1073
- onClick: ve,
1074
- disabled: D,
1075
- children: "Abandonner"
1076
- }
1077
- )
1078
- ] }) : /* @__PURE__ */ t("span", { className: "barre__compte", children: "tout est publié" }),
1079
- /* @__PURE__ */ t(
1080
- "button",
1081
- {
1082
- type: "button",
1083
- className: "bouton bouton--icone bouton--discret",
1084
- onClick: () => I(!0),
1085
- title: "Tous les contenus",
1086
- "aria-label": "Tous les contenus",
1087
- children: "⋮"
1088
- }
1089
- ),
1090
- /* @__PURE__ */ t(
1091
- "button",
1092
- {
1093
- type: "button",
1094
- className: "bouton bouton--icone bouton--sortie",
1095
- onClick: ke,
1096
- title: "Quitter le mode édition",
1097
- "aria-label": "Quitter le mode édition",
1098
- children: "✕"
1099
- }
1100
- )
1101
- ] }),
1102
- g && K && /* @__PURE__ */ t("div", { className: "flottant", children: /* @__PURE__ */ t("p", { className: "message message--" + g.ton, children: g.texte }) }),
1103
- N && /* @__PURE__ */ x("div", { className: "panneau", role: "dialog", "aria-label": "Tous les contenus", children: [
1104
- /* @__PURE__ */ x("div", { className: "panneau__tete", children: [
1105
- /* @__PURE__ */ x("div", { style: { flex: 1 }, children: [
1106
- /* @__PURE__ */ t("h2", { className: "panneau__titre", children: "Tous les contenus" }),
1107
- /* @__PURE__ */ t("p", { className: "panneau__sous", children: "Y compris ce qui ne s'affiche pas dans la page : titre de l'onglet, description dans les moteurs de recherche, textes contenant une valeur calculée." })
1108
- ] }),
1109
- /* @__PURE__ */ t(
1110
- "button",
1111
- {
1112
- type: "button",
1113
- className: "bouton bouton--icone bouton--discret",
1114
- onClick: () => I(!1),
1115
- "aria-label": "Fermer",
1116
- children: "✕"
1117
- }
1118
- )
1119
- ] }),
1120
- /* @__PURE__ */ x("div", { className: "panneau__corps", children: [
1121
- p.length === 0 && /* @__PURE__ */ t("p", { className: "message message--info", children: "Aucun contenu déclaré pour cette page." }),
1122
- p.map((i) => {
1123
- const f = a.find((k) => k.blockType === i.blockType), m = f?.draft && !le(f.draft, f.data);
1124
- return /* @__PURE__ */ x(
1125
- "button",
1126
- {
1127
- type: "button",
1128
- className: "rangee",
1129
- onClick: () => ae(i.blockType),
1130
- children: [
1131
- /* @__PURE__ */ t("span", { className: "rangee__nom", children: i.label }),
1132
- /* @__PURE__ */ t("span", { className: "rangee__info", children: m ? "non publié" : `${i.fields.length} textes` })
1133
- ]
1134
- },
1135
- i.blockType
1136
- );
1137
- })
1138
- ] })
1139
- ] }),
1140
- r && W && /* @__PURE__ */ x(
1141
- "div",
1142
- {
1143
- className: "panneau",
1144
- role: "dialog",
1145
- "aria-label": "Modifier " + W.label,
1146
- children: [
1147
- /* @__PURE__ */ x("div", { className: "panneau__tete", children: [
1148
- /* @__PURE__ */ x("div", { style: { flex: 1 }, children: [
1149
- /* @__PURE__ */ t("h2", { className: "panneau__titre", children: W.label }),
1150
- W.description && /* @__PURE__ */ t("p", { className: "panneau__sous", children: W.description })
1151
- ] }),
1152
- /* @__PURE__ */ t(
1153
- "button",
1154
- {
1155
- type: "button",
1156
- className: "bouton bouton--icone bouton--discret",
1157
- onClick: () => u(null),
1158
- "aria-label": "Fermer",
1159
- children: "✕"
1160
- }
1161
- )
1162
- ] }),
1163
- /* @__PURE__ */ x("div", { className: "panneau__corps", children: [
1164
- g && /* @__PURE__ */ t("p", { className: "message message--" + g.ton, children: g.texte }),
1165
- W.fields.map((i) => /* @__PURE__ */ t(
1166
- me,
1167
- {
1168
- champ: i,
1169
- langue: e.langue,
1170
- valeur: A[i.key],
1171
- changer: (f) => ye(i.key, f)
1172
- },
1173
- i.key
1174
- ))
1175
- ] }),
1176
- /* @__PURE__ */ x("div", { className: "panneau__pied", children: [
1177
- /* @__PURE__ */ t(
1178
- "button",
1179
- {
1180
- type: "button",
1181
- className: "bouton bouton--discret",
1182
- onClick: () => u(null),
1183
- disabled: D,
1184
- children: "Fermer"
1185
- }
1186
- ),
1187
- /* @__PURE__ */ t("span", { className: "espace" }),
1188
- /* @__PURE__ */ t(
1189
- "button",
1190
- {
1191
- type: "button",
1192
- className: "bouton bouton--principal",
1193
- onClick: Ae,
1194
- disabled: D,
1195
- children: "Enregistrer"
1196
- }
1197
- )
1198
- ] })
1199
- ]
1200
- }
1201
- )
1202
- ] });
1203
- }
1204
- const Re = `
1205
- :host {
1206
- all: initial;
1207
- --fond: #16181d;
1208
- --fond-clair: #21242b;
1209
- --bord: #333844;
1210
- --texte: #f2f3f5;
1211
- --texte-doux: #a3a9b6;
1212
- --accent: #3ba58d;
1213
- --accent-sombre: #2d8570;
1214
- --danger: #d9776a;
1215
- font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
1216
- "Helvetica Neue", Arial, sans-serif;
1217
- font-size: 14px;
1218
- line-height: 1.45;
1219
- color: var(--texte);
1220
- }
1221
-
1222
- * { box-sizing: border-box; }
1223
-
1224
- /* LE CALQUE LAISSE PASSER LES CLICS. Un conteneur fixe en plein écran qui
1225
- intercepte tout rendrait le site inutilisable derrière lui : on ne pourrait
1226
- plus naviguer, ni même faire défiler correctement. Seuls ses ENFANTS
1227
- reprennent les clics. */
1228
- .calque {
1229
- position: fixed;
1230
- inset: 0;
1231
- pointer-events: none;
1232
- z-index: 2147483000;
1233
- }
1234
- .calque > * { pointer-events: auto; }
1235
-
1236
- /* ---------------------------------------------------------- CADRES ------ */
1237
-
1238
- .cadre {
1239
- position: fixed;
1240
- border: 2px dashed rgba(59, 165, 141, 0.55);
1241
- border-radius: 6px;
1242
- pointer-events: none;
1243
- transition: border-color 120ms ease;
1244
- }
1245
- .cadre--actif { border-color: var(--accent); border-style: solid; }
1246
-
1247
- .pastille {
1248
- position: fixed;
1249
- display: inline-flex;
1250
- align-items: center;
1251
- gap: 6px;
1252
- padding: 5px 10px;
1253
- border: 0;
1254
- border-radius: 999px;
1255
- background: var(--accent);
1256
- color: #06120e;
1257
- font-size: 12px;
1258
- font-weight: 650;
1259
- letter-spacing: 0.01em;
1260
- cursor: pointer;
1261
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
1262
- }
1263
- .pastille:hover { background: #45bda2; }
1264
- .pastille:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
1265
-
1266
- /* ------------------------------------------------------------ BARRE ----- */
1267
-
1268
- .barre {
1269
- position: fixed;
1270
- left: 50%;
1271
- bottom: 18px;
1272
- transform: translateX(-50%);
1273
- display: flex;
1274
- align-items: center;
1275
- gap: 14px;
1276
- padding: 9px 14px;
1277
- border: 1px solid var(--bord);
1278
- border-radius: 999px;
1279
- background: var(--fond);
1280
- box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
1281
- max-width: calc(100vw - 24px);
1282
- }
1283
- .barre__point {
1284
- width: 8px; height: 8px; border-radius: 50%;
1285
- background: var(--accent);
1286
- flex: none;
1287
- }
1288
- .barre__texte { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1289
- .barre__texte b { font-weight: 650; }
1290
- .barre__compte { color: var(--texte-doux); font-size: 12px; white-space: nowrap; }
1291
-
1292
- /* ----------------------------------------------------------- PANNEAU ---- */
1293
-
1294
- .panneau {
1295
- position: fixed;
1296
- top: 0; right: 0; bottom: 0;
1297
- width: min(420px, 100vw);
1298
- display: flex;
1299
- flex-direction: column;
1300
- background: var(--fond);
1301
- border-left: 1px solid var(--bord);
1302
- box-shadow: -12px 0 40px rgba(0, 0, 0, 0.4);
1303
- }
1304
- @media (max-width: 520px) {
1305
- .panneau { top: auto; height: 78vh; border-left: 0; border-top: 1px solid var(--bord); }
1306
- }
1307
-
1308
- .panneau__tete {
1309
- display: flex; align-items: flex-start; gap: 10px;
1310
- padding: 16px 16px 12px;
1311
- border-bottom: 1px solid var(--bord);
1312
- }
1313
- .panneau__titre { font-size: 15px; font-weight: 650; margin: 0; }
1314
- .panneau__sous { margin: 3px 0 0; font-size: 12px; color: var(--texte-doux); }
1315
- .panneau__corps { flex: 1; overflow-y: auto; padding: 14px 16px 18px; }
1316
- .panneau__pied {
1317
- display: flex; gap: 8px; align-items: center;
1318
- padding: 12px 16px;
1319
- border-top: 1px solid var(--bord);
1320
- background: var(--fond-clair);
1321
- }
1322
- .panneau__pied .espace { flex: 1; }
1323
-
1324
- /* --------------------------------------------------- CONNEXION ---------- */
1325
-
1326
- /* LA CONNEXION EST CLAIRE, AUX COULEURS DE LYSTECH. L'éditeur reste un outil
1327
- sombre qui s'efface derrière le travail ; la connexion, elle, est l'instant
1328
- où quelqu'un décide de faire confiance. Il doit y reconnaître Lystech — la
1329
- fleur, son pétrole et son turquoise, sur du blanc — et non une boîte noire
1330
- posée sur son site.
1331
-
1332
- Le thème se redéfinit ICI, sur le voile : les boutons, messages et champs
1333
- partagés avec l'éditeur suivent ces variables sans une règle de plus, et
1334
- l'éditeur garde les siennes. Clair quel que soit le thème du système :
1335
- c'est un choix de marque. */
1336
- .voile {
1337
- --fond: #ffffff;
1338
- --fond-clair: #f4f7f8;
1339
- --bord: #dfe6e9;
1340
- --texte: #0b1f26;
1341
- --texte-doux: #52666f;
1342
- --petrole: #084050;
1343
- --petrole-survol: #0b5468;
1344
- --turquoise: #10b8b0;
1345
- --focus: #0c8f89;
1346
-
1347
- position: fixed;
1348
- inset: 0;
1349
- display: flex;
1350
- align-items: center;
1351
- justify-content: center;
1352
- padding: 16px;
1353
- /* Le voile PREND les clics, lui : une boîte de dialogue qui demande une
1354
- identité ne doit pas laisser cliquer la page derrière elle. C'est
1355
- l'exception à la règle du calque, et elle est volontaire. Teinté pétrole
1356
- plutôt que noir : on assombrit le site sans l'éteindre. */
1357
- background: rgba(8, 44, 56, 0.34);
1358
- backdrop-filter: blur(4px) saturate(115%);
1359
- color: var(--texte);
1360
- }
1361
-
1362
- .fenetre {
1363
- position: relative;
1364
- width: min(400px, 100%);
1365
- max-height: 92vh;
1366
- overflow-y: auto;
1367
- padding: 34px 30px 26px;
1368
- border: 1px solid rgba(8, 64, 80, 0.10);
1369
- border-radius: 20px;
1370
- /* La lueur turquoise de la fleur, à peine, en haut de la carte. */
1371
- background:
1372
- radial-gradient(90% 60% at 50% -12%, rgba(16, 184, 176, 0.13), transparent 70%),
1373
- var(--fond);
1374
- box-shadow:
1375
- 0 1px 2px rgba(8, 64, 80, 0.06),
1376
- 0 28px 64px -18px rgba(8, 44, 56, 0.45);
1377
- text-align: center;
1378
- }
1379
-
1380
- .fenetre__fermer {
1381
- position: absolute; top: 14px; right: 14px;
1382
- width: 32px; height: 32px;
1383
- display: inline-flex; align-items: center; justify-content: center;
1384
- border: 0; border-radius: 9px;
1385
- background: transparent; color: var(--texte-doux);
1386
- font: inherit; font-size: 14px; cursor: pointer;
1387
- }
1388
- .fenetre__fermer:hover { background: var(--fond-clair); color: var(--texte); }
1389
- .fenetre__fermer:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
1390
-
1391
- /* ------------------------------------------------------------ MARQUE ---- */
1392
-
1393
- .marque {
1394
- display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
1395
- margin-bottom: 18px;
1396
- }
1397
- .marque img {
1398
- width: 44px; height: 44px; display: block;
1399
- filter: drop-shadow(0 6px 14px rgba(16, 184, 176, 0.28));
1400
- }
1401
- .marque__mot {
1402
- font-size: 11.5px; font-weight: 700;
1403
- letter-spacing: 0.24em; text-transform: uppercase;
1404
- color: var(--petrole);
1405
- }
1406
-
1407
- .fenetre__titre {
1408
- margin: 0 0 8px;
1409
- font-size: 21px; font-weight: 700; letter-spacing: -0.015em;
1410
- color: var(--texte);
1411
- text-wrap: balance;
1412
- }
1413
- .fenetre__sous {
1414
- margin: 0 auto 24px;
1415
- max-width: 36ch;
1416
- font-size: 13.5px; line-height: 1.55; color: var(--texte-doux);
1417
- text-wrap: balance;
1418
- }
1419
- .fenetre__corps { text-align: left; }
1420
-
1421
- /* ------------------------------------------------------ FOURNISSEURS ---- */
1422
-
1423
- .fournisseurs { display: flex; flex-direction: column; gap: 10px; }
1424
-
1425
- .fournisseur {
1426
- display: flex; align-items: center; justify-content: center; gap: 10px;
1427
- width: 100%; min-height: 46px; padding: 12px 16px;
1428
- border: 1px solid transparent; border-radius: 12px;
1429
- font: inherit; font-size: 14px; font-weight: 600;
1430
- cursor: pointer;
1431
- transition: transform 90ms ease, background-color 120ms ease, box-shadow 120ms ease;
1432
- }
1433
- .fournisseur:active { transform: translateY(1px); }
1434
- .fournisseur:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
1435
- .fournisseur[disabled] { opacity: 0.55; cursor: default; transform: none; }
1436
- .fournisseur .logo { width: 18px; height: 18px; flex: none; display: block; }
1437
-
1438
- /* LES COULEURS DE CHAQUE MARQUE, telles qu'elles les publient. Un bouton
1439
- Google repeint aux couleurs du site devient moins reconnaissable — et un
1440
- bouton de connexion qu'on ne reconnaît pas est un bouton sur lequel on
1441
- hésite à cliquer. */
1442
- .fournisseur--google {
1443
- background: #fff; color: #1f1f1f; border-color: #dadce0;
1444
- box-shadow: 0 1px 2px rgba(8, 64, 80, 0.06);
1445
- }
1446
- .fournisseur--google:hover:not([disabled]) { background: #f6f9fa; border-color: #c9d3d8; }
1447
- .fournisseur--facebook { background: #1877f2; color: #fff; }
1448
- .fournisseur--facebook:hover:not([disabled]) { background: #166fe5; }
1449
-
1450
- .bouton--large { width: 100%; padding: 12px 16px; font-size: 14px; }
1451
-
1452
- /* Les boutons et messages PARTAGÉS avec l'éditeur, en version claire. */
1453
- .voile .bouton {
1454
- min-height: 44px; border-radius: 12px;
1455
- background: #fff; color: var(--texte); border-color: #cfd9dd;
1456
- }
1457
- .voile .bouton:hover { background: var(--fond-clair); }
1458
- .voile .bouton:focus-visible { outline-color: var(--focus); }
1459
- .voile .bouton--principal { background: var(--petrole); border-color: var(--petrole); color: #fff; }
1460
- .voile .bouton--principal:hover { background: var(--petrole-survol); }
1461
-
1462
- .voile .message { font-size: 13px; line-height: 1.5; border-radius: 10px; }
1463
- .voile .message--erreur { background: #fdf0ee; border-color: #f4c7bf; color: #a3321f; }
1464
- .voile .message--ok { background: #e8f7f5; border-color: #a9e2dc; color: #0a5c57; }
1465
- .voile .message--info { background: var(--fond-clair); border-color: var(--bord); color: #3a5159; }
1466
-
1467
- @media (prefers-reduced-motion: reduce) {
1468
- .fournisseur { transition: none; }
1469
- }
1470
-
1471
- /* ------------------------------------------------------------ CHAMPS ---- */
1472
-
1473
- .champ { margin-bottom: 16px; }
1474
- .champ__etiquette {
1475
- display: block; margin-bottom: 5px;
1476
- font-size: 12px; font-weight: 600; color: var(--texte);
1477
- }
1478
- .champ__aide { margin: 4px 0 0; font-size: 11.5px; color: var(--texte-doux); }
1479
- .champ__langue {
1480
- display: inline-block; margin: 0 0 4px;
1481
- font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
1482
- text-transform: uppercase; color: var(--texte-doux);
1483
- }
1484
-
1485
- /* TOUS les types de champs, pas seulement ceux auxquels on pensait. Un
1486
- type oublie — « password », « email » — retombe sur le style brut du
1487
- navigateur : une ligne blanche au milieu d'un panneau sombre. */
1488
- input[type="text"], input[type="url"], input[type="number"], input[type="date"],
1489
- input[type="password"], input[type="email"], input[type="tel"], input[type="search"],
1490
- select, textarea {
1491
- width: 100%;
1492
- padding: 8px 10px;
1493
- border: 1px solid var(--bord);
1494
- border-radius: 6px;
1495
- background: var(--fond-clair);
1496
- color: var(--texte);
1497
- font: inherit;
1498
- font-size: 13px;
1499
- }
1500
- textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
1501
- input:focus, select:focus, textarea:focus {
1502
- outline: none; border-color: var(--accent);
1503
- box-shadow: 0 0 0 3px rgba(59, 165, 141, 0.18);
1504
- }
1505
-
1506
- .bascule { display: flex; align-items: center; gap: 8px; }
1507
- .bascule input { width: 16px; height: 16px; accent-color: var(--accent); }
1508
-
1509
- .vignette {
1510
- margin-top: 8px; max-height: 110px; border-radius: 6px;
1511
- border: 1px solid var(--bord); display: block;
1512
- }
1513
-
1514
- /* --------------------------------------------------------- LISTES ------- */
1515
-
1516
- .liste__item {
1517
- border: 1px solid var(--bord); border-radius: 8px;
1518
- padding: 12px; margin-bottom: 10px; background: var(--fond-clair);
1519
- }
1520
- .liste__tete {
1521
- display: flex; align-items: center; justify-content: space-between;
1522
- margin-bottom: 8px;
1523
- }
1524
- .liste__rang { font-size: 11px; font-weight: 700; color: var(--texte-doux); }
1525
-
1526
- /* --------------------------------------------------------- BOUTONS ------ */
1527
-
1528
- .bouton {
1529
- display: inline-flex; align-items: center; justify-content: center; gap: 6px;
1530
- padding: 8px 14px; border-radius: 7px; border: 1px solid transparent;
1531
- font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
1532
- background: var(--fond-clair); color: var(--texte); border-color: var(--bord);
1533
- }
1534
- .bouton:hover { background: #2a2e37; }
1535
- .bouton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
1536
- .bouton--principal { background: var(--accent); border-color: var(--accent); color: #06120e; }
1537
- .bouton--principal:hover { background: #45bda2; }
1538
- .bouton--discret { background: transparent; border-color: transparent; color: var(--texte-doux); }
1539
- .bouton--discret:hover { background: var(--fond-clair); color: var(--texte); }
1540
- .bouton[disabled] { opacity: 0.5; cursor: default; }
1541
- .bouton--icone { padding: 6px 9px; }
1542
-
1543
- .message {
1544
- margin: 0 0 12px; padding: 9px 11px; border-radius: 7px;
1545
- font-size: 12.5px; border: 1px solid;
1546
- }
1547
- .message--erreur { background: rgba(217, 119, 106, 0.12); border-color: rgba(217, 119, 106, 0.4); color: #f0b3a9; }
1548
- .message--ok { background: rgba(59, 165, 141, 0.12); border-color: rgba(59, 165, 141, 0.4); color: #8fd9c6; }
1549
- .message--info { background: var(--fond-clair); border-color: var(--bord); color: var(--texte-doux); }
1550
-
1551
- @media (prefers-reduced-motion: reduce) {
1552
- * { transition: none !important; animation: none !important; }
1553
- }
1554
- `, Fe = `
1555
- /* --------------------------------------------------------- SAISIE ------- */
1556
-
1557
- /* Une valeur marquée par le site (un prix, un numéro) se corrige dans une
1558
- saisie posée EXACTEMENT dessus, dans la police de la page : on écrit là où
1559
- on lisait. Le libellé au-dessus dit quel champ on touche — « Séance
1560
- d'acupuncture », pas « seance ». */
1561
- .saisie {
1562
- position: fixed;
1563
- display: flex;
1564
- flex-direction: column;
1565
- align-items: flex-start;
1566
- gap: 4px;
1567
- }
1568
- .saisie__libelle,
1569
- .saisie__aide,
1570
- .saisie__erreur {
1571
- padding: 3px 8px;
1572
- border-radius: 6px;
1573
- font: 600 11px/1.35 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
1574
- white-space: nowrap;
1575
- }
1576
- .saisie__libelle { background: var(--fond); color: var(--texte); }
1577
- .saisie__aide { background: rgba(22, 24, 29, 0.82); color: var(--texte-doux); font-weight: 500; }
1578
- .saisie__erreur { background: #b3261e; color: #fff; }
1579
- .saisie__champ {
1580
- min-width: 0;
1581
- padding: 2px 8px;
1582
- border: 2px solid var(--accent);
1583
- border-radius: 6px;
1584
- background: #fff;
1585
- color: #111;
1586
- line-height: 1.2;
1587
- box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
1588
- outline: none;
1589
- }
1590
- .saisie__champ:focus { box-shadow: 0 0 0 3px rgba(59, 165, 141, 0.35), 0 10px 28px rgba(0, 0, 0, 0.28); }
1591
- .saisie__champ:disabled { opacity: 0.7; }
1592
-
1593
- /* --------------------------------------------------------- CHOIX -------- */
1594
-
1595
- /* Quand un meme texte vient de plusieurs cles, on demande laquelle plutot que
1596
- de deviner — et de modifier la mauvaise sans que personne le voie. */
1597
- .choix {
1598
- position: fixed;
1599
- width: 260px;
1600
- padding: 12px;
1601
- border: 1px solid var(--bord);
1602
- border-radius: 10px;
1603
- background: var(--fond);
1604
- box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
1605
- }
1606
- .choix__titre { margin: 0 0 2px; font-size: 12.5px; font-weight: 650; }
1607
- .choix__aide { margin: 0 0 10px; font-size: 11.5px; color: var(--texte-doux); }
1608
- .choix__option {
1609
- display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
1610
- width: 100%; margin-bottom: 6px; padding: 7px 9px;
1611
- border: 1px solid var(--bord); border-radius: 7px;
1612
- background: var(--fond-clair); color: var(--texte);
1613
- font: inherit; text-align: left; cursor: pointer;
1614
- }
1615
- .choix__option:hover { background: #2a2e37; border-color: var(--accent); }
1616
- .choix__chemin { font-size: 12px; font-weight: 600; }
1617
- .choix__ns { font-size: 10.5px; color: var(--texte-doux); }
1618
-
1619
- /* ------------------------------------------------------- RANGEES -------- */
1620
-
1621
- .rangee {
1622
- display: flex; align-items: center; justify-content: space-between; gap: 10px;
1623
- width: 100%; margin-bottom: 6px; padding: 10px 12px;
1624
- border: 1px solid var(--bord); border-radius: 8px;
1625
- background: var(--fond-clair); color: var(--texte);
1626
- font: inherit; text-align: left; cursor: pointer;
1627
- }
1628
- .rangee:hover { background: #2a2e37; border-color: var(--accent); }
1629
- .rangee__nom { font-size: 13px; font-weight: 600; }
1630
- .rangee__info { font-size: 11.5px; color: var(--texte-doux); white-space: nowrap; }
1631
-
1632
- /* ------------------------------------------------------ FLOTTANT -------- */
1633
-
1634
- /* Un message au-dessus de la barre, pour confirmer sans ouvrir de panneau. */
1635
- .flottant {
1636
- position: fixed;
1637
- left: 50%; bottom: 76px;
1638
- transform: translateX(-50%);
1639
- max-width: min(460px, calc(100vw - 24px));
1640
- }
1641
- .flottant .message { margin: 0; box-shadow: 0 8px 26px rgba(0,0,0,.4); }
1642
- `, Ve = `
1643
- /* ON NE DOIT JAMAIS SE DEMANDER SI ON EST EN MODE EDITION. Une barre en bas
1644
- se confond avec un bandeau de temoins ; un lisere qui borde tout l'ecran,
1645
- present sur chaque page, ne se confond avec rien. Il ne prend aucun clic. */
1646
- .cadre-global {
1647
- position: fixed;
1648
- inset: 0;
1649
- pointer-events: none;
1650
- border: 2px solid var(--accent);
1651
- border-radius: 4px;
1652
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
1653
- opacity: 0.85;
1654
- }
1655
-
1656
- /* EN MODE CIRCULER, le cadre change d'allure. On est toujours connecte — le
1657
- dire reste necessaire — mais les clics rendent la main aux liens, et rien
1658
- ne serait plus desagreable que de croire qu'on edite alors qu'on navigue,
1659
- ou l'inverse. Trait interrompu et plus efface : present, mais en retrait. */
1660
- .cadre-global--circuler {
1661
- border-style: dashed;
1662
- border-color: var(--texte-doux);
1663
- opacity: 0.5;
1664
- }
1665
-
1666
- /* La sortie est rouge au survol seulement : visible quand on la cherche,
1667
- discrete le reste du temps — c'est le geste qu'on fait une fois. */
1668
- .bouton--sortie { color: var(--texte-doux); background: transparent; border-color: transparent; }
1669
- .bouton--sortie:hover { background: rgba(217, 119, 106, 0.16); color: var(--danger); }
1670
- `, Xe = "lystech-editeur-hote", Ye = "lystech-connexion-hote";
1671
- function ge(n) {
1672
- document.getElementById(n)?.remove();
1673
- const e = document.createElement("div");
1674
- e.id = n, e.style.position = "relative", e.style.zIndex = "2147483000", document.body.appendChild(e);
1675
- const o = e.attachShadow({ mode: "open" }), s = document.createElement("style");
1676
- s.textContent = Re + Fe + Ve, o.appendChild(s);
1677
- const a = document.createElement("div");
1678
- return o.appendChild(a), { hote: e, point: a };
1679
- }
1680
- function he(n, e) {
1681
- let o = n;
1682
- return () => {
1683
- const s = o;
1684
- o = null, setTimeout(() => {
1685
- s?.unmount(), e.remove();
1686
- }, 0);
1687
- };
1688
- }
1689
- function Je({
1690
- site: n,
1691
- apiBaseUrl: e,
1692
- methodes: o,
1693
- surJeton: s
1694
- }) {
1695
- const { hote: a, point: c } = ge(Ye), l = de(c), y = () => r();
1696
- l.render(
1697
- /* @__PURE__ */ t(
1698
- Te,
1699
- {
1700
- site: n,
1701
- apiBaseUrl: e,
1702
- ...o ? { methodes: o } : {},
1703
- surJeton: (u) => {
1704
- r(), s(u);
1705
- },
1706
- surFermer: y
1707
- }
1708
- )
1709
- );
1710
- const r = he(l, a);
1711
- return r;
1712
- }
1713
- function Ke({
1714
- jeton: n,
1715
- site: e,
1716
- apiBaseUrl: o,
1717
- pont: s
1718
- }) {
1719
- const { hote: a, point: c } = ge(Xe), l = de(c);
1720
- return l.render(
1721
- /* @__PURE__ */ t(
1722
- Qe,
1723
- {
1724
- api: Ce({
1725
- jeton: n,
1726
- site: e,
1727
- apiBaseUrl: o,
1728
- surJetonRefuse: fe
1729
- }),
1730
- pont: s
1731
- }
1732
- )
1733
- ), he(l, a);
1734
- }
1
+ import "react/jsx-runtime";
2
+ import "react-dom/client";
3
+ import "./morceaux/constantes-BAdpe1ss.js";
4
+ import { a as i, b as n } from "./morceaux/index-C_uFDnBO.js";
1735
5
  export {
1736
- Je as monterConnexion,
1737
- Ke as monterEditeur
6
+ i as monterConnexion,
7
+ n as monterEditeur
1738
8
  };