Skills for building AEM Edge Delivery Services sites — site creation, block development, content modeling, code review, testing, and page import.
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
// eslint-disable-next-line import/no-unresolved
import { toClassName } from '../../scripts/aem.js';
export default async function decorate(block) {
// build tablist
const tablist = document.createElement('div');
tablist.className = 'tabs-list';
tablist.setAttribute('role', 'tablist');
// decorate tabs and tabpanels
const tabs = [...block.children].map((child) => child.firstElementChild);
tabs.forEach((tab, i) => {
const id = toClassName(tab.textContent);
// decorate tabpanel
const tabpanel = block.children[i];
tabpanel.className = 'tabs-panel';
tabpanel.id = `tabpanel-${id}`;
tabpanel.setAttribute('aria-hidden', !!i);
tabpanel.setAttribute('aria-labelledby', `tab-${id}`);
tabpanel.setAttribute('role', 'tabpanel');
// build tab button
const button = document.createElement('button');
button.className = 'tabs-tab';
button.id = `tab-${id}`;
button.innerHTML = tab.innerHTML;
button.setAttribute('aria-controls', `tabpanel-${id}`);
button.setAttribute('aria-selected', !i);
button.setAttribute('role', 'tab');
button.setAttribute('type', 'button');
button.addEventListener('click', () => {
block.querySelectorAll('[role=tabpanel]').forEach((panel) => {
panel.setAttribute('aria-hidden', true);
});
tablist.querySelectorAll('button').forEach((btn) => {
btn.setAttribute('aria-selected', false);
});
tabpanel.setAttribute('aria-hidden', false);
button.setAttribute('aria-selected', true);
});
tablist.append(button);
tab.remove();
});
block.prepend(tablist);
}.tessl-plugin
skills
aem-block-library
aem-cli
aem-layout-view
block-collection-and-party
brand-setup
references
building-blocks
code-review
content-driven-development
references
content-modeling
create-site
da-auth
figma-to-content
find-test-content
generate-import-html
identify-page-structure
migrate-header
page-decomposition
page-import
preview-import
scrape-webpage
slicc-handoff
snowflake
assets
substrate
substrate-milo
examples
knowledge
scripts
testing-blocks
ue-component-model