@lystech/sections 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/dist/BoutonEdition.d.ts +13 -0
- package/dist/BoutonEditionCorps.d.ts +12 -0
- package/dist/SectionsProvider.d.ts +24 -1
- package/dist/catalogue.d.ts +12 -0
- package/dist/constantes.d.ts +15 -0
- package/dist/editeur/MarquesBoutique.d.ts +24 -16
- package/dist/editeur/boutique/Collections.d.ts +5 -8
- package/dist/editeur/boutique/FicheCollection.d.ts +23 -0
- package/dist/editeur/boutique/FicheProduit.d.ts +15 -6
- package/dist/editeur/boutique/ListeVirtuelle.d.ts +13 -0
- package/dist/editeur/boutique/ModuleBoutique.d.ts +34 -3
- package/dist/editeur/boutique/Publier.d.ts +15 -0
- package/dist/editeur/boutique/Selecteur.d.ts +10 -0
- package/dist/editeur/boutique/api.d.ts +48 -0
- package/dist/editeur/boutique/commun.d.ts +19 -0
- package/dist/editeur/boutique/styles.d.ts +1 -1
- package/dist/editeur/styles.d.ts +1 -1
- package/dist/editeur.js +2 -2
- package/dist/index.d.ts +5 -3
- package/dist/index.js +226 -183
- package/dist/morceaux/{ApercuMobile-RzxSOXyF.js → ApercuMobile-CSoo4dpM.js} +1 -1
- package/dist/morceaux/BoutonEditionCorps-B57eJtJn.js +112 -0
- package/dist/morceaux/ModuleBoutique-CgqcQjIb.js +1509 -0
- package/dist/morceaux/{constantes-BwBWlNYy.js → constantes-BAdpe1ss.js} +8 -6
- package/dist/morceaux/index-C_uFDnBO.js +2217 -0
- package/package.json +1 -1
- package/dist/morceaux/ModuleBoutique-BYBYDBN0.js +0 -867
- package/dist/morceaux/index-BicM0J3j.js +0 -2096
|
@@ -0,0 +1,2217 @@
|
|
|
1
|
+
import { jsx as t, jsxs as x, Fragment as Ie } from "react/jsx-runtime";
|
|
2
|
+
import { createRoot as qe } from "react-dom/client";
|
|
3
|
+
import { C as ye, A as ve, a as pe, b as Je, E as Ke, s as Pe } from "./constantes-BAdpe1ss.js";
|
|
4
|
+
import { useState as P, useRef as Y, useEffect as X, memo as $e, useMemo as ce, useCallback as V, Suspense as ke, lazy as Me } from "react";
|
|
5
|
+
function et({
|
|
6
|
+
jeton: o,
|
|
7
|
+
site: e,
|
|
8
|
+
apiBaseUrl: r,
|
|
9
|
+
surJetonRefuse: a
|
|
10
|
+
}) {
|
|
11
|
+
const i = {
|
|
12
|
+
"Content-Type": "application/json",
|
|
13
|
+
Authorization: "Bearer " + o
|
|
14
|
+
};
|
|
15
|
+
function n(u, v) {
|
|
16
|
+
if (v && (u.status === 401 || u.status === 403) && a(), !u.ok) throw new Error(String(u.status));
|
|
17
|
+
}
|
|
18
|
+
async function s(u, v = !0) {
|
|
19
|
+
const w = await fetch(r + u, {
|
|
20
|
+
headers: v ? i : void 0
|
|
21
|
+
});
|
|
22
|
+
return n(w, v), await w.json();
|
|
23
|
+
}
|
|
24
|
+
async function p(u, v, w) {
|
|
25
|
+
const d = await fetch(r + u, {
|
|
26
|
+
method: v,
|
|
27
|
+
headers: i,
|
|
28
|
+
body: w === void 0 ? void 0 : JSON.stringify(w)
|
|
29
|
+
});
|
|
30
|
+
return n(d, !0), await d.json();
|
|
31
|
+
}
|
|
32
|
+
async function c(u, v = {}) {
|
|
33
|
+
const w = new Headers(v.headers);
|
|
34
|
+
w.set("Authorization", "Bearer " + o), typeof v.body == "string" && !w.has("Content-Type") && w.set("Content-Type", "application/json");
|
|
35
|
+
const d = await fetch(r + u, { ...v, headers: w });
|
|
36
|
+
return d.status === 401 && a(), d;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
brut: c,
|
|
40
|
+
/** Les blocs que le site a déclaré savoir afficher. Route publique. */
|
|
41
|
+
schemas: () => s("/site-sections/public/" + encodeURIComponent(e) + "/schemas", !1),
|
|
42
|
+
/** Ce qui existe sur une page, brouillons compris. */
|
|
43
|
+
pourPage: (u) => s("/site-sections?page=" + encodeURIComponent(u)),
|
|
44
|
+
creer: (u, v, w) => p("/site-sections", "POST", { page: u, blockType: v, draft: w }),
|
|
45
|
+
enregistrerBrouillon: (u, v) => p("/site-sections/" + u + "/draft", "PUT", { draft: v }),
|
|
46
|
+
publier: (u) => p("/site-sections/" + u + "/publish", "POST"),
|
|
47
|
+
/** Ramène le brouillon à ce qui est en ligne. */
|
|
48
|
+
annuler: (u) => p("/site-sections/" + u + "/revert", "POST"),
|
|
49
|
+
/** Qui peut voir la section. S'applique TOUT DE SUITE (pas de brouillon). */
|
|
50
|
+
audience: (u, v) => p("/site-sections/" + u + "/audience", "POST", { audience: v }),
|
|
51
|
+
/** Les plans d'abonnement de la boutique, pour « Visible pour : plans… ». */
|
|
52
|
+
optionsAudience: () => s("/site-sections/audience-options")
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const tt = "data:image/png;base64,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", nt = {
|
|
56
|
+
apiKey: "AIzaSyCpAeHlt1wZvM5KtYg7X7MDVnWVJT86gvc",
|
|
57
|
+
authDomain: "lystech.firebaseapp.com",
|
|
58
|
+
projectId: "lystech",
|
|
59
|
+
storageBucket: "lystech.appspot.com",
|
|
60
|
+
messagingSenderId: "237347321732",
|
|
61
|
+
appId: "1:237347321732:web:7f9586d48e488d73ddcfd1"
|
|
62
|
+
};
|
|
63
|
+
function ot() {
|
|
64
|
+
return /* @__PURE__ */ x("span", { className: "marque", children: [
|
|
65
|
+
/* @__PURE__ */ t("img", { src: tt, alt: "", width: 22, height: 22 }),
|
|
66
|
+
/* @__PURE__ */ t("span", { className: "marque__mot", children: "Lystech" })
|
|
67
|
+
] });
|
|
68
|
+
}
|
|
69
|
+
function rt() {
|
|
70
|
+
return /* @__PURE__ */ x("svg", { viewBox: "0 0 18 18", "aria-hidden": "true", focusable: "false", className: "logo", children: [
|
|
71
|
+
/* @__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" }),
|
|
72
|
+
/* @__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" }),
|
|
73
|
+
/* @__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" }),
|
|
74
|
+
/* @__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" })
|
|
75
|
+
] });
|
|
76
|
+
}
|
|
77
|
+
function st() {
|
|
78
|
+
return /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", className: "logo", children: /* @__PURE__ */ t(
|
|
79
|
+
"path",
|
|
80
|
+
{
|
|
81
|
+
fill: "#fff",
|
|
82
|
+
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"
|
|
83
|
+
}
|
|
84
|
+
) });
|
|
85
|
+
}
|
|
86
|
+
function it({
|
|
87
|
+
site: o,
|
|
88
|
+
apiBaseUrl: e,
|
|
89
|
+
methodes: r = ["google", "facebook"],
|
|
90
|
+
surJeton: a,
|
|
91
|
+
surFermer: i
|
|
92
|
+
}) {
|
|
93
|
+
const [n, s] = P({ nom: "repos" }), p = (w) => {
|
|
94
|
+
switch (w) {
|
|
95
|
+
case "auth/popup-blocked":
|
|
96
|
+
return "Votre navigateur a bloqué la fenêtre de connexion. Autorisez les fenêtres pour ce site, puis réessayez.";
|
|
97
|
+
case "auth/popup-closed-by-user":
|
|
98
|
+
case "auth/cancelled-popup-request":
|
|
99
|
+
return "Connexion annulée.";
|
|
100
|
+
case "auth/unauthorized-domain":
|
|
101
|
+
return "Ce domaine n'est pas encore autorisé côté Lystech. Prévenez la personne qui gère le site.";
|
|
102
|
+
case "auth/account-exists-with-different-credential":
|
|
103
|
+
return "Cette adresse est déjà associée à un autre mode de connexion. Essayez l'autre bouton.";
|
|
104
|
+
case "auth/network-request-failed":
|
|
105
|
+
return "Connexion au réseau impossible. Vérifiez votre lien Internet.";
|
|
106
|
+
default:
|
|
107
|
+
return "La connexion a échoué. Réessayez dans un instant.";
|
|
108
|
+
}
|
|
109
|
+
}, c = async (w, d = !1) => {
|
|
110
|
+
const S = await fetch(e + "/site-sections/edit-login/third-party", {
|
|
111
|
+
method: "POST",
|
|
112
|
+
headers: { "Content-Type": "application/json" },
|
|
113
|
+
body: JSON.stringify({
|
|
114
|
+
site: o,
|
|
115
|
+
token: w,
|
|
116
|
+
tokenType: "firebase",
|
|
117
|
+
demanderAcces: d
|
|
118
|
+
})
|
|
119
|
+
});
|
|
120
|
+
if (S.status === 429) {
|
|
121
|
+
s({
|
|
122
|
+
nom: "erreur",
|
|
123
|
+
texte: "Trop de tentatives. Réessayez dans quelques minutes."
|
|
124
|
+
});
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const C = await S.json().catch(() => null);
|
|
128
|
+
if (C?.ok && C?.token) {
|
|
129
|
+
a(C.token);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
switch (C?.raison) {
|
|
133
|
+
case "sans_acces":
|
|
134
|
+
s({ nom: "sans-acces", jeton: w });
|
|
135
|
+
return;
|
|
136
|
+
case "demande_envoyee":
|
|
137
|
+
s({ nom: "demande-envoyee" });
|
|
138
|
+
return;
|
|
139
|
+
case "trop_de_demandes":
|
|
140
|
+
s({
|
|
141
|
+
nom: "erreur",
|
|
142
|
+
texte: "Trop de demandes aujourd'hui. Réessayez demain."
|
|
143
|
+
});
|
|
144
|
+
return;
|
|
145
|
+
case "aucun_compte":
|
|
146
|
+
s({ nom: "aucun-compte", adresse: "" });
|
|
147
|
+
return;
|
|
148
|
+
case "adresse_non_verifiee":
|
|
149
|
+
s({
|
|
150
|
+
nom: "erreur",
|
|
151
|
+
texte: "Votre fournisseur n'a pas confirmé cette adresse courriel. Vérifiez-la chez lui, puis réessayez."
|
|
152
|
+
});
|
|
153
|
+
return;
|
|
154
|
+
default:
|
|
155
|
+
s({
|
|
156
|
+
nom: "erreur",
|
|
157
|
+
texte: "La connexion a échoué. Réessayez dans un instant."
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}, u = async (w) => {
|
|
161
|
+
s({ nom: "envoi", quoi: w });
|
|
162
|
+
try {
|
|
163
|
+
const [{ initializeApp: d, getApps: S }, C] = await Promise.all([
|
|
164
|
+
import("./index.esm-B4AB50RA.js"),
|
|
165
|
+
import("./index.esm-B4hL1FOE.js")
|
|
166
|
+
]), A = S().find((y) => y.name === "lystech-edition") ?? d(nt, "lystech-edition"), M = w === "google" ? new C.GoogleAuthProvider() : new C.FacebookAuthProvider(), g = await (await C.signInWithPopup(C.getAuth(A), M)).user.getIdToken();
|
|
167
|
+
await c(g);
|
|
168
|
+
} catch (d) {
|
|
169
|
+
s({ nom: "erreur", texte: p(String(d?.code ?? "")) });
|
|
170
|
+
}
|
|
171
|
+
}, v = n.nom === "envoi";
|
|
172
|
+
return /* @__PURE__ */ t("div", { className: "voile", role: "dialog", "aria-modal": "true", "aria-label": "Modifier ce site", children: /* @__PURE__ */ x("div", { className: "fenetre", children: [
|
|
173
|
+
/* @__PURE__ */ t(
|
|
174
|
+
"button",
|
|
175
|
+
{
|
|
176
|
+
type: "button",
|
|
177
|
+
className: "fenetre__fermer",
|
|
178
|
+
onClick: i,
|
|
179
|
+
"aria-label": "Fermer",
|
|
180
|
+
children: "✕"
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ x("div", { className: "fenetre__tete", children: [
|
|
184
|
+
/* @__PURE__ */ t(ot, {}),
|
|
185
|
+
/* @__PURE__ */ t("h2", { className: "fenetre__titre", children: "Modifier ce site" }),
|
|
186
|
+
/* @__PURE__ */ t("p", { className: "fenetre__sous", children: "Vous vous connectez à Lystech. Cet accès ne sert qu'à modifier le contenu de ce site." })
|
|
187
|
+
] }),
|
|
188
|
+
/* @__PURE__ */ x("div", { className: "fenetre__corps", children: [
|
|
189
|
+
n.nom === "erreur" && /* @__PURE__ */ t("p", { className: "message message--erreur", children: n.texte }),
|
|
190
|
+
n.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." }),
|
|
191
|
+
n.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." }),
|
|
192
|
+
n.nom === "demande-envoyee" && /* @__PURE__ */ t("p", { className: "message message--ok", children: "Demande envoyée. La personne responsable du site vous répondra." }),
|
|
193
|
+
n.nom === "sans-acces" ? /* @__PURE__ */ t(
|
|
194
|
+
"button",
|
|
195
|
+
{
|
|
196
|
+
type: "button",
|
|
197
|
+
className: "bouton bouton--principal bouton--large",
|
|
198
|
+
onClick: () => {
|
|
199
|
+
c(n.jeton, !0);
|
|
200
|
+
},
|
|
201
|
+
children: "Demander l'accès"
|
|
202
|
+
}
|
|
203
|
+
) : n.nom === "demande-envoyee" || n.nom === "aucun-compte" ? /* @__PURE__ */ t(
|
|
204
|
+
"button",
|
|
205
|
+
{
|
|
206
|
+
type: "button",
|
|
207
|
+
className: "bouton bouton--large",
|
|
208
|
+
onClick: i,
|
|
209
|
+
children: "Fermer"
|
|
210
|
+
}
|
|
211
|
+
) : /* @__PURE__ */ x("div", { className: "fournisseurs", children: [
|
|
212
|
+
r.includes("google") && /* @__PURE__ */ x(
|
|
213
|
+
"button",
|
|
214
|
+
{
|
|
215
|
+
type: "button",
|
|
216
|
+
className: "fournisseur fournisseur--google",
|
|
217
|
+
disabled: v,
|
|
218
|
+
onClick: () => {
|
|
219
|
+
u("google");
|
|
220
|
+
},
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ t(rt, {}),
|
|
223
|
+
/* @__PURE__ */ t("span", { children: n.nom === "envoi" && n.quoi === "google" ? "Connexion…" : "Continuer avec Google" })
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
r.includes("facebook") && /* @__PURE__ */ x(
|
|
228
|
+
"button",
|
|
229
|
+
{
|
|
230
|
+
type: "button",
|
|
231
|
+
className: "fournisseur fournisseur--facebook",
|
|
232
|
+
disabled: v,
|
|
233
|
+
onClick: () => {
|
|
234
|
+
u("facebook");
|
|
235
|
+
},
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ t(st, {}),
|
|
238
|
+
/* @__PURE__ */ t("span", { children: n.nom === "envoi" && n.quoi === "facebook" ? "Connexion…" : "Continuer avec Facebook" })
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
] })
|
|
243
|
+
] })
|
|
244
|
+
] }) });
|
|
245
|
+
}
|
|
246
|
+
function at(o, e) {
|
|
247
|
+
const r = o && typeof o == "object" && !Array.isArray(o) ? Object.keys(o).filter((i) => /^[a-z]{2}(-[A-Za-z]{2})?$/.test(i)) : [], a = e.slice(0, 2);
|
|
248
|
+
return Array.from(/* @__PURE__ */ new Set([a, ...r]));
|
|
249
|
+
}
|
|
250
|
+
function lt(o) {
|
|
251
|
+
switch (o.type) {
|
|
252
|
+
case "number":
|
|
253
|
+
return 0;
|
|
254
|
+
case "boolean":
|
|
255
|
+
return !1;
|
|
256
|
+
case "list":
|
|
257
|
+
return [];
|
|
258
|
+
default:
|
|
259
|
+
return "";
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function Ee({ champ: o, valeur: e, changer: r }) {
|
|
263
|
+
switch (o.type) {
|
|
264
|
+
case "richText":
|
|
265
|
+
return /* @__PURE__ */ t(
|
|
266
|
+
"textarea",
|
|
267
|
+
{
|
|
268
|
+
value: String(e ?? ""),
|
|
269
|
+
onChange: (a) => r(a.target.value)
|
|
270
|
+
}
|
|
271
|
+
);
|
|
272
|
+
case "number":
|
|
273
|
+
return /* @__PURE__ */ t(
|
|
274
|
+
"input",
|
|
275
|
+
{
|
|
276
|
+
type: "number",
|
|
277
|
+
value: e === "" || e == null ? "" : String(e),
|
|
278
|
+
onChange: (a) => r(a.target.value === "" ? "" : Number(a.target.value))
|
|
279
|
+
}
|
|
280
|
+
);
|
|
281
|
+
case "boolean":
|
|
282
|
+
return /* @__PURE__ */ x("label", { className: "bascule", children: [
|
|
283
|
+
/* @__PURE__ */ t(
|
|
284
|
+
"input",
|
|
285
|
+
{
|
|
286
|
+
type: "checkbox",
|
|
287
|
+
checked: e === !0,
|
|
288
|
+
onChange: (a) => r(a.target.checked)
|
|
289
|
+
}
|
|
290
|
+
),
|
|
291
|
+
/* @__PURE__ */ t("span", { children: e === !0 ? "Oui" : "Non" })
|
|
292
|
+
] });
|
|
293
|
+
case "date":
|
|
294
|
+
return /* @__PURE__ */ t(
|
|
295
|
+
"input",
|
|
296
|
+
{
|
|
297
|
+
type: "date",
|
|
298
|
+
value: String(e ?? "").slice(0, 10),
|
|
299
|
+
onChange: (a) => r(a.target.value)
|
|
300
|
+
}
|
|
301
|
+
);
|
|
302
|
+
case "choice":
|
|
303
|
+
return /* @__PURE__ */ x(
|
|
304
|
+
"select",
|
|
305
|
+
{
|
|
306
|
+
value: String(e ?? ""),
|
|
307
|
+
onChange: (a) => r(a.target.value),
|
|
308
|
+
children: [
|
|
309
|
+
/* @__PURE__ */ t("option", { value: "", children: "—" }),
|
|
310
|
+
(o.options ?? []).map((a) => /* @__PURE__ */ t("option", { value: a, children: a }, a))
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
case "url":
|
|
315
|
+
return /* @__PURE__ */ t(
|
|
316
|
+
"input",
|
|
317
|
+
{
|
|
318
|
+
type: "url",
|
|
319
|
+
value: String(e ?? ""),
|
|
320
|
+
onChange: (a) => r(a.target.value),
|
|
321
|
+
placeholder: "https://"
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
case "image":
|
|
325
|
+
return /* @__PURE__ */ x(Ie, { children: [
|
|
326
|
+
/* @__PURE__ */ t(
|
|
327
|
+
"input",
|
|
328
|
+
{
|
|
329
|
+
type: "url",
|
|
330
|
+
value: String(e ?? ""),
|
|
331
|
+
onChange: (a) => r(a.target.value),
|
|
332
|
+
placeholder: "https://…"
|
|
333
|
+
}
|
|
334
|
+
),
|
|
335
|
+
String(e ?? "").startsWith("http") && /* @__PURE__ */ t("img", { className: "vignette", src: String(e), alt: "" })
|
|
336
|
+
] });
|
|
337
|
+
default:
|
|
338
|
+
return /* @__PURE__ */ t(
|
|
339
|
+
"input",
|
|
340
|
+
{
|
|
341
|
+
type: "text",
|
|
342
|
+
value: String(e ?? ""),
|
|
343
|
+
onChange: (a) => r(a.target.value)
|
|
344
|
+
}
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
function ze({ champ: o, valeur: e, changer: r, langue: a }) {
|
|
349
|
+
if (o.type === "list") {
|
|
350
|
+
const i = Array.isArray(e) ? e : [], n = o.of ?? [], s = (p, c, u) => {
|
|
351
|
+
const v = i.map((w, d) => d === p ? { ...w, [c]: u } : w);
|
|
352
|
+
r(v);
|
|
353
|
+
};
|
|
354
|
+
return /* @__PURE__ */ x("div", { className: "champ", children: [
|
|
355
|
+
/* @__PURE__ */ t("span", { className: "champ__etiquette", children: o.label }),
|
|
356
|
+
o.help && /* @__PURE__ */ t("p", { className: "champ__aide", children: o.help }),
|
|
357
|
+
i.map((p, c) => /* @__PURE__ */ x("div", { className: "liste__item", children: [
|
|
358
|
+
/* @__PURE__ */ x("div", { className: "liste__tete", children: [
|
|
359
|
+
/* @__PURE__ */ t("span", { className: "liste__rang", children: c + 1 }),
|
|
360
|
+
/* @__PURE__ */ x("span", { style: { display: "flex", gap: 4 }, children: [
|
|
361
|
+
/* @__PURE__ */ t(
|
|
362
|
+
"button",
|
|
363
|
+
{
|
|
364
|
+
type: "button",
|
|
365
|
+
className: "bouton bouton--icone bouton--discret",
|
|
366
|
+
title: "Monter",
|
|
367
|
+
disabled: c === 0,
|
|
368
|
+
onClick: () => {
|
|
369
|
+
const u = [...i];
|
|
370
|
+
[u[c - 1], u[c]] = [u[c], u[c - 1]], r(u);
|
|
371
|
+
},
|
|
372
|
+
children: "↑"
|
|
373
|
+
}
|
|
374
|
+
),
|
|
375
|
+
/* @__PURE__ */ t(
|
|
376
|
+
"button",
|
|
377
|
+
{
|
|
378
|
+
type: "button",
|
|
379
|
+
className: "bouton bouton--icone bouton--discret",
|
|
380
|
+
title: "Descendre",
|
|
381
|
+
disabled: c === i.length - 1,
|
|
382
|
+
onClick: () => {
|
|
383
|
+
const u = [...i];
|
|
384
|
+
[u[c], u[c + 1]] = [u[c + 1], u[c]], r(u);
|
|
385
|
+
},
|
|
386
|
+
children: "↓"
|
|
387
|
+
}
|
|
388
|
+
),
|
|
389
|
+
/* @__PURE__ */ t(
|
|
390
|
+
"button",
|
|
391
|
+
{
|
|
392
|
+
type: "button",
|
|
393
|
+
className: "bouton bouton--icone bouton--discret",
|
|
394
|
+
title: "Retirer",
|
|
395
|
+
onClick: () => r(i.filter((u, v) => v !== c)),
|
|
396
|
+
children: "✕"
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
] })
|
|
400
|
+
] }),
|
|
401
|
+
n.map((u) => /* @__PURE__ */ t(
|
|
402
|
+
ze,
|
|
403
|
+
{
|
|
404
|
+
champ: u,
|
|
405
|
+
langue: a,
|
|
406
|
+
valeur: p?.[u.key],
|
|
407
|
+
changer: (v) => s(c, u.key, v)
|
|
408
|
+
},
|
|
409
|
+
u.key
|
|
410
|
+
))
|
|
411
|
+
] }, c)),
|
|
412
|
+
/* @__PURE__ */ t(
|
|
413
|
+
"button",
|
|
414
|
+
{
|
|
415
|
+
type: "button",
|
|
416
|
+
className: "bouton",
|
|
417
|
+
onClick: () => r([
|
|
418
|
+
...i,
|
|
419
|
+
Object.fromEntries(n.map((p) => [p.key, lt(p)]))
|
|
420
|
+
]),
|
|
421
|
+
children: "+ Ajouter"
|
|
422
|
+
}
|
|
423
|
+
)
|
|
424
|
+
] });
|
|
425
|
+
}
|
|
426
|
+
if (o.localized) {
|
|
427
|
+
const i = at(e, a), n = e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
428
|
+
return /* @__PURE__ */ x("div", { className: "champ", children: [
|
|
429
|
+
/* @__PURE__ */ t("span", { className: "champ__etiquette", children: o.label }),
|
|
430
|
+
o.help && /* @__PURE__ */ t("p", { className: "champ__aide", children: o.help }),
|
|
431
|
+
i.map((s) => /* @__PURE__ */ x("div", { style: { marginBottom: 8 }, children: [
|
|
432
|
+
/* @__PURE__ */ t("span", { className: "champ__langue", children: s }),
|
|
433
|
+
/* @__PURE__ */ t(
|
|
434
|
+
Ee,
|
|
435
|
+
{
|
|
436
|
+
champ: o,
|
|
437
|
+
valeur: n[s],
|
|
438
|
+
changer: (p) => r({ ...n, [s]: p })
|
|
439
|
+
}
|
|
440
|
+
)
|
|
441
|
+
] }, s))
|
|
442
|
+
] });
|
|
443
|
+
}
|
|
444
|
+
return /* @__PURE__ */ x("div", { className: "champ", children: [
|
|
445
|
+
/* @__PURE__ */ t("label", { className: "champ__etiquette", children: o.label }),
|
|
446
|
+
/* @__PURE__ */ t(Ee, { champ: o, valeur: e, changer: r }),
|
|
447
|
+
o.help && /* @__PURE__ */ t("p", { className: "champ__aide", children: o.help })
|
|
448
|
+
] });
|
|
449
|
+
}
|
|
450
|
+
const Be = "data-lystech-champ", ct = ["lystech-editeur-hote", "lystech-connexion-hote"], ut = ["number", "text", "url", "date"], dt = "outline:2px dashed rgba(59,165,141,.85);outline-offset:3px;border-radius:3px;cursor:text;";
|
|
451
|
+
function fe(o) {
|
|
452
|
+
if (!(o instanceof Element)) return null;
|
|
453
|
+
const e = o.closest(`[${Be}]`);
|
|
454
|
+
return !e || e.closest("." + ye) || ct.some((r) => e.closest("#" + r)) ? null : e;
|
|
455
|
+
}
|
|
456
|
+
function Ne(o) {
|
|
457
|
+
const e = o.getAttribute(Be) ?? "", r = e.lastIndexOf(":");
|
|
458
|
+
return r <= 0 || r === e.length - 1 ? null : { blockType: e.slice(0, r), champ: e.slice(r + 1) };
|
|
459
|
+
}
|
|
460
|
+
function me(o) {
|
|
461
|
+
const e = o.dataset.lysStyleAvant;
|
|
462
|
+
e !== void 0 && (delete o.dataset.lysStyleAvant, e ? o.setAttribute("style", e) : o.removeAttribute("style"));
|
|
463
|
+
}
|
|
464
|
+
function pt(o, e) {
|
|
465
|
+
if (o === "number") {
|
|
466
|
+
const r = e.replace(/\s/g, "").replace(",", "."), a = Number(r);
|
|
467
|
+
return r === "" || !Number.isFinite(a) ? { ok: !1, erreur: "Un nombre, en chiffres — par exemple 85 ou 85,50." } : { ok: !0, valeur: a };
|
|
468
|
+
}
|
|
469
|
+
return { ok: !0, valeur: e.trim() };
|
|
470
|
+
}
|
|
471
|
+
function ft({
|
|
472
|
+
actif: o,
|
|
473
|
+
lire: e,
|
|
474
|
+
enregistrer: r,
|
|
475
|
+
ouvrirPanneau: a
|
|
476
|
+
}) {
|
|
477
|
+
const [i, n] = P(null), s = Y(null), p = Y(1), c = Y(null), u = Y(null), v = Y({ lire: e, enregistrer: r, ouvrirPanneau: a });
|
|
478
|
+
v.current = { lire: e, enregistrer: r, ouvrirPanneau: a }, X(() => {
|
|
479
|
+
if (!o) {
|
|
480
|
+
n(null);
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
const A = /* @__PURE__ */ new Set(), M = (k) => {
|
|
484
|
+
const E = fe(k.target);
|
|
485
|
+
if (!E) return;
|
|
486
|
+
const O = Ne(E);
|
|
487
|
+
!O || !v.current.lire(O.blockType, O.champ) || (E.dataset.lysStyleAvant === void 0 && (E.dataset.lysStyleAvant = E.getAttribute("style") ?? ""), E.setAttribute("style", E.dataset.lysStyleAvant + dt), A.add(E));
|
|
488
|
+
}, L = (k) => {
|
|
489
|
+
const E = fe(k.target);
|
|
490
|
+
if (!E) return;
|
|
491
|
+
const O = k.relatedTarget;
|
|
492
|
+
O instanceof Node && E.contains(O) || (me(E), A.delete(E));
|
|
493
|
+
}, g = (k) => {
|
|
494
|
+
const E = fe(k.target);
|
|
495
|
+
if (!E) return;
|
|
496
|
+
const O = Ne(E);
|
|
497
|
+
if (!O) return;
|
|
498
|
+
const U = v.current.lire(O.blockType, O.champ);
|
|
499
|
+
if (!U) return;
|
|
500
|
+
if (k.preventDefault(), k.stopPropagation(), me(E), A.delete(E), !ut.includes(U.type)) {
|
|
501
|
+
v.current.ouvrirPanneau(O.blockType);
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
const m = getComputedStyle(E);
|
|
505
|
+
n({
|
|
506
|
+
jeton: p.current++,
|
|
507
|
+
...O,
|
|
508
|
+
info: U,
|
|
509
|
+
el: E,
|
|
510
|
+
rect: E.getBoundingClientRect(),
|
|
511
|
+
police: {
|
|
512
|
+
fontFamily: m.fontFamily,
|
|
513
|
+
fontSize: m.fontSize,
|
|
514
|
+
fontWeight: m.fontWeight,
|
|
515
|
+
letterSpacing: m.letterSpacing
|
|
516
|
+
},
|
|
517
|
+
texte: U.valeur == null ? "" : String(U.valeur),
|
|
518
|
+
erreur: null,
|
|
519
|
+
envoi: !1
|
|
520
|
+
});
|
|
521
|
+
}, y = () => n((k) => k && { ...k, rect: k.el.getBoundingClientRect() });
|
|
522
|
+
return document.addEventListener("mouseover", M, !0), document.addEventListener("mouseout", L, !0), document.addEventListener("click", g, !0), window.addEventListener("scroll", y, { capture: !0, passive: !0 }), window.addEventListener("resize", y), () => {
|
|
523
|
+
document.removeEventListener("mouseover", M, !0), document.removeEventListener("mouseout", L, !0), document.removeEventListener("click", g, !0), window.removeEventListener("scroll", y, { capture: !0 }), window.removeEventListener("resize", y);
|
|
524
|
+
for (const k of A) me(k);
|
|
525
|
+
};
|
|
526
|
+
}, [o]);
|
|
527
|
+
const w = i?.jeton;
|
|
528
|
+
if (X(() => {
|
|
529
|
+
w != null && (s.current?.focus(), s.current?.select());
|
|
530
|
+
}, [w]), !i) return null;
|
|
531
|
+
const d = (A) => n((M) => M && M.jeton === A ? null : M);
|
|
532
|
+
async function S(A) {
|
|
533
|
+
if (c.current === A.jeton || u.current === A.jeton) return;
|
|
534
|
+
const M = A.info.valeur == null ? "" : String(A.info.valeur);
|
|
535
|
+
if (A.texte.trim() === M.trim()) {
|
|
536
|
+
d(A.jeton);
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
const L = pt(A.info.type, A.texte);
|
|
540
|
+
if (!L.ok) {
|
|
541
|
+
n((y) => y && y.jeton === A.jeton ? { ...y, erreur: L.erreur } : y);
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
n((y) => y && y.jeton === A.jeton ? { ...y, envoi: !0, erreur: null } : y), c.current = A.jeton;
|
|
545
|
+
let g = !1;
|
|
546
|
+
try {
|
|
547
|
+
g = await v.current.enregistrer(A.blockType, A.champ, L.valeur);
|
|
548
|
+
} finally {
|
|
549
|
+
c.current = null;
|
|
550
|
+
}
|
|
551
|
+
g ? d(A.jeton) : n(
|
|
552
|
+
(y) => y && y.jeton === A.jeton ? { ...y, envoi: !1, erreur: "Enregistrement impossible — la valeur en ligne n'a pas changé." } : y
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
const C = Math.max(i.rect.width + 40, 110);
|
|
556
|
+
return /* @__PURE__ */ x(
|
|
557
|
+
"form",
|
|
558
|
+
{
|
|
559
|
+
className: "saisie",
|
|
560
|
+
style: { top: i.rect.top - 28, left: i.rect.left - 8 },
|
|
561
|
+
onSubmit: (A) => {
|
|
562
|
+
A.preventDefault(), S(i);
|
|
563
|
+
},
|
|
564
|
+
children: [
|
|
565
|
+
/* @__PURE__ */ t("span", { className: "saisie__libelle", children: i.info.libelle }),
|
|
566
|
+
/* @__PURE__ */ t(
|
|
567
|
+
"input",
|
|
568
|
+
{
|
|
569
|
+
ref: s,
|
|
570
|
+
className: "saisie__champ",
|
|
571
|
+
style: { ...i.police, width: C },
|
|
572
|
+
value: i.texte,
|
|
573
|
+
inputMode: i.info.type === "number" ? "decimal" : void 0,
|
|
574
|
+
disabled: i.envoi,
|
|
575
|
+
"aria-label": i.info.libelle,
|
|
576
|
+
onChange: (A) => {
|
|
577
|
+
const M = A.target.value;
|
|
578
|
+
n((L) => L && { ...L, texte: M, erreur: null });
|
|
579
|
+
},
|
|
580
|
+
onKeyDown: (A) => {
|
|
581
|
+
if (A.key === "Enter") {
|
|
582
|
+
A.preventDefault(), S(i);
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
A.key === "Escape" && (A.preventDefault(), u.current = i.jeton, d(i.jeton));
|
|
586
|
+
},
|
|
587
|
+
onBlur: () => {
|
|
588
|
+
S(i);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
),
|
|
592
|
+
i.erreur ? /* @__PURE__ */ t("span", { className: "saisie__erreur", children: i.erreur }) : /* @__PURE__ */ t("span", { className: "saisie__aide", children: "Entrée pour enregistrer · Échap pour annuler" })
|
|
593
|
+
]
|
|
594
|
+
}
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
const jt = (o) => !!o && o.startsWith("brl_");
|
|
598
|
+
class Se extends Error {
|
|
599
|
+
constructor(e, r, a = {}, i = null) {
|
|
600
|
+
super(e), this.statut = r, this.erreurs = a, this.raison = i;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
const mt = "/site-sections/boutique";
|
|
604
|
+
function bt(o) {
|
|
605
|
+
async function e(n, s = {}) {
|
|
606
|
+
let p;
|
|
607
|
+
try {
|
|
608
|
+
p = await o(mt + n, s);
|
|
609
|
+
} catch {
|
|
610
|
+
throw new Se("Pas de connexion au serveur. Vérifiez Internet et réessayez.", 0);
|
|
611
|
+
}
|
|
612
|
+
let c = null;
|
|
613
|
+
try {
|
|
614
|
+
c = await p.json();
|
|
615
|
+
} catch {
|
|
616
|
+
c = null;
|
|
617
|
+
}
|
|
618
|
+
if (!p.ok) {
|
|
619
|
+
const u = c?.error ?? (p.status === 403 ? "La boutique se gère par un administrateur de l'organisation." : p.status === 413 ? "Envoi trop volumineux." : "L'opération a échoué. Réessayez.");
|
|
620
|
+
throw new Se(u, p.status, c?.erreurs ?? {}, c?.raison ?? null);
|
|
621
|
+
}
|
|
622
|
+
return c;
|
|
623
|
+
}
|
|
624
|
+
const r = (n, s) => ({
|
|
625
|
+
method: n,
|
|
626
|
+
body: JSON.stringify(s)
|
|
627
|
+
}), a = (n) => "/produits/" + encodeURIComponent(n), i = (n) => "/brouillons/" + encodeURIComponent(n);
|
|
628
|
+
return {
|
|
629
|
+
/** Le module s'affiche-t-il ? Faux en cas de doute (ancien serveur, éditeur). */
|
|
630
|
+
droits: async () => {
|
|
631
|
+
try {
|
|
632
|
+
return (await e("/droits")).catalogue === !0;
|
|
633
|
+
} catch {
|
|
634
|
+
return !1;
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
produits: () => e("/produits"),
|
|
638
|
+
produit: (n) => e(a(n)),
|
|
639
|
+
creer: (n) => e("/produits", r("POST", n)),
|
|
640
|
+
modifier: (n, s) => e(a(n), r("PATCH", s)),
|
|
641
|
+
visible: (n, s) => e(a(n) + "/visible", r("POST", { visible: s })),
|
|
642
|
+
supprimer: (n) => e(a(n), r("DELETE", { confirmer: !0 })),
|
|
643
|
+
ajouterPhoto: (n, s, p) => {
|
|
644
|
+
const c = new FormData();
|
|
645
|
+
return c.set("photo", s, p), e(a(n) + "/photos", { method: "POST", body: c });
|
|
646
|
+
},
|
|
647
|
+
principale: (n, s) => e(a(n) + "/photos/" + encodeURIComponent(s) + "/principale", r("POST", {})),
|
|
648
|
+
retirerPhoto: (n, s) => e(a(n) + "/photos/" + encodeURIComponent(s), r("DELETE", {})),
|
|
649
|
+
collections: () => e("/collections"),
|
|
650
|
+
creerCollection: (n) => e("/collections", r("POST", { nom: n })),
|
|
651
|
+
modifierCollection: (n, s) => e("/collections/" + encodeURIComponent(n), r("PATCH", s)),
|
|
652
|
+
garnirCollection: (n, s, p) => e("/collections/" + encodeURIComponent(n) + "/produits", r("POST", { ajouter: s, retirer: p })),
|
|
653
|
+
/* ------------------------------------------------------ brouillons --- */
|
|
654
|
+
brouillons: () => e("/brouillons"),
|
|
655
|
+
/** `cle` : la même clé deux fois (double clic, réseau qui rejoue) ne crée qu'un brouillon. */
|
|
656
|
+
creerBrouillon: (n, s, p) => e("/brouillons", r("POST", { type: n, donnees: s, cle: p })),
|
|
657
|
+
modifierBrouillon: (n, s) => e(i(n), r("PATCH", { donnees: s })),
|
|
658
|
+
supprimerBrouillon: (n) => e(i(n), r("DELETE", { confirmer: !0 })),
|
|
659
|
+
photoBrouillon: (n, s, p) => {
|
|
660
|
+
const c = new FormData();
|
|
661
|
+
return c.set("photo", s, p), e(i(n) + "/photos", { method: "POST", body: c });
|
|
662
|
+
},
|
|
663
|
+
principaleBrouillon: (n, s) => e(i(n) + "/photos/" + encodeURIComponent(s) + "/principale", r("POST", {})),
|
|
664
|
+
retirerPhotoBrouillon: (n, s) => e(i(n) + "/photos/" + encodeURIComponent(s), r("DELETE", {})),
|
|
665
|
+
/** Publier : chaque élément pour lui-même, un échec n'annule pas les autres. */
|
|
666
|
+
publier: (n, s) => e("/brouillons/publier", r("POST", { UIDs: n, ouvrir: s }))
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
function Rt(o) {
|
|
670
|
+
return new Intl.NumberFormat("fr-CA", { style: "currency", currency: "CAD" }).format(o);
|
|
671
|
+
}
|
|
672
|
+
const Ue = ["lystech-editeur-hote", "lystech-connexion-hote"], ht = "data-lystech-ajout";
|
|
673
|
+
function be(o) {
|
|
674
|
+
return ((o.innerText || "").split(`
|
|
675
|
+
`).map((r) => r.trim()).find((r) => r && !/^\d/.test(r) && r.length > 2) ?? "").slice(0, 60);
|
|
676
|
+
}
|
|
677
|
+
const Te = (o) => o.getClientRects().length > 0, he = (o) => Ue.some((e) => o.closest("#" + e));
|
|
678
|
+
function gt(o) {
|
|
679
|
+
const e = /* @__PURE__ */ new Map();
|
|
680
|
+
for (const i of o) {
|
|
681
|
+
let n = i, s = i.parentElement;
|
|
682
|
+
for (; s && s !== document.body && !(s.querySelectorAll(`[${ve}]`).length > 1); )
|
|
683
|
+
n = s, s = s.parentElement;
|
|
684
|
+
const p = s && s !== document.body ? s : i.parentElement;
|
|
685
|
+
if (!p) continue;
|
|
686
|
+
const c = e.get(p);
|
|
687
|
+
c ? c.n++ : e.set(p, { n: 1, caseModele: o.length === 1 ? i : n });
|
|
688
|
+
}
|
|
689
|
+
let r = null, a = 0;
|
|
690
|
+
for (const [i, { n, caseModele: s }] of e)
|
|
691
|
+
n > a && (a = n, r = { grille: i, caseModele: s });
|
|
692
|
+
return r;
|
|
693
|
+
}
|
|
694
|
+
const xt = `
|
|
695
|
+
:host { all: initial; display: block; }
|
|
696
|
+
button {
|
|
697
|
+
box-sizing: border-box; width: 100%; height: 100%; min-height: 44px;
|
|
698
|
+
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
|
|
699
|
+
padding: 14px; border: 2px dashed #3ba58d; border-radius: 14px; cursor: pointer;
|
|
700
|
+
background: rgba(240, 250, 247, 0.9); color: #1f6f5d; text-align: center;
|
|
701
|
+
font: 650 14px/1.3 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
702
|
+
}
|
|
703
|
+
button:hover { background: rgba(220, 244, 237, 0.98); }
|
|
704
|
+
button:focus-visible { outline: 3px solid #3ba58d; outline-offset: 3px; }
|
|
705
|
+
b { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #3ba58d; color: #fff; font-size: 30px; font-weight: 400; line-height: 1; }
|
|
706
|
+
small { font-weight: 500; font-size: 12px; color: #3d7f70; }
|
|
707
|
+
@media (prefers-reduced-motion: no-preference) { button { transition: background .12s; } }
|
|
708
|
+
`;
|
|
709
|
+
function vt(o) {
|
|
710
|
+
const e = document.createElement("div");
|
|
711
|
+
e.setAttribute(ht, ""), e.className = ye;
|
|
712
|
+
const r = e.attachShadow({ mode: "open" });
|
|
713
|
+
return r.innerHTML = `<style>${xt}</style><button type="button"><b aria-hidden="true">+</b><span class="t"></span><small></small></button>`, r.querySelector("button").addEventListener("click", (a) => {
|
|
714
|
+
a.preventDefault(), a.stopPropagation(), o();
|
|
715
|
+
}), e;
|
|
716
|
+
}
|
|
717
|
+
function yt(o, e) {
|
|
718
|
+
const r = o.shadowRoot.querySelector("button"), a = r.querySelector(".t"), i = r.querySelector("small");
|
|
719
|
+
a.textContent = "Ajouter un bijou", i.textContent = e ? `à « ${e} »` : "nouveau", r.setAttribute("aria-label", e ? `Ajouter un bijou à la collection ${e}` : "Créer un nouveau bijou");
|
|
720
|
+
}
|
|
721
|
+
function At(o, e, r) {
|
|
722
|
+
const a = r.getBoundingClientRect(), i = getComputedStyle(e).display.includes("flex"), n = i ? Math.round(a.width) + "px" : "", s = Math.round(Math.max(a.height, 120)) + "px";
|
|
723
|
+
o.style.width !== n && (o.style.width = n), o.style.minHeight !== s && (o.style.minHeight = s), i && o.style.flex !== "none" && (o.style.flex = "none");
|
|
724
|
+
}
|
|
725
|
+
const Ct = $e(function({
|
|
726
|
+
crayons: e,
|
|
727
|
+
carte: r,
|
|
728
|
+
ouvrirProduit: a,
|
|
729
|
+
ouvrirAjout: i,
|
|
730
|
+
ouvrirCollection: n
|
|
731
|
+
}) {
|
|
732
|
+
const [s, p] = P([]), [c, u] = P([]), v = Y(null), w = Y({ ouvrirAjout: i });
|
|
733
|
+
return w.current = { ouvrirAjout: i }, X(() => {
|
|
734
|
+
if (!e && !r) {
|
|
735
|
+
p([]), u([]);
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
let d = 0, S = "", C = null, A = null;
|
|
739
|
+
const M = () => {
|
|
740
|
+
const U = v.current;
|
|
741
|
+
U && (U.style.transform = `translate3d(${-window.scrollX}px, ${-window.scrollY}px, 0)`);
|
|
742
|
+
}, L = () => {
|
|
743
|
+
d = 0;
|
|
744
|
+
const U = window.scrollX, m = window.scrollY, f = (N) => ({ x: Math.round(N.left + U), y: Math.round(N.top + m), l: Math.round(N.width), h: Math.round(N.height) }), I = Array.from(document.querySelectorAll(`[${ve}]`)).filter((N) => !he(N) && Te(N)), Q = Array.from(document.querySelectorAll(`[${pe}]`)).filter((N) => !he(N) && Te(N)), q = Q.find((N) => N.hasAttribute(Je)) ?? (Q.length === 1 ? Q[0] : void 0);
|
|
745
|
+
if (A = q ? { UID: q.getAttribute(pe) ?? "", nom: be(q) || "cette collection" } : null, r) {
|
|
746
|
+
const N = I.length ? gt(I) : null;
|
|
747
|
+
N ? (C || (C = vt(() => w.current.ouvrirAjout(A))), (C.parentElement !== N.grille || N.grille.lastElementChild !== C) && N.grille.appendChild(C), yt(C, A?.nom ?? null), At(C, N.grille, N.caseModele)) : C && C.remove();
|
|
748
|
+
}
|
|
749
|
+
if (!e) {
|
|
750
|
+
S !== "" && (S = "", p([]), u([]));
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
const H = [];
|
|
754
|
+
for (const N of I) {
|
|
755
|
+
const ie = N.getAttribute(ve), ae = N.getBoundingClientRect();
|
|
756
|
+
!ie || ae.width < 24 || H.push({ UID: ie, nom: be(N) || "ce bijou", p: f(ae) });
|
|
757
|
+
}
|
|
758
|
+
const K = (q ? [q] : Q).map((N) => ({ UID: N.getAttribute(pe) ?? "", nom: be(N) || "cette collection", p: f(N.getBoundingClientRect()) })).filter((N) => N.UID), se = JSON.stringify([H, K]);
|
|
759
|
+
se !== S && (S = se, p(H), u(K)), M();
|
|
760
|
+
}, g = () => {
|
|
761
|
+
d || (d = requestAnimationFrame(L));
|
|
762
|
+
};
|
|
763
|
+
let y = 0;
|
|
764
|
+
const k = (U) => {
|
|
765
|
+
const m = U.target;
|
|
766
|
+
m === document || m === document.documentElement || m === window ? y || (y = requestAnimationFrame(() => {
|
|
767
|
+
y = 0, M();
|
|
768
|
+
})) : m instanceof Element && !he(m) && g();
|
|
769
|
+
};
|
|
770
|
+
L();
|
|
771
|
+
const E = new MutationObserver((U) => {
|
|
772
|
+
U.every(
|
|
773
|
+
(f) => [...Array.from(f.addedNodes), ...Array.from(f.removedNodes)].every((I) => I === C || I instanceof Element && Ue.includes(I.id))
|
|
774
|
+
) || g();
|
|
775
|
+
});
|
|
776
|
+
E.observe(document.body, { childList: !0, subtree: !0 });
|
|
777
|
+
const O = new ResizeObserver(g);
|
|
778
|
+
return O.observe(document.body), window.addEventListener("scroll", k, { capture: !0, passive: !0 }), window.addEventListener("resize", g), document.addEventListener("load", g, !0), () => {
|
|
779
|
+
E.disconnect(), O.disconnect(), window.removeEventListener("scroll", k, !0), window.removeEventListener("resize", g), document.removeEventListener("load", g, !0), d && cancelAnimationFrame(d), y && cancelAnimationFrame(y), C?.remove();
|
|
780
|
+
};
|
|
781
|
+
}, [e, r]), e ? /* @__PURE__ */ x("div", { ref: v, className: "marques", style: { transform: `translate3d(${-window.scrollX}px, ${-window.scrollY}px, 0)` }, children: [
|
|
782
|
+
s.map((d) => /* @__PURE__ */ t(
|
|
783
|
+
"button",
|
|
784
|
+
{
|
|
785
|
+
type: "button",
|
|
786
|
+
className: "crayon",
|
|
787
|
+
style: { top: d.p.y + 8, left: d.p.x + d.p.l - 52 },
|
|
788
|
+
onClick: () => a(d.UID),
|
|
789
|
+
"aria-label": "Modifier " + d.nom,
|
|
790
|
+
title: "Modifier " + d.nom,
|
|
791
|
+
children: /* @__PURE__ */ t(Le, {})
|
|
792
|
+
},
|
|
793
|
+
d.UID
|
|
794
|
+
)),
|
|
795
|
+
c.map((d) => {
|
|
796
|
+
const C = d.p.l < 150 || d.p.h < 60 ? d.p.y - 22 : d.p.y + 6;
|
|
797
|
+
return /* @__PURE__ */ x("div", { className: "marque-coll", style: { top: Math.max(0, C), left: d.p.x + d.p.l - 100 }, children: [
|
|
798
|
+
/* @__PURE__ */ t("button", { type: "button", className: "crayon crayon--collection", onClick: () => n(d.UID), "aria-label": `Modifier la collection ${d.nom}`, title: `Modifier la collection « ${d.nom} »`, children: /* @__PURE__ */ t(Le, {}) }),
|
|
799
|
+
/* @__PURE__ */ t("button", { type: "button", className: "crayon crayon--plus", onClick: () => i({ UID: d.UID, nom: d.nom }), "aria-label": `Ajouter des bijoux à la collection ${d.nom}`, title: `Ajouter des bijoux à « ${d.nom} »`, children: /* @__PURE__ */ t("span", { "aria-hidden": "true", children: "+" }) })
|
|
800
|
+
] }, "c" + d.UID);
|
|
801
|
+
})
|
|
802
|
+
] }) : null;
|
|
803
|
+
});
|
|
804
|
+
function Le() {
|
|
805
|
+
return /* @__PURE__ */ x("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
806
|
+
/* @__PURE__ */ t("path", { d: "M12 20h9" }),
|
|
807
|
+
/* @__PURE__ */ t("path", { d: "M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z" })
|
|
808
|
+
] });
|
|
809
|
+
}
|
|
810
|
+
const wt = ["lystech-editeur-hote", "lystech-connexion-hote"];
|
|
811
|
+
function kt(o, e) {
|
|
812
|
+
const r = /* @__PURE__ */ new Map();
|
|
813
|
+
for (const [a, i] of Object.entries(o))
|
|
814
|
+
for (const [n, s] of Object.entries(i)) {
|
|
815
|
+
const p = String(s ?? "").trim();
|
|
816
|
+
if (p.length < 2 || p.includes("{{")) continue;
|
|
817
|
+
const c = e(a, n);
|
|
818
|
+
if (c <= 0) continue;
|
|
819
|
+
const u = r.get(p);
|
|
820
|
+
u ? u.push({ ns: a, chemin: n, rang: c }) : r.set(p, [{ ns: a, chemin: n, rang: c }]);
|
|
821
|
+
}
|
|
822
|
+
return r;
|
|
823
|
+
}
|
|
824
|
+
function Et(o) {
|
|
825
|
+
const e = /* @__PURE__ */ new Map(), r = document.body.querySelectorAll("*");
|
|
826
|
+
for (const a of r) {
|
|
827
|
+
if (wt.some((s) => a.id === s || a.closest("#" + s)) || a.closest("." + ye) || a.closest("[data-lystech-champ]") || a.children.length > 0) continue;
|
|
828
|
+
const i = (a.textContent ?? "").trim();
|
|
829
|
+
if (i.length < 2) continue;
|
|
830
|
+
const n = o.get(i);
|
|
831
|
+
n && e.set(a, { valeur: i, candidats: n });
|
|
832
|
+
}
|
|
833
|
+
return e;
|
|
834
|
+
}
|
|
835
|
+
function Nt({
|
|
836
|
+
source: o,
|
|
837
|
+
actif: e,
|
|
838
|
+
pertinence: r,
|
|
839
|
+
surModification: a
|
|
840
|
+
}) {
|
|
841
|
+
const i = Y(/* @__PURE__ */ new Map()), n = Y(null), [s, p] = P(null), c = Y(o);
|
|
842
|
+
c.current = o;
|
|
843
|
+
const u = Y(a);
|
|
844
|
+
u.current = a;
|
|
845
|
+
const v = Y(r);
|
|
846
|
+
v.current = r;
|
|
847
|
+
const w = Y(null);
|
|
848
|
+
return X(() => {
|
|
849
|
+
if (!e) return;
|
|
850
|
+
const d = () => {
|
|
851
|
+
const m = c.current, f = kt(
|
|
852
|
+
m.dictionnaire(m.langueCourante()),
|
|
853
|
+
v.current
|
|
854
|
+
);
|
|
855
|
+
i.current = Et(f);
|
|
856
|
+
};
|
|
857
|
+
w.current = d, d();
|
|
858
|
+
let S;
|
|
859
|
+
const C = new MutationObserver(() => {
|
|
860
|
+
n.current || (clearTimeout(S), S = setTimeout(d, 250));
|
|
861
|
+
});
|
|
862
|
+
C.observe(document.body, { childList: !0, subtree: !0 });
|
|
863
|
+
const A = "outline:2px dashed rgba(59,165,141,.85);outline-offset:3px;border-radius:3px;cursor:text;", M = (m) => {
|
|
864
|
+
const f = m.target;
|
|
865
|
+
!(f instanceof HTMLElement) || n.current || i.current.has(f) && (f.dataset.lysStyleAvant || (f.dataset.lysStyleAvant = f.getAttribute("style") ?? ""), f.setAttribute(
|
|
866
|
+
"style",
|
|
867
|
+
(f.dataset.lysStyleAvant ?? "") + A
|
|
868
|
+
));
|
|
869
|
+
}, L = (m) => {
|
|
870
|
+
const f = m.target;
|
|
871
|
+
if (!(f instanceof HTMLElement) || n.current?.el === f || f.dataset.lysStyleAvant === void 0) return;
|
|
872
|
+
const I = f.dataset.lysStyleAvant;
|
|
873
|
+
delete f.dataset.lysStyleAvant, I ? f.setAttribute("style", I) : f.removeAttribute("style");
|
|
874
|
+
}, g = (m, f) => {
|
|
875
|
+
const I = m.getAttribute("style") ?? "";
|
|
876
|
+
n.current = {
|
|
877
|
+
el: m,
|
|
878
|
+
avant: (m.textContent ?? "").trim(),
|
|
879
|
+
ns: f.ns,
|
|
880
|
+
chemin: f.chemin,
|
|
881
|
+
styleAvant: m.dataset.lysStyleAvant ?? I
|
|
882
|
+
}, m.setAttribute("contenteditable", "plaintext-only"), m.setAttribute(
|
|
883
|
+
"style",
|
|
884
|
+
(m.dataset.lysStyleAvant ?? "") + "outline:2px solid #3ba58d;outline-offset:3px;border-radius:3px;"
|
|
885
|
+
), m.focus();
|
|
886
|
+
const Q = window.getSelection(), q = document.createRange();
|
|
887
|
+
q.selectNodeContents(m), Q?.removeAllRanges(), Q?.addRange(q);
|
|
888
|
+
}, y = async (m) => {
|
|
889
|
+
const f = n.current;
|
|
890
|
+
if (!f) return;
|
|
891
|
+
n.current = null;
|
|
892
|
+
const I = (f.el.textContent ?? "").trim();
|
|
893
|
+
f.el.removeAttribute("contenteditable");
|
|
894
|
+
const Q = f.el.dataset.lysStyleAvant;
|
|
895
|
+
if (delete f.el.dataset.lysStyleAvant, Q ? f.el.setAttribute("style", Q) : f.el.removeAttribute("style"), m || I === f.avant) {
|
|
896
|
+
m && (f.el.textContent = f.avant);
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
const q = c.current.langueCourante();
|
|
900
|
+
c.current.poser(q, f.ns, f.chemin, I), await u.current(f.ns, f.chemin, q, I);
|
|
901
|
+
}, k = (m) => {
|
|
902
|
+
const f = m.target;
|
|
903
|
+
if (!(f instanceof HTMLElement)) return;
|
|
904
|
+
if (n.current) {
|
|
905
|
+
if (n.current.el === f) return;
|
|
906
|
+
y(!1);
|
|
907
|
+
}
|
|
908
|
+
const I = i.current.get(f);
|
|
909
|
+
if (!I) return;
|
|
910
|
+
m.preventDefault(), m.stopPropagation();
|
|
911
|
+
const Q = Math.max(...I.candidats.map((H) => H.rang)), q = I.candidats.filter((H) => H.rang === Q);
|
|
912
|
+
if (q.length === 1) {
|
|
913
|
+
g(f, q[0]);
|
|
914
|
+
return;
|
|
915
|
+
}
|
|
916
|
+
p({
|
|
917
|
+
el: f,
|
|
918
|
+
candidats: q,
|
|
919
|
+
x: m.clientX,
|
|
920
|
+
y: m.clientY
|
|
921
|
+
});
|
|
922
|
+
}, E = (m) => {
|
|
923
|
+
n.current && (m.key === "Escape" ? (m.preventDefault(), y(!0)) : m.key === "Enter" && !m.shiftKey && (m.preventDefault(), y(!1)));
|
|
924
|
+
}, O = () => {
|
|
925
|
+
n.current && y(!1);
|
|
926
|
+
};
|
|
927
|
+
document.addEventListener("mouseover", M, !0), document.addEventListener("mouseout", L, !0), document.addEventListener("click", k, !0);
|
|
928
|
+
const U = (m) => {
|
|
929
|
+
if (!n.current) return;
|
|
930
|
+
const f = m.inputType;
|
|
931
|
+
(f === "insertParagraph" || f === "insertLineBreak") && (m.preventDefault(), y(!1));
|
|
932
|
+
};
|
|
933
|
+
return document.addEventListener("beforeinput", U, !0), document.addEventListener("keydown", E, !0), document.addEventListener("focusout", O, !0), window.__lysChoisir = (m, f) => {
|
|
934
|
+
p(null), g(f, m);
|
|
935
|
+
}, () => {
|
|
936
|
+
w.current = null, clearTimeout(S), C.disconnect(), document.removeEventListener("mouseover", M, !0), document.removeEventListener("mouseout", L, !0), document.removeEventListener("click", k, !0), document.removeEventListener("beforeinput", U, !0), document.removeEventListener("keydown", E, !0), document.removeEventListener("focusout", O, !0), n.current && y(!0), delete window.__lysChoisir;
|
|
937
|
+
};
|
|
938
|
+
}, [e]), X(() => {
|
|
939
|
+
n.current || w.current?.();
|
|
940
|
+
}, [r]), s ? /* @__PURE__ */ x(
|
|
941
|
+
"div",
|
|
942
|
+
{
|
|
943
|
+
className: "choix",
|
|
944
|
+
style: {
|
|
945
|
+
top: Math.min(s.y + 10, window.innerHeight - 200),
|
|
946
|
+
left: Math.min(s.x, window.innerWidth - 280)
|
|
947
|
+
},
|
|
948
|
+
children: [
|
|
949
|
+
/* @__PURE__ */ t("p", { className: "choix__titre", children: "Ce texte apparaît à plusieurs endroits." }),
|
|
950
|
+
/* @__PURE__ */ t("p", { className: "choix__aide", children: "Lequel corrigez-vous ?" }),
|
|
951
|
+
s.candidats.map((d) => /* @__PURE__ */ x(
|
|
952
|
+
"button",
|
|
953
|
+
{
|
|
954
|
+
type: "button",
|
|
955
|
+
className: "choix__option",
|
|
956
|
+
onClick: () => window.__lysChoisir?.(d, s.el),
|
|
957
|
+
children: [
|
|
958
|
+
/* @__PURE__ */ t("span", { className: "choix__chemin", children: d.chemin }),
|
|
959
|
+
/* @__PURE__ */ t("span", { className: "choix__ns", children: d.ns })
|
|
960
|
+
]
|
|
961
|
+
},
|
|
962
|
+
d.ns + ":" + d.chemin
|
|
963
|
+
)),
|
|
964
|
+
/* @__PURE__ */ t(
|
|
965
|
+
"button",
|
|
966
|
+
{
|
|
967
|
+
type: "button",
|
|
968
|
+
className: "bouton bouton--discret",
|
|
969
|
+
onClick: () => p(null),
|
|
970
|
+
children: "Annuler"
|
|
971
|
+
}
|
|
972
|
+
)
|
|
973
|
+
]
|
|
974
|
+
}
|
|
975
|
+
) : null;
|
|
976
|
+
}
|
|
977
|
+
const _e = {
|
|
978
|
+
everyone: "Tout le monde",
|
|
979
|
+
loggedIn: "Clients connectés",
|
|
980
|
+
nonMembers: "Non-membres (visiteurs compris)",
|
|
981
|
+
members: "Tous les membres",
|
|
982
|
+
plans: "Membres de certains plans"
|
|
983
|
+
}, De = {
|
|
984
|
+
everyone: "Tous les visiteurs voient cette section.",
|
|
985
|
+
loggedIn: "Seuls les clients connectés à leur compte la voient.",
|
|
986
|
+
nonMembers: "Les visiteurs et les clients sans adhésion active la voient ; les membres non.",
|
|
987
|
+
members: "Seuls les clients dont l'adhésion est active la voient.",
|
|
988
|
+
plans: "Seuls les membres actifs des plans cochés la voient."
|
|
989
|
+
};
|
|
990
|
+
function St({
|
|
991
|
+
api: o,
|
|
992
|
+
section: e,
|
|
993
|
+
apresChangement: r
|
|
994
|
+
}) {
|
|
995
|
+
const a = e?.audience ?? { mode: "everyone" }, [i, n] = P(a.mode), [s, p] = P(a.mode === "plans" ? a.plans : []), [c, u] = P(null), [v, w] = P(!1), [d, S] = P(null), C = e ? e.UID + JSON.stringify(e.audience ?? null) : "";
|
|
996
|
+
if (X(() => {
|
|
997
|
+
const g = e?.audience ?? { mode: "everyone" };
|
|
998
|
+
n(g.mode), p(g.mode === "plans" ? g.plans : []), S(null);
|
|
999
|
+
}, [C]), X(() => {
|
|
1000
|
+
let g = !0;
|
|
1001
|
+
return o.optionsAudience().then((y) => g && u(y.plans ?? [])).catch(() => g && u([])), () => {
|
|
1002
|
+
g = !1;
|
|
1003
|
+
};
|
|
1004
|
+
}, [o]), !e?.UID)
|
|
1005
|
+
return /* @__PURE__ */ x("div", { className: "champ", children: [
|
|
1006
|
+
/* @__PURE__ */ t("span", { className: "champ__etiquette", children: "Visible pour" }),
|
|
1007
|
+
/* @__PURE__ */ t("p", { className: "champ__aide", children: "Enregistrez d'abord ce contenu : vous pourrez ensuite choisir qui le voit (membres, clients connectés…)." })
|
|
1008
|
+
] });
|
|
1009
|
+
const A = i !== a.mode || i === "plans" && JSON.stringify([...s].sort()) !== JSON.stringify(a.mode === "plans" ? [...a.plans].sort() : []), M = async () => {
|
|
1010
|
+
if (i === "plans" && s.length === 0) {
|
|
1011
|
+
S({ ton: "erreur", texte: "Cochez au moins un plan." });
|
|
1012
|
+
return;
|
|
1013
|
+
}
|
|
1014
|
+
w(!0), S(null);
|
|
1015
|
+
try {
|
|
1016
|
+
await o.audience(e.UID, i === "plans" ? { mode: i, plans: s } : { mode: i }), await r(), S({ ton: "ok", texte: "Appliqué. " + De[i] });
|
|
1017
|
+
} catch {
|
|
1018
|
+
S({ ton: "erreur", texte: "Le changement n'a pas pu être appliqué." });
|
|
1019
|
+
} finally {
|
|
1020
|
+
w(!1);
|
|
1021
|
+
}
|
|
1022
|
+
}, L = c !== null && c.length === 0;
|
|
1023
|
+
return /* @__PURE__ */ x("div", { className: "champ", "data-audience": !0, children: [
|
|
1024
|
+
/* @__PURE__ */ t("label", { className: "champ__etiquette", htmlFor: "lystech-audience", children: "Visible pour" }),
|
|
1025
|
+
/* @__PURE__ */ t(
|
|
1026
|
+
"select",
|
|
1027
|
+
{
|
|
1028
|
+
id: "lystech-audience",
|
|
1029
|
+
value: i,
|
|
1030
|
+
onChange: (g) => n(g.target.value),
|
|
1031
|
+
disabled: v,
|
|
1032
|
+
children: Object.keys(_e).map((g) => /* @__PURE__ */ t("option", { value: g, disabled: g === "plans" && L, children: _e[g] }, g))
|
|
1033
|
+
}
|
|
1034
|
+
),
|
|
1035
|
+
i === "plans" && /* @__PURE__ */ x("div", { style: { marginTop: 8 }, children: [
|
|
1036
|
+
c === null && /* @__PURE__ */ t("p", { className: "champ__aide", children: "Chargement des plans…" }),
|
|
1037
|
+
c?.map((g) => /* @__PURE__ */ x("label", { style: { display: "flex", gap: 8, alignItems: "center", margin: "4px 0", fontSize: 13 }, children: [
|
|
1038
|
+
/* @__PURE__ */ t(
|
|
1039
|
+
"input",
|
|
1040
|
+
{
|
|
1041
|
+
type: "checkbox",
|
|
1042
|
+
style: { width: "auto" },
|
|
1043
|
+
checked: s.includes(g.UID),
|
|
1044
|
+
onChange: (y) => p((k) => y.target.checked ? [...k, g.UID] : k.filter((E) => E !== g.UID))
|
|
1045
|
+
}
|
|
1046
|
+
),
|
|
1047
|
+
g.name ?? "Plan sans nom"
|
|
1048
|
+
] }, g.UID))
|
|
1049
|
+
] }),
|
|
1050
|
+
/* @__PURE__ */ x("p", { className: "champ__aide", children: [
|
|
1051
|
+
De[i],
|
|
1052
|
+
" Le contenu réservé n'est jamais envoyé aux autres visiteurs.",
|
|
1053
|
+
L ? " (Aucun plan d'abonnement dans cette boutique.)" : ""
|
|
1054
|
+
] }),
|
|
1055
|
+
d && /* @__PURE__ */ t("p", { className: "message message--" + d.ton, children: d.texte }),
|
|
1056
|
+
A && /* @__PURE__ */ t("button", { type: "button", className: "bouton bouton--principal", onClick: M, disabled: v, style: { marginTop: 8 }, children: "Appliquer" })
|
|
1057
|
+
] });
|
|
1058
|
+
}
|
|
1059
|
+
const Tt = Me(() => import("./ModuleBoutique-CgqcQjIb.js")), Lt = Me(() => import("./ApercuMobile-CSoo4dpM.js")), ne = /^i18n:([^:]+):(.*)$/, ge = "commun", xe = "lystech-edit-mode";
|
|
1060
|
+
function Oe(o, e) {
|
|
1061
|
+
return JSON.stringify(o ?? {}) === JSON.stringify(e ?? {});
|
|
1062
|
+
}
|
|
1063
|
+
function _t({ api: o, pont: e }) {
|
|
1064
|
+
const [r, a] = P([]), [i, n] = P([]), [s, p] = P(e.page), [c, u] = P(null), [v, w] = P({}), [d, S] = P(!1), [C, A] = P(() => {
|
|
1065
|
+
try {
|
|
1066
|
+
return window.localStorage.getItem(xe) === "circuler" ? "circuler" : "modifier";
|
|
1067
|
+
} catch {
|
|
1068
|
+
return "modifier";
|
|
1069
|
+
}
|
|
1070
|
+
}), M = () => A((l) => {
|
|
1071
|
+
const b = l === "modifier" ? "circuler" : "modifier";
|
|
1072
|
+
try {
|
|
1073
|
+
window.localStorage.setItem(xe, b);
|
|
1074
|
+
} catch {
|
|
1075
|
+
}
|
|
1076
|
+
return b;
|
|
1077
|
+
}), [L, g] = P(!1), [y, k] = P(
|
|
1078
|
+
null
|
|
1079
|
+
), E = ce(() => bt(o.brut), [o]), [O, U] = P(!1), [m, f] = P(null), [I, Q] = P(!1), [q, H] = P(0);
|
|
1080
|
+
X(() => {
|
|
1081
|
+
let l = !0;
|
|
1082
|
+
return E.droits().then((b) => {
|
|
1083
|
+
l && (U(b), b && E.brouillons().then((h) => l && H(h.produits.length + h.collections.length)).catch(() => {
|
|
1084
|
+
}));
|
|
1085
|
+
}), () => {
|
|
1086
|
+
l = !1;
|
|
1087
|
+
};
|
|
1088
|
+
}, [E]);
|
|
1089
|
+
const Z = V((l) => {
|
|
1090
|
+
f((b) => ({ ...l, n: (b?.n ?? 0) + 1 })), Q(!1), u(null), S(!1);
|
|
1091
|
+
}, []), K = V(
|
|
1092
|
+
(l) => Z(l === null ? { vue: "liste" } : l === "nouveau" ? { vue: "nouveau", collection: null } : { vue: "fiche", UID: l }),
|
|
1093
|
+
[Z]
|
|
1094
|
+
), se = V((l) => Z({ vue: "ajout", collection: l }), [Z]), N = V((l) => Z({ vue: "collection", UID: l }), [Z]), ie = V(() => {
|
|
1095
|
+
f(null), E.brouillons().then((l) => H(l.produits.length + l.collections.length)).catch(() => {
|
|
1096
|
+
});
|
|
1097
|
+
}, [E]);
|
|
1098
|
+
X(() => (e.ouvrirBoutique = O ? (l) => (K(l), !0) : void 0, () => {
|
|
1099
|
+
e.ouvrirBoutique = void 0;
|
|
1100
|
+
}), [e, O, K]);
|
|
1101
|
+
const ae = V((l) => {
|
|
1102
|
+
window.dispatchEvent(new CustomEvent(Ke, { detail: l }));
|
|
1103
|
+
}, []);
|
|
1104
|
+
X(() => (e.surChangementDePage = (l) => {
|
|
1105
|
+
p(l), u(null), S(!1);
|
|
1106
|
+
}, () => {
|
|
1107
|
+
e.surChangementDePage = void 0;
|
|
1108
|
+
}), [e]);
|
|
1109
|
+
const G = V(async () => {
|
|
1110
|
+
try {
|
|
1111
|
+
const [l, b] = await Promise.all([
|
|
1112
|
+
o.pourPage(s),
|
|
1113
|
+
s === ge ? Promise.resolve([]) : o.pourPage(ge)
|
|
1114
|
+
]), h = [...l, ...b];
|
|
1115
|
+
return n(h), h;
|
|
1116
|
+
} catch {
|
|
1117
|
+
return k({
|
|
1118
|
+
ton: "erreur",
|
|
1119
|
+
texte: "Impossible de lire le contenu du site."
|
|
1120
|
+
}), [];
|
|
1121
|
+
}
|
|
1122
|
+
}, [o, s]);
|
|
1123
|
+
X(() => {
|
|
1124
|
+
o.schemas().then(a).catch(() => a([]));
|
|
1125
|
+
}, [o]), X(() => {
|
|
1126
|
+
G();
|
|
1127
|
+
}, [G]);
|
|
1128
|
+
const le = V(
|
|
1129
|
+
(l, b) => {
|
|
1130
|
+
let h = null, T = -1;
|
|
1131
|
+
for (const R of r) {
|
|
1132
|
+
const _ = ne.exec(R.blockType);
|
|
1133
|
+
if (!_ || _[1] !== l) continue;
|
|
1134
|
+
const D = _[2];
|
|
1135
|
+
(D === "" || b === D || b.startsWith(D + ".")) && D.length > T && (h = R, T = D.length);
|
|
1136
|
+
}
|
|
1137
|
+
if (!h) return null;
|
|
1138
|
+
const z = ne.exec(h.blockType)?.[2] ?? "", j = z ? b.slice(z.length + 1) : b;
|
|
1139
|
+
return { bloc: h, champ: j };
|
|
1140
|
+
},
|
|
1141
|
+
[r]
|
|
1142
|
+
), Fe = V(
|
|
1143
|
+
(l, b) => {
|
|
1144
|
+
const h = le(l, b);
|
|
1145
|
+
return h ? (h.bloc.pages ?? []).includes(s) ? 2 : 1 : 0;
|
|
1146
|
+
},
|
|
1147
|
+
[le, s]
|
|
1148
|
+
), $ = V(
|
|
1149
|
+
(l) => r.find((b) => b.blockType === l),
|
|
1150
|
+
[r]
|
|
1151
|
+
), Ae = ce(
|
|
1152
|
+
() => r.filter((l) => {
|
|
1153
|
+
const b = l.pages ?? [];
|
|
1154
|
+
return b.includes(s) || b.includes(ge);
|
|
1155
|
+
}),
|
|
1156
|
+
[r, s]
|
|
1157
|
+
), B = ce(
|
|
1158
|
+
() => i.filter((l) => l.draft && !Oe(l.draft, l.data)),
|
|
1159
|
+
[i]
|
|
1160
|
+
);
|
|
1161
|
+
X(() => {
|
|
1162
|
+
if (B.length === 0) return;
|
|
1163
|
+
for (const h of B)
|
|
1164
|
+
ne.test(h.blockType) || e.poserApercu(h.blockType, h.draft);
|
|
1165
|
+
const l = B.filter((h) => ne.test(h.blockType)), b = e.sourceTexte;
|
|
1166
|
+
l.length && b && import("./sourceTexte-BMPMpNg9.js").then(
|
|
1167
|
+
({ appliquerAuxTextes: h }) => h(
|
|
1168
|
+
l.map((T) => ({ blockType: T.blockType, data: T.draft })),
|
|
1169
|
+
b
|
|
1170
|
+
)
|
|
1171
|
+
);
|
|
1172
|
+
}, [B, e]);
|
|
1173
|
+
const Qe = V(
|
|
1174
|
+
async (l, b, h, T) => {
|
|
1175
|
+
const z = le(l, b);
|
|
1176
|
+
if (!z) {
|
|
1177
|
+
k({
|
|
1178
|
+
ton: "erreur",
|
|
1179
|
+
texte: `Ce texte (${l}:${b}) n'appartient à aucun bloc déclaré.`
|
|
1180
|
+
});
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
const j = i.find((F) => F.blockType === z.bloc.blockType), R = j?.draft ?? j?.data ?? {}, _ = R[z.champ], D = z.bloc.fields.find((F) => F.key === z.champ), W = (
|
|
1184
|
+
/* `!declare.localized` et non `=== false` : un champ non traduit
|
|
1185
|
+
OMET la cle plutot que de la mettre a faux. Tester l'egalite
|
|
1186
|
+
stricte ne se declenchait donc jamais. */
|
|
1187
|
+
D && !D.localized ? T : _ && typeof _ == "object" && !Array.isArray(_) ? { ..._, [h]: T } : { [h]: T }
|
|
1188
|
+
), J = { ...R, [z.champ]: W };
|
|
1189
|
+
try {
|
|
1190
|
+
if (j?.UID)
|
|
1191
|
+
await o.enregistrerBrouillon(j.UID, J);
|
|
1192
|
+
else {
|
|
1193
|
+
const F = z.bloc.pages?.[0] ?? s;
|
|
1194
|
+
await o.creer(F, z.bloc.blockType, J);
|
|
1195
|
+
}
|
|
1196
|
+
await G(), k(null);
|
|
1197
|
+
} catch {
|
|
1198
|
+
k({
|
|
1199
|
+
ton: "erreur",
|
|
1200
|
+
texte: "Enregistrement impossible. Votre texte est toujours à l'écran."
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
},
|
|
1204
|
+
[o, le, s, G, i]
|
|
1205
|
+
), Ve = V(
|
|
1206
|
+
(l, b) => {
|
|
1207
|
+
const h = $(l), T = h?.fields.find((D) => D.key === b);
|
|
1208
|
+
if (!h || !T) return null;
|
|
1209
|
+
const z = i.find((D) => D.blockType === l);
|
|
1210
|
+
let _ = {
|
|
1211
|
+
...e.replis?.[l] ?? {},
|
|
1212
|
+
...z?.data ?? {},
|
|
1213
|
+
...z?.draft ?? {}
|
|
1214
|
+
}[b];
|
|
1215
|
+
return T.localized && _ && typeof _ == "object" && !Array.isArray(_) && (_ = _[e.langue]), { libelle: T.label, type: T.type, valeur: _ };
|
|
1216
|
+
},
|
|
1217
|
+
[$, i, e]
|
|
1218
|
+
), Ye = V(
|
|
1219
|
+
async (l, b, h) => {
|
|
1220
|
+
const T = $(l), z = T?.fields.find((F) => F.key === b);
|
|
1221
|
+
if (!T || !z) return !1;
|
|
1222
|
+
const j = i.find((F) => F.blockType === l), _ = {
|
|
1223
|
+
...e.replis?.[l] ?? {},
|
|
1224
|
+
...j?.data ?? {},
|
|
1225
|
+
...j?.draft ?? {}
|
|
1226
|
+
}, D = _[b], W = z.localized ? {
|
|
1227
|
+
...D && typeof D == "object" && !Array.isArray(D) ? D : {},
|
|
1228
|
+
[e.langue]: h
|
|
1229
|
+
} : h, J = { ..._, [b]: W };
|
|
1230
|
+
try {
|
|
1231
|
+
return j?.UID ? await o.enregistrerBrouillon(j.UID, J) : await o.creer(T.pages?.[0] ?? s, l, J), await G(), e.poserApercu(l, J), k(null), !0;
|
|
1232
|
+
} catch {
|
|
1233
|
+
return k({
|
|
1234
|
+
ton: "erreur",
|
|
1235
|
+
texte: "Enregistrement impossible. La valeur en ligne n'a pas changé."
|
|
1236
|
+
}), !1;
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1239
|
+
[o, s, e, G, $, i]
|
|
1240
|
+
), Ce = async () => {
|
|
1241
|
+
if (!B.length) return !0;
|
|
1242
|
+
g(!0), k(null);
|
|
1243
|
+
const l = B.length;
|
|
1244
|
+
try {
|
|
1245
|
+
for (const b of B) await o.publier(b.UID);
|
|
1246
|
+
await G();
|
|
1247
|
+
for (const b of B) e.poserApercu(b.blockType, null);
|
|
1248
|
+
return e.recharger(), k({
|
|
1249
|
+
ton: "ok",
|
|
1250
|
+
texte: l === 1 ? "Publié. Vos visiteurs le voient maintenant." : `${l} modifications publiées.`
|
|
1251
|
+
}), !0;
|
|
1252
|
+
} catch {
|
|
1253
|
+
return k({
|
|
1254
|
+
ton: "erreur",
|
|
1255
|
+
texte: "La publication a échoué. Rien n'a été mis en ligne."
|
|
1256
|
+
}), !1;
|
|
1257
|
+
} finally {
|
|
1258
|
+
g(!1);
|
|
1259
|
+
}
|
|
1260
|
+
}, Xe = async () => {
|
|
1261
|
+
g(!0);
|
|
1262
|
+
try {
|
|
1263
|
+
const l = B.map((h) => h.blockType);
|
|
1264
|
+
for (const h of B) await o.annuler(h.UID);
|
|
1265
|
+
const b = await G();
|
|
1266
|
+
for (const h of l) e.poserApercu(h, null);
|
|
1267
|
+
if (e.sourceTexte) {
|
|
1268
|
+
const { appliquerAuxTextes: h } = await import("./sourceTexte-BMPMpNg9.js");
|
|
1269
|
+
h(
|
|
1270
|
+
b.map((T) => ({ blockType: T.blockType, data: T.data })),
|
|
1271
|
+
e.sourceTexte
|
|
1272
|
+
);
|
|
1273
|
+
}
|
|
1274
|
+
k({
|
|
1275
|
+
ton: "info",
|
|
1276
|
+
texte: "Modifications abandonnées. On est revenu à ce qui est en ligne."
|
|
1277
|
+
});
|
|
1278
|
+
} finally {
|
|
1279
|
+
g(!1);
|
|
1280
|
+
}
|
|
1281
|
+
}, we = (l) => {
|
|
1282
|
+
const b = i.find((R) => R.blockType === l), h = b?.draft ?? b?.data ?? {}, T = $(l), z = ne.exec(l), j = {};
|
|
1283
|
+
if (!z) {
|
|
1284
|
+
const R = e.replis?.[l];
|
|
1285
|
+
R && typeof R == "object" && !Array.isArray(R) && Object.assign(j, R);
|
|
1286
|
+
}
|
|
1287
|
+
if (z && T && e.sourceTexte) {
|
|
1288
|
+
const R = z[1], _ = z[2], D = e.sourceTexte.langues(), W = {};
|
|
1289
|
+
for (const F of D)
|
|
1290
|
+
W[F] = e.sourceTexte.dictionnaire(F)[R] ?? {};
|
|
1291
|
+
const J = e.sourceTexte.langueCourante();
|
|
1292
|
+
for (const F of T.fields) {
|
|
1293
|
+
const ue = _ ? _ + "." + F.key : F.key;
|
|
1294
|
+
if (!F.localized) {
|
|
1295
|
+
const re = W[J]?.[ue] ?? D.map((te) => W[te]?.[ue]).find((te) => typeof te == "string");
|
|
1296
|
+
typeof re == "string" && (j[F.key] = re);
|
|
1297
|
+
continue;
|
|
1298
|
+
}
|
|
1299
|
+
const de = {};
|
|
1300
|
+
for (const re of D) {
|
|
1301
|
+
const te = W[re]?.[ue];
|
|
1302
|
+
typeof te == "string" && (de[re] = te);
|
|
1303
|
+
}
|
|
1304
|
+
Object.keys(de).length && (j[F.key] = de);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
for (const [R, _] of Object.entries(h)) {
|
|
1308
|
+
const D = j[R], W = _ && typeof _ == "object" && !Array.isArray(_) && D && typeof D == "object" && !Array.isArray(D);
|
|
1309
|
+
j[R] = W ? { ...D, ..._ } : _;
|
|
1310
|
+
}
|
|
1311
|
+
w(j), u(l), S(!1), k(null);
|
|
1312
|
+
}, He = (l, b) => w((h) => ({ ...h, [l]: b })), We = async () => {
|
|
1313
|
+
if (c) {
|
|
1314
|
+
g(!0);
|
|
1315
|
+
try {
|
|
1316
|
+
const l = i.find((h) => h.blockType === c);
|
|
1317
|
+
if (l?.UID) await o.enregistrerBrouillon(l.UID, v);
|
|
1318
|
+
else {
|
|
1319
|
+
const h = $(c)?.pages?.[0] ?? s;
|
|
1320
|
+
await o.creer(h, c, v);
|
|
1321
|
+
}
|
|
1322
|
+
const b = await G();
|
|
1323
|
+
if (e.sourceTexte) {
|
|
1324
|
+
const { appliquerAuxTextes: h } = await import("./sourceTexte-BMPMpNg9.js");
|
|
1325
|
+
h(
|
|
1326
|
+
b.map((T) => ({ blockType: T.blockType, data: T.draft ?? T.data })),
|
|
1327
|
+
e.sourceTexte
|
|
1328
|
+
);
|
|
1329
|
+
}
|
|
1330
|
+
ne.test(c) || e.poserApercu(c, v), k({
|
|
1331
|
+
ton: "ok",
|
|
1332
|
+
texte: "Enregistré. Rien n'a encore changé pour vos visiteurs."
|
|
1333
|
+
});
|
|
1334
|
+
} catch {
|
|
1335
|
+
k({ ton: "erreur", texte: "L'enregistrement a échoué." });
|
|
1336
|
+
} finally {
|
|
1337
|
+
g(!1);
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
}, Ge = () => {
|
|
1341
|
+
try {
|
|
1342
|
+
window.localStorage.removeItem(xe);
|
|
1343
|
+
} catch {
|
|
1344
|
+
}
|
|
1345
|
+
Pe();
|
|
1346
|
+
}, ee = c ? $(c) : void 0, oe = !c && !d && !m && !I, Ze = ce(
|
|
1347
|
+
() => B.map((l) => ({ blockType: l.blockType, data: l.draft })),
|
|
1348
|
+
[B]
|
|
1349
|
+
);
|
|
1350
|
+
return /* @__PURE__ */ x("div", { className: "calque", children: [
|
|
1351
|
+
/* @__PURE__ */ t(
|
|
1352
|
+
"div",
|
|
1353
|
+
{
|
|
1354
|
+
className: "cadre-global" + (C === "circuler" ? " cadre-global--circuler" : ""),
|
|
1355
|
+
"aria-hidden": "true"
|
|
1356
|
+
}
|
|
1357
|
+
),
|
|
1358
|
+
e.sourceTexte && /* @__PURE__ */ t(
|
|
1359
|
+
Nt,
|
|
1360
|
+
{
|
|
1361
|
+
source: e.sourceTexte,
|
|
1362
|
+
actif: oe && !L && C === "modifier",
|
|
1363
|
+
pertinence: Fe,
|
|
1364
|
+
surModification: Qe
|
|
1365
|
+
}
|
|
1366
|
+
),
|
|
1367
|
+
/* @__PURE__ */ t(
|
|
1368
|
+
ft,
|
|
1369
|
+
{
|
|
1370
|
+
actif: oe && !L && C === "modifier",
|
|
1371
|
+
lire: Ve,
|
|
1372
|
+
enregistrer: Ye,
|
|
1373
|
+
ouvrirPanneau: we
|
|
1374
|
+
}
|
|
1375
|
+
),
|
|
1376
|
+
/* @__PURE__ */ t(
|
|
1377
|
+
Ct,
|
|
1378
|
+
{
|
|
1379
|
+
crayons: O && oe && !L && C === "modifier",
|
|
1380
|
+
carte: O && C === "modifier",
|
|
1381
|
+
ouvrirProduit: K,
|
|
1382
|
+
ouvrirAjout: se,
|
|
1383
|
+
ouvrirCollection: N
|
|
1384
|
+
}
|
|
1385
|
+
),
|
|
1386
|
+
m && /* @__PURE__ */ t(ke, { fallback: /* @__PURE__ */ t("div", { className: "panneau", children: /* @__PURE__ */ t("p", { className: "panneau__corps", children: "Chargement de la boutique…" }) }), children: /* @__PURE__ */ t(
|
|
1387
|
+
Tt,
|
|
1388
|
+
{
|
|
1389
|
+
api: E,
|
|
1390
|
+
demande: m,
|
|
1391
|
+
signaler: ae,
|
|
1392
|
+
surFermer: ie,
|
|
1393
|
+
textes: B.length,
|
|
1394
|
+
publierTextes: Ce,
|
|
1395
|
+
surCompteBrouillons: H
|
|
1396
|
+
}
|
|
1397
|
+
) }),
|
|
1398
|
+
I && /* @__PURE__ */ t(ke, { fallback: /* @__PURE__ */ t("div", { className: "apercu", children: /* @__PURE__ */ t("p", { children: "Préparation de l'aperçu…" }) }), children: /* @__PURE__ */ t(Lt, { brouillons: Ze, surFermer: () => Q(!1) }) }),
|
|
1399
|
+
oe && /* @__PURE__ */ x("div", { className: "barre", children: [
|
|
1400
|
+
/* @__PURE__ */ t("span", { className: "barre__point" }),
|
|
1401
|
+
/* @__PURE__ */ t("span", { className: "barre__texte", children: C === "modifier" ? "Cliquez un texte pour le corriger" : "Navigation libre — les clics ouvrent les liens" }),
|
|
1402
|
+
/* @__PURE__ */ t(
|
|
1403
|
+
"button",
|
|
1404
|
+
{
|
|
1405
|
+
type: "button",
|
|
1406
|
+
className: "bouton " + (C === "circuler" ? "bouton--principal" : ""),
|
|
1407
|
+
onClick: M,
|
|
1408
|
+
title: C === "modifier" ? "Passer en navigation pour changer de page" : "Revenir a la modification des textes",
|
|
1409
|
+
children: C === "modifier" ? "Circuler" : "Modifier"
|
|
1410
|
+
}
|
|
1411
|
+
),
|
|
1412
|
+
O && /* @__PURE__ */ x(
|
|
1413
|
+
"button",
|
|
1414
|
+
{
|
|
1415
|
+
type: "button",
|
|
1416
|
+
className: "bouton",
|
|
1417
|
+
onClick: () => K(null),
|
|
1418
|
+
title: "Vos bijoux",
|
|
1419
|
+
"aria-label": "Boutique : vos bijoux et vos collections",
|
|
1420
|
+
children: [
|
|
1421
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: "◇" }),
|
|
1422
|
+
/* @__PURE__ */ t("span", { className: "barre__libelle", children: " Boutique" })
|
|
1423
|
+
]
|
|
1424
|
+
}
|
|
1425
|
+
),
|
|
1426
|
+
O && /* @__PURE__ */ x(
|
|
1427
|
+
"button",
|
|
1428
|
+
{
|
|
1429
|
+
type: "button",
|
|
1430
|
+
className: "bouton bouton--bureau-seul",
|
|
1431
|
+
onClick: () => Z({ vue: "liste", onglet: "collections" }),
|
|
1432
|
+
title: "Vos collections : les ouvrir, les fermer, les garnir",
|
|
1433
|
+
children: [
|
|
1434
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: "▦" }),
|
|
1435
|
+
" Collections"
|
|
1436
|
+
]
|
|
1437
|
+
}
|
|
1438
|
+
),
|
|
1439
|
+
/* @__PURE__ */ t(
|
|
1440
|
+
"button",
|
|
1441
|
+
{
|
|
1442
|
+
type: "button",
|
|
1443
|
+
className: "bouton bouton--bureau-seul",
|
|
1444
|
+
onClick: () => Q(!0),
|
|
1445
|
+
title: "Voir la page comme sur un téléphone",
|
|
1446
|
+
children: "Mobile"
|
|
1447
|
+
}
|
|
1448
|
+
),
|
|
1449
|
+
B.length + q > 0 ? /* @__PURE__ */ x(Ie, { children: [
|
|
1450
|
+
/* @__PURE__ */ x("span", { className: "barre__compte", children: [
|
|
1451
|
+
[
|
|
1452
|
+
B.length ? B.length === 1 ? "1 texte" : `${B.length} textes` : "",
|
|
1453
|
+
q ? q === 1 ? "1 brouillon" : `${q} brouillons` : ""
|
|
1454
|
+
].filter(Boolean).join(" · "),
|
|
1455
|
+
" ",
|
|
1456
|
+
"non publiés"
|
|
1457
|
+
] }),
|
|
1458
|
+
/* @__PURE__ */ x(
|
|
1459
|
+
"button",
|
|
1460
|
+
{
|
|
1461
|
+
type: "button",
|
|
1462
|
+
className: "bouton bouton--principal",
|
|
1463
|
+
onClick: () => q > 0 ? Z({ vue: "publier" }) : void Ce(),
|
|
1464
|
+
disabled: L,
|
|
1465
|
+
"aria-label": `Publier : ${B.length + q} en attente`,
|
|
1466
|
+
children: [
|
|
1467
|
+
"Publier ",
|
|
1468
|
+
/* @__PURE__ */ t("span", { className: "barre__pastille", children: B.length + q })
|
|
1469
|
+
]
|
|
1470
|
+
}
|
|
1471
|
+
),
|
|
1472
|
+
B.length > 0 && /* @__PURE__ */ t(
|
|
1473
|
+
"button",
|
|
1474
|
+
{
|
|
1475
|
+
type: "button",
|
|
1476
|
+
className: "bouton bouton--discret",
|
|
1477
|
+
onClick: Xe,
|
|
1478
|
+
disabled: L,
|
|
1479
|
+
title: "Abandonner les textes non publiés",
|
|
1480
|
+
children: "Abandonner"
|
|
1481
|
+
}
|
|
1482
|
+
)
|
|
1483
|
+
] }) : /* @__PURE__ */ t("span", { className: "barre__compte", children: "tout est publié" }),
|
|
1484
|
+
/* @__PURE__ */ t(
|
|
1485
|
+
"button",
|
|
1486
|
+
{
|
|
1487
|
+
type: "button",
|
|
1488
|
+
className: "bouton bouton--icone bouton--discret",
|
|
1489
|
+
onClick: () => S(!0),
|
|
1490
|
+
title: "Tous les contenus",
|
|
1491
|
+
"aria-label": "Tous les contenus",
|
|
1492
|
+
children: "⋮"
|
|
1493
|
+
}
|
|
1494
|
+
),
|
|
1495
|
+
/* @__PURE__ */ t(
|
|
1496
|
+
"button",
|
|
1497
|
+
{
|
|
1498
|
+
type: "button",
|
|
1499
|
+
className: "bouton bouton--icone bouton--sortie",
|
|
1500
|
+
onClick: Ge,
|
|
1501
|
+
title: "Quitter le mode édition",
|
|
1502
|
+
"aria-label": "Quitter le mode édition",
|
|
1503
|
+
children: "✕"
|
|
1504
|
+
}
|
|
1505
|
+
)
|
|
1506
|
+
] }),
|
|
1507
|
+
y && oe && /* @__PURE__ */ t("div", { className: "flottant", children: /* @__PURE__ */ t("p", { className: "message message--" + y.ton, children: y.texte }) }),
|
|
1508
|
+
d && /* @__PURE__ */ x("div", { className: "panneau", role: "dialog", "aria-label": "Tous les contenus", children: [
|
|
1509
|
+
/* @__PURE__ */ x("div", { className: "panneau__tete", children: [
|
|
1510
|
+
/* @__PURE__ */ x("div", { style: { flex: 1 }, children: [
|
|
1511
|
+
/* @__PURE__ */ t("h2", { className: "panneau__titre", children: "Tous les contenus" }),
|
|
1512
|
+
/* @__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." })
|
|
1513
|
+
] }),
|
|
1514
|
+
/* @__PURE__ */ t(
|
|
1515
|
+
"button",
|
|
1516
|
+
{
|
|
1517
|
+
type: "button",
|
|
1518
|
+
className: "bouton bouton--icone bouton--discret",
|
|
1519
|
+
onClick: () => S(!1),
|
|
1520
|
+
"aria-label": "Fermer",
|
|
1521
|
+
children: "✕"
|
|
1522
|
+
}
|
|
1523
|
+
)
|
|
1524
|
+
] }),
|
|
1525
|
+
/* @__PURE__ */ x("div", { className: "panneau__corps", children: [
|
|
1526
|
+
Ae.length === 0 && /* @__PURE__ */ t("p", { className: "message message--info", children: "Aucun contenu déclaré pour cette page." }),
|
|
1527
|
+
Ae.map((l) => {
|
|
1528
|
+
const b = i.find((T) => T.blockType === l.blockType), h = b?.draft && !Oe(b.draft, b.data);
|
|
1529
|
+
return /* @__PURE__ */ x(
|
|
1530
|
+
"button",
|
|
1531
|
+
{
|
|
1532
|
+
type: "button",
|
|
1533
|
+
className: "rangee",
|
|
1534
|
+
onClick: () => we(l.blockType),
|
|
1535
|
+
children: [
|
|
1536
|
+
/* @__PURE__ */ t("span", { className: "rangee__nom", children: l.label }),
|
|
1537
|
+
/* @__PURE__ */ t("span", { className: "rangee__info", children: h ? "non publié" : `${l.fields.length} textes` })
|
|
1538
|
+
]
|
|
1539
|
+
},
|
|
1540
|
+
l.blockType
|
|
1541
|
+
);
|
|
1542
|
+
})
|
|
1543
|
+
] })
|
|
1544
|
+
] }),
|
|
1545
|
+
c && ee && /* @__PURE__ */ x(
|
|
1546
|
+
"div",
|
|
1547
|
+
{
|
|
1548
|
+
className: "panneau",
|
|
1549
|
+
role: "dialog",
|
|
1550
|
+
"aria-label": "Modifier " + ee.label,
|
|
1551
|
+
children: [
|
|
1552
|
+
/* @__PURE__ */ x("div", { className: "panneau__tete", children: [
|
|
1553
|
+
/* @__PURE__ */ x("div", { style: { flex: 1 }, children: [
|
|
1554
|
+
/* @__PURE__ */ t("h2", { className: "panneau__titre", children: ee.label }),
|
|
1555
|
+
ee.description && /* @__PURE__ */ t("p", { className: "panneau__sous", children: ee.description })
|
|
1556
|
+
] }),
|
|
1557
|
+
/* @__PURE__ */ t(
|
|
1558
|
+
"button",
|
|
1559
|
+
{
|
|
1560
|
+
type: "button",
|
|
1561
|
+
className: "bouton bouton--icone bouton--discret",
|
|
1562
|
+
onClick: () => u(null),
|
|
1563
|
+
"aria-label": "Fermer",
|
|
1564
|
+
children: "✕"
|
|
1565
|
+
}
|
|
1566
|
+
)
|
|
1567
|
+
] }),
|
|
1568
|
+
/* @__PURE__ */ x("div", { className: "panneau__corps", children: [
|
|
1569
|
+
y && /* @__PURE__ */ t("p", { className: "message message--" + y.ton, children: y.texte }),
|
|
1570
|
+
/* @__PURE__ */ t(
|
|
1571
|
+
St,
|
|
1572
|
+
{
|
|
1573
|
+
api: o,
|
|
1574
|
+
section: i.find((l) => l.blockType === c) ?? null,
|
|
1575
|
+
apresChangement: async () => {
|
|
1576
|
+
await G(), e.recharger();
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
),
|
|
1580
|
+
ee.fields.map((l) => /* @__PURE__ */ t(
|
|
1581
|
+
ze,
|
|
1582
|
+
{
|
|
1583
|
+
champ: l,
|
|
1584
|
+
langue: e.langue,
|
|
1585
|
+
valeur: v[l.key],
|
|
1586
|
+
changer: (b) => He(l.key, b)
|
|
1587
|
+
},
|
|
1588
|
+
l.key
|
|
1589
|
+
))
|
|
1590
|
+
] }),
|
|
1591
|
+
/* @__PURE__ */ x("div", { className: "panneau__pied", children: [
|
|
1592
|
+
/* @__PURE__ */ t(
|
|
1593
|
+
"button",
|
|
1594
|
+
{
|
|
1595
|
+
type: "button",
|
|
1596
|
+
className: "bouton bouton--discret",
|
|
1597
|
+
onClick: () => u(null),
|
|
1598
|
+
disabled: L,
|
|
1599
|
+
children: "Fermer"
|
|
1600
|
+
}
|
|
1601
|
+
),
|
|
1602
|
+
/* @__PURE__ */ t("span", { className: "espace" }),
|
|
1603
|
+
/* @__PURE__ */ t(
|
|
1604
|
+
"button",
|
|
1605
|
+
{
|
|
1606
|
+
type: "button",
|
|
1607
|
+
className: "bouton bouton--principal",
|
|
1608
|
+
onClick: We,
|
|
1609
|
+
disabled: L,
|
|
1610
|
+
children: "Enregistrer"
|
|
1611
|
+
}
|
|
1612
|
+
)
|
|
1613
|
+
] })
|
|
1614
|
+
]
|
|
1615
|
+
}
|
|
1616
|
+
)
|
|
1617
|
+
] });
|
|
1618
|
+
}
|
|
1619
|
+
const Dt = `
|
|
1620
|
+
:host {
|
|
1621
|
+
all: initial;
|
|
1622
|
+
--fond: #16181d;
|
|
1623
|
+
--fond-clair: #21242b;
|
|
1624
|
+
--bord: #333844;
|
|
1625
|
+
--texte: #f2f3f5;
|
|
1626
|
+
--texte-doux: #a3a9b6;
|
|
1627
|
+
--accent: #3ba58d;
|
|
1628
|
+
--accent-sombre: #2d8570;
|
|
1629
|
+
--danger: #d9776a;
|
|
1630
|
+
font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
|
|
1631
|
+
"Helvetica Neue", Arial, sans-serif;
|
|
1632
|
+
font-size: 14px;
|
|
1633
|
+
line-height: 1.45;
|
|
1634
|
+
color: var(--texte);
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
* { box-sizing: border-box; }
|
|
1638
|
+
|
|
1639
|
+
/* LE CALQUE LAISSE PASSER LES CLICS. Un conteneur fixe en plein écran qui
|
|
1640
|
+
intercepte tout rendrait le site inutilisable derrière lui : on ne pourrait
|
|
1641
|
+
plus naviguer, ni même faire défiler correctement. Seuls ses ENFANTS
|
|
1642
|
+
reprennent les clics. */
|
|
1643
|
+
.calque {
|
|
1644
|
+
position: fixed;
|
|
1645
|
+
inset: 0;
|
|
1646
|
+
pointer-events: none;
|
|
1647
|
+
z-index: 2147483000;
|
|
1648
|
+
}
|
|
1649
|
+
.calque > * { pointer-events: auto; }
|
|
1650
|
+
|
|
1651
|
+
/* ---------------------------------------------------------- CADRES ------ */
|
|
1652
|
+
|
|
1653
|
+
.cadre {
|
|
1654
|
+
position: fixed;
|
|
1655
|
+
border: 2px dashed rgba(59, 165, 141, 0.55);
|
|
1656
|
+
border-radius: 6px;
|
|
1657
|
+
pointer-events: none;
|
|
1658
|
+
transition: border-color 120ms ease;
|
|
1659
|
+
}
|
|
1660
|
+
.cadre--actif { border-color: var(--accent); border-style: solid; }
|
|
1661
|
+
|
|
1662
|
+
.pastille {
|
|
1663
|
+
position: fixed;
|
|
1664
|
+
display: inline-flex;
|
|
1665
|
+
align-items: center;
|
|
1666
|
+
gap: 6px;
|
|
1667
|
+
padding: 5px 10px;
|
|
1668
|
+
border: 0;
|
|
1669
|
+
border-radius: 999px;
|
|
1670
|
+
background: var(--accent);
|
|
1671
|
+
color: #06120e;
|
|
1672
|
+
font-size: 12px;
|
|
1673
|
+
font-weight: 650;
|
|
1674
|
+
letter-spacing: 0.01em;
|
|
1675
|
+
cursor: pointer;
|
|
1676
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
|
|
1677
|
+
}
|
|
1678
|
+
.pastille:hover { background: #45bda2; }
|
|
1679
|
+
.pastille:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
|
|
1680
|
+
|
|
1681
|
+
/* ------------------------------------------------------------ BARRE ----- */
|
|
1682
|
+
|
|
1683
|
+
.barre {
|
|
1684
|
+
position: fixed;
|
|
1685
|
+
left: 50%;
|
|
1686
|
+
bottom: 18px;
|
|
1687
|
+
transform: translateX(-50%);
|
|
1688
|
+
display: flex;
|
|
1689
|
+
align-items: center;
|
|
1690
|
+
gap: 14px;
|
|
1691
|
+
padding: 9px 14px;
|
|
1692
|
+
border: 1px solid var(--bord);
|
|
1693
|
+
border-radius: 999px;
|
|
1694
|
+
background: var(--fond);
|
|
1695
|
+
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
|
|
1696
|
+
max-width: calc(100vw - 24px);
|
|
1697
|
+
}
|
|
1698
|
+
.barre__point {
|
|
1699
|
+
width: 8px; height: 8px; border-radius: 50%;
|
|
1700
|
+
background: var(--accent);
|
|
1701
|
+
flex: none;
|
|
1702
|
+
}
|
|
1703
|
+
.barre__texte { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
1704
|
+
.barre__texte b { font-weight: 650; }
|
|
1705
|
+
.barre__compte { color: var(--texte-doux); font-size: 12px; white-space: nowrap; }
|
|
1706
|
+
|
|
1707
|
+
/* ----------------------------------------------------------- PANNEAU ---- */
|
|
1708
|
+
|
|
1709
|
+
.panneau {
|
|
1710
|
+
position: fixed;
|
|
1711
|
+
top: 0; right: 0; bottom: 0;
|
|
1712
|
+
width: min(420px, 100vw);
|
|
1713
|
+
display: flex;
|
|
1714
|
+
flex-direction: column;
|
|
1715
|
+
background: var(--fond);
|
|
1716
|
+
border-left: 1px solid var(--bord);
|
|
1717
|
+
box-shadow: -12px 0 40px rgba(0, 0, 0, 0.4);
|
|
1718
|
+
}
|
|
1719
|
+
@media (max-width: 520px) {
|
|
1720
|
+
.panneau { top: auto; height: 78vh; border-left: 0; border-top: 1px solid var(--bord); }
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
.panneau__tete {
|
|
1724
|
+
display: flex; align-items: flex-start; gap: 10px;
|
|
1725
|
+
padding: 16px 16px 12px;
|
|
1726
|
+
border-bottom: 1px solid var(--bord);
|
|
1727
|
+
}
|
|
1728
|
+
.panneau__titre { font-size: 15px; font-weight: 650; margin: 0; }
|
|
1729
|
+
.panneau__sous { margin: 3px 0 0; font-size: 12px; color: var(--texte-doux); }
|
|
1730
|
+
.panneau__corps { flex: 1; overflow-y: auto; padding: 14px 16px 18px; }
|
|
1731
|
+
.panneau__pied {
|
|
1732
|
+
display: flex; gap: 8px; align-items: center;
|
|
1733
|
+
padding: 12px 16px;
|
|
1734
|
+
border-top: 1px solid var(--bord);
|
|
1735
|
+
background: var(--fond-clair);
|
|
1736
|
+
}
|
|
1737
|
+
.panneau__pied .espace { flex: 1; }
|
|
1738
|
+
|
|
1739
|
+
/* --------------------------------------------------- CONNEXION ---------- */
|
|
1740
|
+
|
|
1741
|
+
/* LA CONNEXION EST CLAIRE, AUX COULEURS DE LYSTECH. L'éditeur reste un outil
|
|
1742
|
+
sombre qui s'efface derrière le travail ; la connexion, elle, est l'instant
|
|
1743
|
+
où quelqu'un décide de faire confiance. Il doit y reconnaître Lystech — la
|
|
1744
|
+
fleur, son pétrole et son turquoise, sur du blanc — et non une boîte noire
|
|
1745
|
+
posée sur son site.
|
|
1746
|
+
|
|
1747
|
+
Le thème se redéfinit ICI, sur le voile : les boutons, messages et champs
|
|
1748
|
+
partagés avec l'éditeur suivent ces variables sans une règle de plus, et
|
|
1749
|
+
l'éditeur garde les siennes. Clair quel que soit le thème du système :
|
|
1750
|
+
c'est un choix de marque. */
|
|
1751
|
+
.voile {
|
|
1752
|
+
--fond: #ffffff;
|
|
1753
|
+
--fond-clair: #f4f7f8;
|
|
1754
|
+
--bord: #dfe6e9;
|
|
1755
|
+
--texte: #0b1f26;
|
|
1756
|
+
--texte-doux: #52666f;
|
|
1757
|
+
--petrole: #084050;
|
|
1758
|
+
--petrole-survol: #0b5468;
|
|
1759
|
+
--turquoise: #10b8b0;
|
|
1760
|
+
--focus: #0c8f89;
|
|
1761
|
+
|
|
1762
|
+
position: fixed;
|
|
1763
|
+
inset: 0;
|
|
1764
|
+
display: flex;
|
|
1765
|
+
align-items: center;
|
|
1766
|
+
justify-content: center;
|
|
1767
|
+
padding: 16px;
|
|
1768
|
+
/* Le voile PREND les clics, lui : une boîte de dialogue qui demande une
|
|
1769
|
+
identité ne doit pas laisser cliquer la page derrière elle. C'est
|
|
1770
|
+
l'exception à la règle du calque, et elle est volontaire. Teinté pétrole
|
|
1771
|
+
plutôt que noir : on assombrit le site sans l'éteindre. */
|
|
1772
|
+
background: rgba(8, 44, 56, 0.34);
|
|
1773
|
+
backdrop-filter: blur(4px) saturate(115%);
|
|
1774
|
+
color: var(--texte);
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
.fenetre {
|
|
1778
|
+
position: relative;
|
|
1779
|
+
width: min(400px, 100%);
|
|
1780
|
+
max-height: 92vh;
|
|
1781
|
+
overflow-y: auto;
|
|
1782
|
+
padding: 34px 30px 26px;
|
|
1783
|
+
border: 1px solid rgba(8, 64, 80, 0.10);
|
|
1784
|
+
border-radius: 20px;
|
|
1785
|
+
/* La lueur turquoise de la fleur, à peine, en haut de la carte. */
|
|
1786
|
+
background:
|
|
1787
|
+
radial-gradient(90% 60% at 50% -12%, rgba(16, 184, 176, 0.13), transparent 70%),
|
|
1788
|
+
var(--fond);
|
|
1789
|
+
box-shadow:
|
|
1790
|
+
0 1px 2px rgba(8, 64, 80, 0.06),
|
|
1791
|
+
0 28px 64px -18px rgba(8, 44, 56, 0.45);
|
|
1792
|
+
text-align: center;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
.fenetre__fermer {
|
|
1796
|
+
position: absolute; top: 14px; right: 14px;
|
|
1797
|
+
width: 32px; height: 32px;
|
|
1798
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
1799
|
+
border: 0; border-radius: 9px;
|
|
1800
|
+
background: transparent; color: var(--texte-doux);
|
|
1801
|
+
font: inherit; font-size: 14px; cursor: pointer;
|
|
1802
|
+
}
|
|
1803
|
+
.fenetre__fermer:hover { background: var(--fond-clair); color: var(--texte); }
|
|
1804
|
+
.fenetre__fermer:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
|
|
1805
|
+
|
|
1806
|
+
/* ------------------------------------------------------------ MARQUE ---- */
|
|
1807
|
+
|
|
1808
|
+
.marque {
|
|
1809
|
+
display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
|
|
1810
|
+
margin-bottom: 18px;
|
|
1811
|
+
}
|
|
1812
|
+
.marque img {
|
|
1813
|
+
width: 44px; height: 44px; display: block;
|
|
1814
|
+
filter: drop-shadow(0 6px 14px rgba(16, 184, 176, 0.28));
|
|
1815
|
+
}
|
|
1816
|
+
.marque__mot {
|
|
1817
|
+
font-size: 11.5px; font-weight: 700;
|
|
1818
|
+
letter-spacing: 0.24em; text-transform: uppercase;
|
|
1819
|
+
color: var(--petrole);
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
.fenetre__titre {
|
|
1823
|
+
margin: 0 0 8px;
|
|
1824
|
+
font-size: 21px; font-weight: 700; letter-spacing: -0.015em;
|
|
1825
|
+
color: var(--texte);
|
|
1826
|
+
text-wrap: balance;
|
|
1827
|
+
}
|
|
1828
|
+
.fenetre__sous {
|
|
1829
|
+
margin: 0 auto 24px;
|
|
1830
|
+
max-width: 36ch;
|
|
1831
|
+
font-size: 13.5px; line-height: 1.55; color: var(--texte-doux);
|
|
1832
|
+
text-wrap: balance;
|
|
1833
|
+
}
|
|
1834
|
+
.fenetre__corps { text-align: left; }
|
|
1835
|
+
|
|
1836
|
+
/* ------------------------------------------------------ FOURNISSEURS ---- */
|
|
1837
|
+
|
|
1838
|
+
.fournisseurs { display: flex; flex-direction: column; gap: 10px; }
|
|
1839
|
+
|
|
1840
|
+
.fournisseur {
|
|
1841
|
+
display: flex; align-items: center; justify-content: center; gap: 10px;
|
|
1842
|
+
width: 100%; min-height: 46px; padding: 12px 16px;
|
|
1843
|
+
border: 1px solid transparent; border-radius: 12px;
|
|
1844
|
+
font: inherit; font-size: 14px; font-weight: 600;
|
|
1845
|
+
cursor: pointer;
|
|
1846
|
+
transition: transform 90ms ease, background-color 120ms ease, box-shadow 120ms ease;
|
|
1847
|
+
}
|
|
1848
|
+
.fournisseur:active { transform: translateY(1px); }
|
|
1849
|
+
.fournisseur:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
|
|
1850
|
+
.fournisseur[disabled] { opacity: 0.55; cursor: default; transform: none; }
|
|
1851
|
+
.fournisseur .logo { width: 18px; height: 18px; flex: none; display: block; }
|
|
1852
|
+
|
|
1853
|
+
/* LES COULEURS DE CHAQUE MARQUE, telles qu'elles les publient. Un bouton
|
|
1854
|
+
Google repeint aux couleurs du site devient moins reconnaissable — et un
|
|
1855
|
+
bouton de connexion qu'on ne reconnaît pas est un bouton sur lequel on
|
|
1856
|
+
hésite à cliquer. */
|
|
1857
|
+
.fournisseur--google {
|
|
1858
|
+
background: #fff; color: #1f1f1f; border-color: #dadce0;
|
|
1859
|
+
box-shadow: 0 1px 2px rgba(8, 64, 80, 0.06);
|
|
1860
|
+
}
|
|
1861
|
+
.fournisseur--google:hover:not([disabled]) { background: #f6f9fa; border-color: #c9d3d8; }
|
|
1862
|
+
.fournisseur--facebook { background: #1877f2; color: #fff; }
|
|
1863
|
+
.fournisseur--facebook:hover:not([disabled]) { background: #166fe5; }
|
|
1864
|
+
|
|
1865
|
+
.bouton--large { width: 100%; padding: 12px 16px; font-size: 14px; }
|
|
1866
|
+
|
|
1867
|
+
/* Les boutons et messages PARTAGÉS avec l'éditeur, en version claire. */
|
|
1868
|
+
.voile .bouton {
|
|
1869
|
+
min-height: 44px; border-radius: 12px;
|
|
1870
|
+
background: #fff; color: var(--texte); border-color: #cfd9dd;
|
|
1871
|
+
}
|
|
1872
|
+
.voile .bouton:hover { background: var(--fond-clair); }
|
|
1873
|
+
.voile .bouton:focus-visible { outline-color: var(--focus); }
|
|
1874
|
+
.voile .bouton--principal { background: var(--petrole); border-color: var(--petrole); color: #fff; }
|
|
1875
|
+
.voile .bouton--principal:hover { background: var(--petrole-survol); }
|
|
1876
|
+
|
|
1877
|
+
.voile .message { font-size: 13px; line-height: 1.5; border-radius: 10px; }
|
|
1878
|
+
.voile .message--erreur { background: #fdf0ee; border-color: #f4c7bf; color: #a3321f; }
|
|
1879
|
+
.voile .message--ok { background: #e8f7f5; border-color: #a9e2dc; color: #0a5c57; }
|
|
1880
|
+
.voile .message--info { background: var(--fond-clair); border-color: var(--bord); color: #3a5159; }
|
|
1881
|
+
|
|
1882
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1883
|
+
.fournisseur { transition: none; }
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
/* ------------------------------------------------------------ CHAMPS ---- */
|
|
1887
|
+
|
|
1888
|
+
.champ { margin-bottom: 16px; }
|
|
1889
|
+
.champ__etiquette {
|
|
1890
|
+
display: block; margin-bottom: 5px;
|
|
1891
|
+
font-size: 12px; font-weight: 600; color: var(--texte);
|
|
1892
|
+
}
|
|
1893
|
+
.champ__aide { margin: 4px 0 0; font-size: 11.5px; color: var(--texte-doux); }
|
|
1894
|
+
.champ__langue {
|
|
1895
|
+
display: inline-block; margin: 0 0 4px;
|
|
1896
|
+
font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
|
|
1897
|
+
text-transform: uppercase; color: var(--texte-doux);
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
/* TOUS les types de champs, pas seulement ceux auxquels on pensait. Un
|
|
1901
|
+
type oublie — « password », « email » — retombe sur le style brut du
|
|
1902
|
+
navigateur : une ligne blanche au milieu d'un panneau sombre. */
|
|
1903
|
+
input[type="text"], input[type="url"], input[type="number"], input[type="date"],
|
|
1904
|
+
input[type="password"], input[type="email"], input[type="tel"], input[type="search"],
|
|
1905
|
+
select, textarea {
|
|
1906
|
+
width: 100%;
|
|
1907
|
+
padding: 8px 10px;
|
|
1908
|
+
border: 1px solid var(--bord);
|
|
1909
|
+
border-radius: 6px;
|
|
1910
|
+
background: var(--fond-clair);
|
|
1911
|
+
color: var(--texte);
|
|
1912
|
+
font: inherit;
|
|
1913
|
+
font-size: 13px;
|
|
1914
|
+
}
|
|
1915
|
+
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
|
|
1916
|
+
input:focus, select:focus, textarea:focus {
|
|
1917
|
+
outline: none; border-color: var(--accent);
|
|
1918
|
+
box-shadow: 0 0 0 3px rgba(59, 165, 141, 0.18);
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
.bascule { display: flex; align-items: center; gap: 8px; }
|
|
1922
|
+
.bascule input { width: 16px; height: 16px; accent-color: var(--accent); }
|
|
1923
|
+
|
|
1924
|
+
.vignette {
|
|
1925
|
+
margin-top: 8px; max-height: 110px; border-radius: 6px;
|
|
1926
|
+
border: 1px solid var(--bord); display: block;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
/* --------------------------------------------------------- LISTES ------- */
|
|
1930
|
+
|
|
1931
|
+
.liste__item {
|
|
1932
|
+
border: 1px solid var(--bord); border-radius: 8px;
|
|
1933
|
+
padding: 12px; margin-bottom: 10px; background: var(--fond-clair);
|
|
1934
|
+
}
|
|
1935
|
+
.liste__tete {
|
|
1936
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
1937
|
+
margin-bottom: 8px;
|
|
1938
|
+
}
|
|
1939
|
+
.liste__rang { font-size: 11px; font-weight: 700; color: var(--texte-doux); }
|
|
1940
|
+
|
|
1941
|
+
/* --------------------------------------------------------- BOUTONS ------ */
|
|
1942
|
+
|
|
1943
|
+
.bouton {
|
|
1944
|
+
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
|
1945
|
+
padding: 8px 14px; border-radius: 7px; border: 1px solid transparent;
|
|
1946
|
+
font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
|
|
1947
|
+
background: var(--fond-clair); color: var(--texte); border-color: var(--bord);
|
|
1948
|
+
}
|
|
1949
|
+
.bouton:hover { background: #2a2e37; }
|
|
1950
|
+
.bouton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
1951
|
+
.bouton--principal { background: var(--accent); border-color: var(--accent); color: #06120e; }
|
|
1952
|
+
.bouton--principal:hover { background: #45bda2; }
|
|
1953
|
+
.bouton--discret { background: transparent; border-color: transparent; color: var(--texte-doux); }
|
|
1954
|
+
.bouton--discret:hover { background: var(--fond-clair); color: var(--texte); }
|
|
1955
|
+
.bouton[disabled] { opacity: 0.5; cursor: default; }
|
|
1956
|
+
.bouton--icone { padding: 6px 9px; }
|
|
1957
|
+
|
|
1958
|
+
.message {
|
|
1959
|
+
margin: 0 0 12px; padding: 9px 11px; border-radius: 7px;
|
|
1960
|
+
font-size: 12.5px; border: 1px solid;
|
|
1961
|
+
}
|
|
1962
|
+
.message--erreur { background: rgba(217, 119, 106, 0.12); border-color: rgba(217, 119, 106, 0.4); color: #f0b3a9; }
|
|
1963
|
+
.message--ok { background: rgba(59, 165, 141, 0.12); border-color: rgba(59, 165, 141, 0.4); color: #8fd9c6; }
|
|
1964
|
+
.message--info { background: var(--fond-clair); border-color: var(--bord); color: var(--texte-doux); }
|
|
1965
|
+
|
|
1966
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1967
|
+
* { transition: none !important; animation: none !important; }
|
|
1968
|
+
}
|
|
1969
|
+
`, Ot = `
|
|
1970
|
+
/* --------------------------------------------------------- SAISIE ------- */
|
|
1971
|
+
|
|
1972
|
+
/* Une valeur marquée par le site (un prix, un numéro) se corrige dans une
|
|
1973
|
+
saisie posée EXACTEMENT dessus, dans la police de la page : on écrit là où
|
|
1974
|
+
on lisait. Le libellé au-dessus dit quel champ on touche — « Séance
|
|
1975
|
+
d'acupuncture », pas « seance ». */
|
|
1976
|
+
.saisie {
|
|
1977
|
+
position: fixed;
|
|
1978
|
+
display: flex;
|
|
1979
|
+
flex-direction: column;
|
|
1980
|
+
align-items: flex-start;
|
|
1981
|
+
gap: 4px;
|
|
1982
|
+
}
|
|
1983
|
+
.saisie__libelle,
|
|
1984
|
+
.saisie__aide,
|
|
1985
|
+
.saisie__erreur {
|
|
1986
|
+
padding: 3px 8px;
|
|
1987
|
+
border-radius: 6px;
|
|
1988
|
+
font: 600 11px/1.35 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
1989
|
+
white-space: nowrap;
|
|
1990
|
+
}
|
|
1991
|
+
.saisie__libelle { background: var(--fond); color: var(--texte); }
|
|
1992
|
+
.saisie__aide { background: rgba(22, 24, 29, 0.82); color: var(--texte-doux); font-weight: 500; }
|
|
1993
|
+
.saisie__erreur { background: #b3261e; color: #fff; }
|
|
1994
|
+
.saisie__champ {
|
|
1995
|
+
min-width: 0;
|
|
1996
|
+
padding: 2px 8px;
|
|
1997
|
+
border: 2px solid var(--accent);
|
|
1998
|
+
border-radius: 6px;
|
|
1999
|
+
background: #fff;
|
|
2000
|
+
color: #111;
|
|
2001
|
+
line-height: 1.2;
|
|
2002
|
+
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
|
|
2003
|
+
outline: none;
|
|
2004
|
+
}
|
|
2005
|
+
.saisie__champ:focus { box-shadow: 0 0 0 3px rgba(59, 165, 141, 0.35), 0 10px 28px rgba(0, 0, 0, 0.28); }
|
|
2006
|
+
.saisie__champ:disabled { opacity: 0.7; }
|
|
2007
|
+
|
|
2008
|
+
/* --------------------------------------------------------- CHOIX -------- */
|
|
2009
|
+
|
|
2010
|
+
/* Quand un meme texte vient de plusieurs cles, on demande laquelle plutot que
|
|
2011
|
+
de deviner — et de modifier la mauvaise sans que personne le voie. */
|
|
2012
|
+
.choix {
|
|
2013
|
+
position: fixed;
|
|
2014
|
+
width: 260px;
|
|
2015
|
+
padding: 12px;
|
|
2016
|
+
border: 1px solid var(--bord);
|
|
2017
|
+
border-radius: 10px;
|
|
2018
|
+
background: var(--fond);
|
|
2019
|
+
box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
|
|
2020
|
+
}
|
|
2021
|
+
.choix__titre { margin: 0 0 2px; font-size: 12.5px; font-weight: 650; }
|
|
2022
|
+
.choix__aide { margin: 0 0 10px; font-size: 11.5px; color: var(--texte-doux); }
|
|
2023
|
+
.choix__option {
|
|
2024
|
+
display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
|
|
2025
|
+
width: 100%; margin-bottom: 6px; padding: 7px 9px;
|
|
2026
|
+
border: 1px solid var(--bord); border-radius: 7px;
|
|
2027
|
+
background: var(--fond-clair); color: var(--texte);
|
|
2028
|
+
font: inherit; text-align: left; cursor: pointer;
|
|
2029
|
+
}
|
|
2030
|
+
.choix__option:hover { background: #2a2e37; border-color: var(--accent); }
|
|
2031
|
+
.choix__chemin { font-size: 12px; font-weight: 600; }
|
|
2032
|
+
.choix__ns { font-size: 10.5px; color: var(--texte-doux); }
|
|
2033
|
+
|
|
2034
|
+
/* ------------------------------------------------------- RANGEES -------- */
|
|
2035
|
+
|
|
2036
|
+
.rangee {
|
|
2037
|
+
display: flex; align-items: center; justify-content: space-between; gap: 10px;
|
|
2038
|
+
width: 100%; margin-bottom: 6px; padding: 10px 12px;
|
|
2039
|
+
border: 1px solid var(--bord); border-radius: 8px;
|
|
2040
|
+
background: var(--fond-clair); color: var(--texte);
|
|
2041
|
+
font: inherit; text-align: left; cursor: pointer;
|
|
2042
|
+
}
|
|
2043
|
+
.rangee:hover { background: #2a2e37; border-color: var(--accent); }
|
|
2044
|
+
.rangee__nom { font-size: 13px; font-weight: 600; }
|
|
2045
|
+
.rangee__info { font-size: 11.5px; color: var(--texte-doux); white-space: nowrap; }
|
|
2046
|
+
|
|
2047
|
+
/* ------------------------------------------------------ FLOTTANT -------- */
|
|
2048
|
+
|
|
2049
|
+
/* Un message au-dessus de la barre, pour confirmer sans ouvrir de panneau. */
|
|
2050
|
+
.flottant {
|
|
2051
|
+
position: fixed;
|
|
2052
|
+
left: 50%; bottom: 76px;
|
|
2053
|
+
transform: translateX(-50%);
|
|
2054
|
+
max-width: min(460px, calc(100vw - 24px));
|
|
2055
|
+
}
|
|
2056
|
+
.flottant .message { margin: 0; box-shadow: 0 8px 26px rgba(0,0,0,.4); }
|
|
2057
|
+
`, It = `
|
|
2058
|
+
/* ON NE DOIT JAMAIS SE DEMANDER SI ON EST EN MODE EDITION. Une barre en bas
|
|
2059
|
+
se confond avec un bandeau de temoins ; un lisere qui borde tout l'ecran,
|
|
2060
|
+
present sur chaque page, ne se confond avec rien. Il ne prend aucun clic. */
|
|
2061
|
+
.cadre-global {
|
|
2062
|
+
position: fixed;
|
|
2063
|
+
inset: 0;
|
|
2064
|
+
pointer-events: none;
|
|
2065
|
+
border: 2px solid var(--accent);
|
|
2066
|
+
border-radius: 4px;
|
|
2067
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
|
|
2068
|
+
opacity: 0.85;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
/* EN MODE CIRCULER, le cadre change d'allure. On est toujours connecte — le
|
|
2072
|
+
dire reste necessaire — mais les clics rendent la main aux liens, et rien
|
|
2073
|
+
ne serait plus desagreable que de croire qu'on edite alors qu'on navigue,
|
|
2074
|
+
ou l'inverse. Trait interrompu et plus efface : present, mais en retrait. */
|
|
2075
|
+
.cadre-global--circuler {
|
|
2076
|
+
border-style: dashed;
|
|
2077
|
+
border-color: var(--texte-doux);
|
|
2078
|
+
opacity: 0.5;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
/* La sortie est rouge au survol seulement : visible quand on la cherche,
|
|
2082
|
+
discrete le reste du temps — c'est le geste qu'on fait une fois. */
|
|
2083
|
+
.bouton--sortie { color: var(--texte-doux); background: transparent; border-color: transparent; }
|
|
2084
|
+
.bouton--sortie:hover { background: rgba(217, 119, 106, 0.16); color: var(--danger); }
|
|
2085
|
+
|
|
2086
|
+
.barre__pastille {
|
|
2087
|
+
display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px;
|
|
2088
|
+
background: rgba(6, 18, 14, 0.25); font-size: 11px; line-height: 18px; text-align: center;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
/* LA BARRE AU TÉLÉPHONE. Une pilule de 600 px ne tient pas dans 390 : elle
|
|
2092
|
+
devient une bande pleine largeur, en bas, et chaque bouton fait au moins
|
|
2093
|
+
44 px — la taille d'un doigt, pas d'un pointeur. On tait ce qui se lit
|
|
2094
|
+
ailleurs (la phrase d'aide, le compte, que la pastille du bouton Publier
|
|
2095
|
+
porte déjà). L'aperçu mobile n'a pas de sens sur un téléphone. */
|
|
2096
|
+
@media (max-width: 640px) {
|
|
2097
|
+
.barre {
|
|
2098
|
+
left: 8px; right: 8px; bottom: 8px; transform: none;
|
|
2099
|
+
max-width: none; gap: 6px; padding: 6px;
|
|
2100
|
+
border-radius: 18px; justify-content: space-between;
|
|
2101
|
+
padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
|
|
2102
|
+
}
|
|
2103
|
+
.barre .bouton { min-height: 44px; padding: 8px 12px; }
|
|
2104
|
+
.barre .bouton--icone { min-width: 44px; }
|
|
2105
|
+
.barre__texte, .barre__compte, .barre__point, .bouton--bureau-seul, .barre__libelle { display: none; }
|
|
2106
|
+
/* Filet : si un site ajoute de quoi déborder, la barre défile au lieu de
|
|
2107
|
+
pousser « Quitter » hors de l'écran. */
|
|
2108
|
+
.barre { overflow-x: auto; scrollbar-width: none; }
|
|
2109
|
+
.flottant { bottom: 84px; }
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
/* ------------------------------------------------ BOUTIQUE SUR LA PAGE --- */
|
|
2113
|
+
|
|
2114
|
+
/* LA COUCHE DES CRAYONS, aux coordonnées du DOCUMENT : défiler la page ne
|
|
2115
|
+
fait que la déplacer (un transform), sans aucun rendu. */
|
|
2116
|
+
.marques { position: absolute; top: 0; left: 0; width: 0; height: 0; will-change: transform; }
|
|
2117
|
+
|
|
2118
|
+
/* LE CRAYON d'une carte produit : rond, sombre, 44 px — visible sur toutes
|
|
2119
|
+
les photos, claires comme foncées. */
|
|
2120
|
+
.crayon {
|
|
2121
|
+
position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 0;
|
|
2122
|
+
display: grid; place-items: center; cursor: pointer;
|
|
2123
|
+
background: var(--fond); color: #fff;
|
|
2124
|
+
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
|
|
2125
|
+
}
|
|
2126
|
+
.crayon svg { width: 18px; height: 18px; }
|
|
2127
|
+
.crayon:hover, .crayon:focus-visible { background: var(--accent); color: #06120e; outline: 2px solid #fff; outline-offset: 2px; }
|
|
2128
|
+
|
|
2129
|
+
/* CRAYON ET « + » D'UNE COLLECTION, côte à côte. */
|
|
2130
|
+
.marque-coll { position: absolute; display: flex; gap: 6px; }
|
|
2131
|
+
.marque-coll .crayon { position: static; }
|
|
2132
|
+
.crayon--plus { background: var(--accent); color: #06120e; font: 400 26px/1 ui-sans-serif, system-ui, sans-serif; }
|
|
2133
|
+
.crayon--plus:hover, .crayon--plus:focus-visible { background: #45bda2; }
|
|
2134
|
+
|
|
2135
|
+
/* --------------------------------------------------- APERÇU MOBILE ------ */
|
|
2136
|
+
.apercu {
|
|
2137
|
+
position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
|
|
2138
|
+
background: rgba(16, 18, 22, 0.82); backdrop-filter: blur(3px);
|
|
2139
|
+
}
|
|
2140
|
+
.apercu__barre {
|
|
2141
|
+
display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px;
|
|
2142
|
+
background: var(--fond); border: 1px solid var(--bord); border-radius: 999px; font-size: 12.5px;
|
|
2143
|
+
}
|
|
2144
|
+
.apercu__tel { padding: 12px; border-radius: 44px; background: #0b0c0f; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55); }
|
|
2145
|
+
.apercu__tel iframe { display: block; border: 0; border-radius: 32px; background: #fff; }
|
|
2146
|
+
`, qt = "lystech-editeur-hote", Pt = "lystech-connexion-hote";
|
|
2147
|
+
function je(o) {
|
|
2148
|
+
document.getElementById(o)?.remove();
|
|
2149
|
+
const e = document.createElement("div");
|
|
2150
|
+
e.id = o, e.style.position = "relative", e.style.zIndex = "2147483000", document.body.appendChild(e);
|
|
2151
|
+
const r = e.attachShadow({ mode: "open" }), a = document.createElement("style");
|
|
2152
|
+
a.textContent = Dt + Ot + It, r.appendChild(a);
|
|
2153
|
+
const i = document.createElement("div");
|
|
2154
|
+
return r.appendChild(i), { hote: e, point: i };
|
|
2155
|
+
}
|
|
2156
|
+
function Re(o, e) {
|
|
2157
|
+
let r = o;
|
|
2158
|
+
return () => {
|
|
2159
|
+
const a = r;
|
|
2160
|
+
r = null, setTimeout(() => {
|
|
2161
|
+
a?.unmount(), e.remove();
|
|
2162
|
+
}, 0);
|
|
2163
|
+
};
|
|
2164
|
+
}
|
|
2165
|
+
function Ft({
|
|
2166
|
+
site: o,
|
|
2167
|
+
apiBaseUrl: e,
|
|
2168
|
+
methodes: r,
|
|
2169
|
+
surJeton: a
|
|
2170
|
+
}) {
|
|
2171
|
+
const { hote: i, point: n } = je(Pt), s = qe(n), p = () => c();
|
|
2172
|
+
s.render(
|
|
2173
|
+
/* @__PURE__ */ t(
|
|
2174
|
+
it,
|
|
2175
|
+
{
|
|
2176
|
+
site: o,
|
|
2177
|
+
apiBaseUrl: e,
|
|
2178
|
+
...r ? { methodes: r } : {},
|
|
2179
|
+
surJeton: (u) => {
|
|
2180
|
+
c(), a(u);
|
|
2181
|
+
},
|
|
2182
|
+
surFermer: p
|
|
2183
|
+
}
|
|
2184
|
+
)
|
|
2185
|
+
);
|
|
2186
|
+
const c = Re(s, i);
|
|
2187
|
+
return c;
|
|
2188
|
+
}
|
|
2189
|
+
function Qt({
|
|
2190
|
+
jeton: o,
|
|
2191
|
+
site: e,
|
|
2192
|
+
apiBaseUrl: r,
|
|
2193
|
+
pont: a
|
|
2194
|
+
}) {
|
|
2195
|
+
const { hote: i, point: n } = je(qt), s = qe(n);
|
|
2196
|
+
return s.render(
|
|
2197
|
+
/* @__PURE__ */ t(
|
|
2198
|
+
_t,
|
|
2199
|
+
{
|
|
2200
|
+
api: et({
|
|
2201
|
+
jeton: o,
|
|
2202
|
+
site: e,
|
|
2203
|
+
apiBaseUrl: r,
|
|
2204
|
+
surJetonRefuse: Pe
|
|
2205
|
+
}),
|
|
2206
|
+
pont: a
|
|
2207
|
+
}
|
|
2208
|
+
)
|
|
2209
|
+
), Re(s, i);
|
|
2210
|
+
}
|
|
2211
|
+
export {
|
|
2212
|
+
Se as E,
|
|
2213
|
+
Ft as a,
|
|
2214
|
+
Qt as b,
|
|
2215
|
+
jt as e,
|
|
2216
|
+
Rt as m
|
|
2217
|
+
};
|