Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use CSS transitions and transforms in horizontal scroll #5193

Merged
merged 9 commits into from
Oct 12, 2021
Prev Previous commit
Next Next commit
move resize-observer and intersection service to utilities
  • Loading branch information
radium-v committed Oct 12, 2021
commit 5538019489767eda9223db308b8e60811554289b
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
import { attr, DOM, observable } from "@microsoft/fast-element";
import { Direction, eventResize, eventScroll } from "@microsoft/fast-web-utilities";
import { FoundationElement } from "../foundation-element";
import { getDirection } from "../utilities";
import { IntersectionService } from "./intersection-service";
import { getDirection } from "../utilities/direction";
import { IntersectionService } from "../utilities/intersection-service";
import type {
ConstructibleResizeObserver,
ResizeObserverClassDefinition,
} from "./resize-observer";
import type { ResizeObserverEntry } from "./resize-observer-entry";

// TODO: the Resize Observer related files are a temporary stopgap measure until
// Resize Observer types are pulled into TypeScript, which seems imminent
// At that point these files should be deleted.
// https://github.com/microsoft/TypeScript/issues/37861

declare global {
interface WindowWithResizeObserver extends Window {
ResizeObserver: ConstructibleResizeObserver;
}
}
ResizeObserverEntry,
} from "../utilities/resize-observer";

/**
* Defines the base behavior of an anchored region on a particular axis
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
import type { SyntheticViewTemplate } from "@microsoft/fast-element";
import {
attr,
booleanConverter,
nullableNumberConverter,
observable,
} from "@microsoft/fast-element";
// TODO: the Resize Observer related files are a temporary stopgap measure until
// Resize Observer types are pulled into TypeScript, which seems imminent
// At that point these files should be deleted.
// https://github.com/microsoft/TypeScript/issues/37861
import type {
ConstructibleResizeObserver,
ResizeObserverClassDefinition,
} from "../anchored-region/resize-observer";
import type { SyntheticViewTemplate } from "@microsoft/fast-element";
import { FoundationElement } from "../foundation-element";
import type {
FoundationElementDefinition,
FoundationElementTemplate,
} from "../foundation-element";
import { FoundationElement } from "../foundation-element";
import type { StartEndOptions } from "../patterns";

declare global {
interface WindowWithResizeObserver extends Window {
ResizeObserver: ConstructibleResizeObserver;
}
}
import type { StartEndOptions } from "../patterns/start-end";
import type { ResizeObserverClassDefinition } from "../utilities/resize-observer";

/**
* The views types for a horizontal-scroll {@link @microsoft/fast-foundation#(HorizontalScroll:class)}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// TODO: the Resize Observer related files are a temporary stopgap measure until
// Resize Observer types are pulled into TypeScript, which seems imminent
// At that point these files should be deleted.
// https://github.com/microsoft/TypeScript/issues/37861

/** @internal */
export interface ContentRect {
height: number;
left: number;
top: number;
width: number;
}

/** @internal */
export declare const contentRect: (target: Element) => Readonly<ContentRect>;

/** @internal */
export declare class ResizeObserverEntry {
public readonly target: Element;
public readonly contentRect: ContentRect;
constructor(target: Element);
}

/** @internal */
export declare class ResizeObserverClassDefinition {
constructor(callback: ResizeObserverCallback);
public observe(target: Element): void;
public unobserve(target: Element): void;
public disconnect(): void;
}

/** @internal */
export declare type ResizeObserverCallback = (
entries: ResizeObserverEntry[],
observer: ResizeObserverClassDefinition
) => void;

/** @internal */
export type ConstructibleResizeObserver = new (
callback: ResizeObserverCallback
) => ResizeObserverClassDefinition;

declare global {
interface WindowWithResizeObserver extends Window {
ResizeObserver: ConstructibleResizeObserver;
}
}