@agence-zef/astro 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/overlay.js +10 -2
- package/package.json +1 -1
package/dist/overlay.js
CHANGED
|
@@ -127,6 +127,8 @@ export function startOverlay() {
|
|
|
127
127
|
#zef-overlay .zef-frame { position: fixed; border: 1.5px solid #8c40f7; border-radius: 2px; }
|
|
128
128
|
#zef-overlay .zef-frame.zef-section { border-style: dashed; border-color: #8c40f7aa; }
|
|
129
129
|
#zef-overlay .zef-frame.zef-selected { border-width: 2px; }
|
|
130
|
+
#zef-overlay .zef-frame.zef-field { border: 1.5px solid #8c40f7; border-radius: 3px; background: #8c40f70d; }
|
|
131
|
+
#zef-overlay .zef-frame.zef-field .zef-tag { padding: 1px 5px; font-size: 10px; }
|
|
130
132
|
#zef-overlay .zef-tag { position: absolute; left: -1.5px; bottom: 100%; margin-bottom: 2px; padding: 2px 6px; border-radius: 4px; background: #8c40f7; color: #fff; white-space: nowrap; }
|
|
131
133
|
#zef-overlay .zef-compare { border: 2px solid #ea580c; }
|
|
132
134
|
#zef-overlay .zef-compare .zef-tag { left: 8px; top: 8px; bottom: auto; margin: 0; background: #fff7ed; color: #c2410c; }
|
|
@@ -283,6 +285,11 @@ export function startOverlay() {
|
|
|
283
285
|
if (wrapper)
|
|
284
286
|
insertLine(section, rect(wrapper));
|
|
285
287
|
}
|
|
288
|
+
// Champ survolé (titre, texte, bouton, image) : cadre et libellé ; un clic l'ouvre dans le
|
|
289
|
+
// panneau de droite.
|
|
290
|
+
const field = target && !editing ? target.closest(`[${ATTR}]`) : null;
|
|
291
|
+
if (field && field !== editing)
|
|
292
|
+
frame(rect(field), "zef-field", info(field)?.label);
|
|
286
293
|
}
|
|
287
294
|
let frameRequest = 0;
|
|
288
295
|
const redraw = () => {
|
|
@@ -335,9 +342,10 @@ export function startOverlay() {
|
|
|
335
342
|
});
|
|
336
343
|
return;
|
|
337
344
|
}
|
|
338
|
-
// Un clic choisit toute la section (ou l'élément de collection pour ses propres champs)
|
|
345
|
+
// Un clic choisit toute la section (ou l'élément de collection pour ses propres champs) et
|
|
346
|
+
// désigne le champ cliqué, que l'éditeur ouvre et met au premier plan dans son panneau.
|
|
339
347
|
selected = { section: location?.scope === "@" ? "@" : section, path: null };
|
|
340
|
-
post({ zef: "select", ...selected });
|
|
348
|
+
post({ zef: "select", ...selected, path: location?.path ?? null });
|
|
341
349
|
redraw();
|
|
342
350
|
}, true);
|
|
343
351
|
document.addEventListener("submit", (e) => e.preventDefault(), true);
|
package/package.json
CHANGED