0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

[ci] format

This commit is contained in:
Martin Trapp 2024-05-08 13:10:30 +00:00 committed by astrobot-houston
parent 35c0984230
commit a020d0028d
4 changed files with 7 additions and 15 deletions

View file

@ -1444,7 +1444,6 @@ test.describe('View Transitions', () => {
expect(text).toBe('true true');
});
test('it should be easy to define a data-theme preserving swap function', async ({
page,
astro,

View file

@ -1,5 +1,5 @@
import { swap } from './swap-functions.js';
import { updateScrollPosition } from './router.js';
import { swap } from './swap-functions.js';
import type { Direction, NavigationTypeString } from './types.js';
export const TRANSITION_BEFORE_PREPARATION = 'astro:before-preparation';
@ -117,10 +117,7 @@ export class TransitionBeforeSwapEvent extends BeforeEvent {
readonly viewTransition: ViewTransition;
swap: () => void;
constructor(
afterPreparation: BeforeEvent,
viewTransition: ViewTransition
) {
constructor(afterPreparation: BeforeEvent, viewTransition: ViewTransition) {
super(
TRANSITION_BEFORE_SWAP,
undefined,
@ -181,10 +178,7 @@ export async function doPreparation(
return event;
}
export function doSwap(
afterPreparation: BeforeEvent,
viewTransition: ViewTransition,
) {
export function doSwap(afterPreparation: BeforeEvent, viewTransition: ViewTransition) {
const event = new TransitionBeforeSwapEvent(afterPreparation, viewTransition);
document.dispatchEvent(event);
event.swap();

View file

@ -272,7 +272,6 @@ async function updateDOM(
historyState?: State,
fallback?: Fallback
) {
async function animate(phase: string) {
function isInfinite(animation: Animation) {
const effect = animation.effect;

View file

@ -138,6 +138,6 @@ export const swap = (doc:Document) => {
swapRootAttributes(doc);
swapHeadElements(doc);
const restoreFocusFunction = saveFocus();
swapBodyElement(doc.body, document.body)
swapBodyElement(doc.body, document.body);
restoreFocusFunction();
}
};