ranui
Version:
A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.
27 lines (26 loc) • 797 B
JavaScript
async function a(o, e, r) {
return o.evaluate(({ selector: t, source: i }) => {
const n = document.querySelector(t);
if (n === null) throw new Error(`ranui/testing: nothing matches ${t}`);
if (n._shadowDom === void 0) throw new Error(`ranui/testing: ${t} has no shadow root`);
return new Function(`return (${i})`)()(n._shadowDom);
}, {
selector: e,
source: r.toString()
});
}
async function c(o, e, r) {
await o.waitForFunction(({ sel: t, source: i }) => {
const n = [...document.querySelectorAll(t)];
if (n.length === 0) return !1;
const s = new Function(`return (${i})`)();
return n.every((u) => u._shadowDom !== void 0 && s(u._shadowDom));
}, {
sel: e,
source: r.toString()
});
}
export {
a as insideShadow,
c as settlePainted
};