chore: format files with Prettier 3

This commit is contained in:
Eric Liu 2024-11-11 21:27:04 -08:00
commit 8e996dc683
391 changed files with 3725 additions and 3785 deletions

View file

@ -44,4 +44,4 @@
dispatch("change", { size, breakpointValue: breakpoints[size] });
</script>
<slot size="{size}" sizes="{sizes}" />
<slot {size} {sizes} />

View file

@ -9,7 +9,7 @@ export function breakpointObserver(): {
subscribe: (
this: void,
run: Subscriber<any>,
invalidate?: (value?: any) => void
invalidate?: (value?: any) => void,
) => Unsubscriber;
/**
* Returns a store readable store that returns whether the current

View file

@ -14,19 +14,19 @@ export function breakpointObserver() {
const match = {
sm: window.matchMedia(`(max-width: ${breakpoints.md}px)`),
md: window.matchMedia(
`(min-width: ${breakpoints.md}px) and (max-width: ${breakpoints.lg}px)`
`(min-width: ${breakpoints.md}px) and (max-width: ${breakpoints.lg}px)`,
),
lg: window.matchMedia(
`(min-width: ${breakpoints.lg}px) and (max-width: ${breakpoints.xlg}px)`
`(min-width: ${breakpoints.lg}px) and (max-width: ${breakpoints.xlg}px)`,
),
xlg: window.matchMedia(
`(min-width: ${breakpoints.xlg}px) and (max-width: ${breakpoints.max}px)`
`(min-width: ${breakpoints.xlg}px) and (max-width: ${breakpoints.max}px)`,
),
max: window.matchMedia(`(min-width: ${breakpoints.max}px)`),
};
const matchers = Object.entries(match);
const sizeByMedia = Object.fromEntries(
matchers.map(([size, queryList]) => [queryList.media, size])
matchers.map(([size, queryList]) => [queryList.media, size]),
);
const size = matchers.find(([size, queryList]) => queryList.matches)[0];
@ -39,12 +39,12 @@ export function breakpointObserver() {
}
matchers.forEach(([size, queryList]) =>
queryList.addEventListener("change", handleChange)
queryList.addEventListener("change", handleChange),
);
return () => {
matchers.forEach(([size, queryList]) =>
queryList.removeEventListener("change", handleChange)
queryList.removeEventListener("change", handleChange),
);
};
});

View file

@ -2,4 +2,3 @@
export { default as Breakpoint } from "./Breakpoint.svelte";
export { breakpointObserver } from "./breakpointObserver";
export { breakpoints } from "./breakpoints";