bricks-builder-mcp 3.11.3 → 3.11.5
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/package.json +1 -1
- package/server.js +13 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "bricks-builder-mcp",
|
|
4
|
-
"version": "3.11.
|
|
4
|
+
"version": "3.11.5",
|
|
5
5
|
"description": "Serveur MCP pour piloter Bricks Builder (WordPress) depuis Claude — édition de pages, gestion d'éléments, réordonnancement des sections, vérification visuelle (verify_element), upload optimisé WebP. Communauté Discord : https://discord.gg/rX22zHRzH",
|
|
6
6
|
"homepage": "https://discord.gg/rX22zHRzH",
|
|
7
7
|
"main": "server.js",
|
package/server.js
CHANGED
|
@@ -2310,18 +2310,28 @@ mcpServer.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
2310
2310
|
|
|
2311
2311
|
// === Empty containers ===
|
|
2312
2312
|
if (cfg.empty_containers) {
|
|
2313
|
+
// v3.11.5 — Bricks 2.3 rend ses images comme des <img class="brxe-image" id="brxe-{id}">
|
|
2314
|
+
// (pas un wrapper). Idem pour vidéos/iframes/svg. On skip ces balises : elles SONT le média.
|
|
2315
|
+
const MEDIA_TAGS = new Set(['IMG', 'PICTURE', 'SVG', 'VIDEO', 'IFRAME', 'CANVAS', 'AUDIO', 'OBJECT', 'EMBED']);
|
|
2316
|
+
const INTERACTIVE_TAGS = new Set(['A', 'BUTTON', 'INPUT', 'SELECT', 'TEXTAREA']);
|
|
2313
2317
|
allBrxe.forEach(b => {
|
|
2318
|
+
// Skip si l'élément EST déjà un média ou un interactif natif
|
|
2319
|
+
if (MEDIA_TAGS.has(b.tagName) || INTERACTIVE_TAGS.has(b.tagName)) return;
|
|
2314
2320
|
const rect = b.getBoundingClientRect();
|
|
2315
2321
|
if (rect.width < 50 || rect.height < 50) return;
|
|
2316
2322
|
const area = rect.width * rect.height;
|
|
2317
2323
|
if (area < 2500) return;
|
|
2318
|
-
// Ignorer les éléments en dehors du viewport rendu (hauteur fullpage)
|
|
2319
2324
|
const hasText = (b.textContent || '').trim().length > 0;
|
|
2320
|
-
const hasMedia = b.querySelector('img, picture, svg, video, iframe') !== null;
|
|
2325
|
+
const hasMedia = b.querySelector('img, picture, svg, video, iframe, canvas, audio, object, embed') !== null;
|
|
2321
2326
|
const hasInteractive = b.querySelector('a, button, input, select, textarea') !== null;
|
|
2322
2327
|
const bcs = getComputedStyle(b);
|
|
2323
2328
|
const hasBgImg = bcs.backgroundImage && bcs.backgroundImage !== 'none';
|
|
2324
|
-
|
|
2329
|
+
// Détecte aussi les background-image sur les descendants directs (cas Bricks où le bg est sur un sub-div)
|
|
2330
|
+
const hasChildBgImg = !hasBgImg && Array.from(b.children).some(c => {
|
|
2331
|
+
const ccs = getComputedStyle(c);
|
|
2332
|
+
return ccs.backgroundImage && ccs.backgroundImage !== 'none';
|
|
2333
|
+
});
|
|
2334
|
+
if (!hasText && !hasMedia && !hasInteractive && !hasBgImg && !hasChildBgImg) {
|
|
2325
2335
|
issues.push({
|
|
2326
2336
|
type: 'empty_container',
|
|
2327
2337
|
severity: 'warning',
|