non core block: layout-shell@div>button[aria-controls][aria-expanded][aria-haspopup][aria-label][data-blocks-engine-capt
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 28/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, php, wordpress
Hướng nghiên cứu
Start with the provided reproduction command and reduced page, then read tools/import-loop/predicates/non_core_block.mjs and the referenced emits.mjs and gates/collateral.mjs. Compare the generated output with core blocks and use the reproduction predicate to check whether the non-core block remains. Done means the content uses core blocks and renders with pixel parity.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Finding
editability/non_core_block on layout-shell@div>button[aria-controls][aria-expanded][aria-haspopup][aria-label][data-blocks-engine-capture-dialog-ancestor-state][data-blocks-engine-capture-dialog-trigger][data-blocks-engine-capture-disclosure-label][data-semantic-classname][data-testid][type], seen in 2 route/width cell(s) of an imported site:
| route | width | evidence |
|---|---|---|
/about/ |
1440 | {"route":"/about/","count":1,"of":144} |
/ |
1440 | {"route":"/","count":1,"of":377} |
Reduced page (8091 bytes)
Reduced from 363147 bytes in 224 predicate calls.
<!DOCTYPE html><html><head><script>(function(){
function triggers(){return document.querySelectorAll('[data-blocks-engine-capture-dialog-trigger]');}
function panel(trigger){var id=trigger.getAttribute('aria-controls');return id?document.getElementById(id):null;}
function closeFor(trigger){var id=trigger.getAttribute('aria-controls');return id?document.querySelector('[data-blocks-engine-capture-dialog-close="'+id+'"]'):null;}
function concealed(trigger){var style=getComputedStyle(trigger);if(style.display==='none'||style.visibility==='hidden')return true;var rect=trigger.getBoundingClientRect();return rect.width===0||rect.height===0;}
function ancestorBindings(trigger){try{return JSON.parse(trigger.getAttribute('data-blocks-engine-capture-dialog-ancestor-state')||'[]');}catch(error){return [];}}
function classTokens(value){return (value||'').split(/\s+/).filter(Boolean);}
function ancestorAt(trigger,depth){var node=trigger;while(depth--&&node)node=node.parentElement;return node;}
function triggerBindings(trigger){try{return JSON.parse(trigger.getAttribute('data-blocks-engine-capture-dialog-trigger-state')||'[]');}catch(error){return [];}}
function applyTrigger(trigger,open){triggerBindings(trigger).forEach(function(binding){var node=binding.selector?trigger.querySelector(binding.selector):trigger;if(!node)return;var target=classTokens((open?binding.opened:binding.closed).class);classTokens((open?binding.closed:binding.opened).class).forEach(function(token){if(target.indexOf(token)<0)node.classList.remove(token);});target.forEach(function(token){node.classList.add(token);});});}
function applyAncestors(trigger,open){ancestorBindings(trigger).forEach(function(binding){var node=ancestorAt(trigger,binding.depth);if(!node)return;
Object.keys(binding.closed).forEach(function(name){var value=open?binding.opened[name]:binding.closed[name];
if(!open){var owner=Array.prototype.find.call(triggers(),function(other){return other!==trigger&&!concealed(other)&&other.getAttribute('aria-expanded')==='true'&&ancestorBindings(other).some(function(row){return ancestorAt(other,row.depth)===node&&Object.prototype.hasOwnProperty.call(row.opened,name);});});if(owner){var row=ancestorBindings(owner).find(function(row){return ancestorAt(owner,row.depth)===node&&Object.prototype.hasOwnProperty.call(row.opened,name);});value=row.opened[name];}}
if(name==='class'){var target=classTokens(value);classTokens(open?binding.closed[name]:binding.opened[name]).forEach(function(token){if(target.indexOf(token)<0)node.classList.remove(token);});target.forEach(function(token){node.classList.add(token);});if(value===null&&!node.classList.length)node.removeAttribute(name);return;}
if(value===null)node.removeAttribute(name);else node.setAttribute(name,value);
});
});}
function apply(trigger){
var target=panel(trigger);if(!target)return;
var inactive=concealed(trigger),open=trigger.getAttribute('aria-expanded')==='true'&&!inactive;
applyAncestors(trigger,open);
applyTrigger(trigger,open);
if(!open&&Array.prototype.some.call(triggers(),function(other){return other!==trigger&&panel(other)===target&&!concealed(other)&&other.getAttribute('aria-expanded')==='true';}))return;
var captured=trigger.getAttribute('data-blocks-engine-capture-dialog-panel-state');
var opened=captured?JSON.parse(captured):null;
if(open&&opened&&target.__dlaDialogState!==captured){target.innerHTML=opened.html;target.__dlaDialogState=captured;}
var existing=target.getAttribute('data-blocks-engine-capture-existing-panel');
if(existing){
var states=JSON.parse(existing),resting=states.resting.html!==undefined;
var state=(inactive||(resting&&!open))?states.resting:(opened||states.opened);
if(resting&&!open&&target.__dlaDialogState!==null){target.innerHTML=states.resting.html;target.__dlaDialogState=null;}
['style','class'].forEach(function(name){if(state[name]===null)target.removeAttribute(name);else target.setAttribute(name,state[name]);});
target.toggleAttribute('data-blocks-engine-capture-resting-panel',inactive);
target.hidden=inactive?states.resting.hidden:!open;
if(inactive&&!target.classList.contains('data-blocks-engine-capture-dropdown')){
// Observe authored resting CSS, not the generated modal positioning.
// A concealed control only exposes a panel that is visible in normal flow.
var style=getComputedStyle(target),rect=target.getBoundingClientRect();
var inline=style.display!=='none'&&style.visibility!=='hidden'&&style.position!=='fixed'&&style.position!=='absolute'&&rect.width>0&&rect.height>0;
target.toggleAttribute('data-blocks-engine-capture-resting-panel',inline);
if(!inline)target.hidden=true;
}
}else target.hidden=!open;
var close=closeFor(trigger);if(close)close.hidden=!open;
}
function set(trigger,open){if(open&&concealed(trigger))open=false;if(open)triggers().forEach(function(other){if(other!==trigger&&panel(other)===panel(trigger)&&other.getAttribute('aria-expanded')==='true')set(other,false);});trigger.setAttribute('aria-expanded',open?'true':'false');var label=trigger.getAttribute('data-blocks-engine-capture-disclosure-label');if(label)trigger.setAttribute('aria-label',open?'Close '+label:label);apply(trigger);}
function toggle(trigger){set(trigger,trigger.getAttribute('aria-expanded')!=='true');}
function onClick(event){var close=event.target.closest&&event.target.closest('[data-blocks-engine-capture-dialog-close]');if(close){event.preventDefault();var id=close.getAttribute('data-blocks-engine-capture-dialog-close');var owner=id&&document.querySelector('[data-blocks-engine-capture-dialog-trigger][aria-controls="'+id+'"]');if(owner){set(owner,false);owner.focus();}return;}var trigger=event.target.closest&&event.target.closest('[data-blocks-engine-capture-dialog-trigger]');if(!trigger||!panel(trigger))return;var nested=event.target.closest('a,button');if(nested&&nested!==trigger)return;event.preventDefault();var was=trigger.getAttribute('aria-expanded')==='true';toggle(trigger);if(was)trigger.focus();}
function onKey(event){if(event.key==='Escape'){var open=Array.prototype.slice.call(triggers()).filter(function(item){var target=panel(item);return !concealed(item)&&item.getAttribute('aria-expanded')==='true'&&target&&!target.hidden;}).pop();if(open){event.preventDefault();set(open,false);open.focus();return;}var details=Array.prototype.slice.call(document.querySelectorAll('details.data-blocks-engine-capture-initial-dialog[open]')).pop();if(!details)return;event.preventDefault();details.open=false;var summary=details.querySelector(':scope > summary');if(summary)summary.focus();return;}if(event.key!=='Enter'&&event.key!==' ')return;var trigger=event.target.closest&&event.target.closest('[data-blocks-engine-capture-dialog-trigger]');if(!trigger||!panel(trigger))return;if(trigger.tagName==='BUTTON'||(trigger.tagName==='A'&&event.key==='Enter'))return;event.preventDefault();toggle(trigger);}
function ready(){document.addEventListener('click',onClick);document.addEventListener('keydown',onKey);window.addEventListener('resize',function(){triggers().forEach(apply);});triggers().forEach(apply);}
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',ready);else ready();
})();</script></head><body><div class="wix-presets-wrapper w-4190f51c-3836-49f6-8114-96219c165b29 hamburgerOpenButton-presets-wrapper"><button type="button" data-testid="buttonContent" data-semantic-classname="button" aria-label="Menu" aria-haspopup="dialog" data-blocks-engine-capture-dialog-ancestor-state="[{"selector":"body","tag":"body","depth":18,"closed":{"class":""},"opened":{"class":"siteScrollingBlocked"},"classTokensOnly":true}]" data-blocks-engine-capture-disclosure-label="Menu" data-blocks-engine-capture-dialog-trigger="data-blocks-engine-capture-dialog-0" aria-controls="data-blocks-engine-capture-dialog-0" aria-expanded="false"><div><svg></svg></div></button></div></body></html>
Reproduce
The predicate exits 0 while the defect reproduces (checked against blocks-engine trunk 0ea40635). Run it from a static-site-importer checkout at a3e2be9d, with the reduced page saved as reduced.html:
PREDICATE_TARGET='{"subject":"layout-shell@div>button[aria-controls][aria-expanded][aria-haspopup][aria-label][data-blocks-engine-capture-dialog-ancestor-state][data-blocks-engine-capture-dialog-trigger][data-blocks-engine-capture-disclosure-label][data-semantic-classname][data-testid][type]","route":"/about/","width":1440,"evidence":{"route":"/about/","count":1,"of":144}}' \
WORDPRESS_PATH=<wordpress with static-site-importer active> WP_CLI='studio wp' \
PREDICATE_CAPTURE=<the site capture: its interaction-states.json and other evidence feed this block> \
node tools/import-loop/predicates/non_core_block.mjs <blocks-engine>/php-transformer reduced.html
predicates/non_core_block.mjs
// Exit 0 while the Blocks Engine output of a page still emits the generated
// block <prefix>/<subject>, a block outside WordPress core. An editor can only
// change its structure through the importer's own block, not with core tools.
// The defect is gone when the same content is built from core blocks and the
// page renders exactly as before; the acceptance gate holds the whole import to
// pixel parity (see emits.mjs, gates/collateral.mjs).
import { exitWhileEmitted } from './emits.mjs';
exitWhileEmitted();
Loop signature: 74aca51f0701
AI disclosure: filed by the static-site import findings loop (Homeboy workflow on the Lab). The finding, reduction, and body are generated by deterministic scripts; Claude (Anthropic) wrote those scripts with Chris Huber.
- Ngôn ngữ chính
- PHP
- Star
- 25
- Fork
- 3
- Merge trung bình
- 2 giờ 20 phút
- Pull request đã merge (30 ngày)
- 934
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Automattic/blocks-engine
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Automattic/blocks-engine#4943 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Automattic/blocks-engine#4942 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Automattic/blocks-engine#4921 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Automattic/blocks-engine#775 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A local stylesheet @import is treated as an unsupported web-font provider and fails font materializationCó thể đã có người làm @chubes4 đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Automattic/blocks-engine#5135 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Automattic/blocks-engine
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs good first issue php
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Area: UI Priority: High Status: Available Type: Maintenance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(flexi-content): wrap editor aria-labels with i18nCó thể đã có người làm @Ankitavasudev đã nhận hôm nay. Đang mởfirst-timers-only focus: accessibility focus: blocks focus: i18n good first issue hacktoberfest help wanted type: bug up-for-grabs winter-of-code
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
noruzzamans/gslider-blocks#697 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100