文件操作 - agent-block-descriptor.js
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/extendify/src/QuickEdit/lib/agent-block-descriptor.js
编辑文件内容
// Single source for the agent-block selection-descriptor shape so // DOMHighlighter's click commit and ask-ai's pill click can't drift on // which metadata flags exist or how they're detected. const AGENT_ATTR = 'data-extendify-agent-block-id'; const PART_ID_ATTR = 'data-extendify-part-block-id'; const PART_ATTR = 'data-extendify-part'; export const buildAgentBlockDescriptor = (match) => { if (!match) return null; const templatePart = match.closest?.(`[${PART_ATTR}]`); const details = { id: match.getAttribute(AGENT_ATTR), target: AGENT_ATTR, hasNav: !!match.querySelector('.wp-block-navigation') || match.classList.contains('wp-block-navigation'), hasSiteTitle: match.classList.contains('wp-block-site-title') || !!match.querySelector('.wp-block-site-title'), hasSiteLogo: match.classList.contains('wp-block-site-logo') || !!match.querySelector('.wp-block-site-logo'), hasLinks: !!match.querySelector('a') || match.tagName === 'A', hasImages: !!match.querySelector('.wp-block-image') || match.classList.contains('wp-block-image') || !!match.querySelector('img'), hasText: /\S/.test((match.textContent || '').replace(//g, '')), }; if (templatePart) { details.id = templatePart.getAttribute(PART_ID_ATTR); details.target = PART_ID_ATTR; details.template = templatePart.getAttribute(PART_ATTR); } return details; };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件