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