Private
Public Access
1
0

feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
2026-04-14 18:52:25 +00:00
parent 1199eff6c3
commit dfa4010406
34820 changed files with 1003813 additions and 205 deletions

View File

@@ -0,0 +1,9 @@
import type { HTMLElementWithMetadata } from './types';
export type Controller = {
withdraw(): void;
select(element?: HTMLElement | null): HTMLElementWithMetadata | null;
readonly selectedElement: HTMLElementWithMetadata | null;
};
export declare const createController: (defaultView: Window) => Controller;
export declare const injectController: ({ defaultView }: Document) => void;
export declare const getController: (targetDocument: Document) => Controller | null;

View File

@@ -0,0 +1,3 @@
export { devtools } from './middleware';
export { devtools as middleware } from './middleware';
export type { MiddlewareData } from './types';

View File

@@ -0,0 +1,7 @@
import type { Middleware, MiddlewareState } from '@floating-ui/dom';
import type { MiddlewareData } from './types';
/**
* devtools middleware
* @public
*/
export declare const devtools: (targetDocument?: Document, middlewareDataCallback?: (state: MiddlewareState) => MiddlewareData) => Middleware;

View File

@@ -0,0 +1,30 @@
import type { CONTROLLER, ELEMENT_METADATA } from 'extension/utils/constants';
import type { Controller } from './controller';
import type { References } from 'extension/utils/references';
/**
* @public
*/
export type MiddlewareData = {
type: `${string}Middleware`;
};
export type Data = {
type: string;
};
export type MiddlewareMetadata = {
serializedData: MiddlewareData[];
references: References;
};
export type Metadata = {
serializedData: Data[];
references: References;
};
export interface HTMLElementWithMetadata<M extends Metadata = Metadata> extends HTMLElement {
[ELEMENT_METADATA]: M;
}
declare global {
interface Window {
[CONTROLLER]: Controller;
}
}
export type { devtools } from './middleware';
export type { devtools as middleware } from './middleware';

View File

@@ -0,0 +1,29 @@
import type { HTMLElementWithMetadata } from '../types';
/**
* Verifies if a given node is an HTMLElement,
* this method works seamlessly with frames and elements from different documents
*
* This is preferred over simply using `instanceof`.
* Since `instanceof` might be problematic while operating with [multiple realms](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms)
*
* @example
* ```ts
* isHTMLElement(event.target) && event.target.focus()
* isHTMLElement(event.target, {constructorName: 'HTMLInputElement'}) && event.target.value // some value
* ```
*
*/
export declare function isHTMLElement<ConstructorName extends HTMLElementConstructorName = 'HTMLElement'>(element?: unknown, options?: {
/**
* Can be used to provide a custom constructor instead of `HTMLElement`,
* Like `HTMLInputElement` for example.
*/
constructorName?: ConstructorName;
}): element is InstanceType<(typeof globalThis)[ConstructorName]>;
/**
* @internal
*/
export type HTMLElementConstructorName = 'HTMLElement' | 'HTMLAnchorElement' | 'HTMLAreaElement' | 'HTMLAudioElement' | 'HTMLBaseElement' | 'HTMLBodyElement' | 'HTMLBRElement' | 'HTMLButtonElement' | 'HTMLCanvasElement' | 'HTMLDataElement' | 'HTMLDataListElement' | 'HTMLDetailsElement' | 'HTMLDivElement' | 'HTMLDListElement' | 'HTMLEmbedElement' | 'HTMLFieldSetElement' | 'HTMLFormElement' | 'HTMLHeadingElement' | 'HTMLHeadElement' | 'HTMLHRElement' | 'HTMLHtmlElement' | 'HTMLIFrameElement' | 'HTMLImageElement' | 'HTMLInputElement' | 'HTMLModElement' | 'HTMLLabelElement' | 'HTMLLegendElement' | 'HTMLLIElement' | 'HTMLLinkElement' | 'HTMLMapElement' | 'HTMLMetaElement' | 'HTMLMeterElement' | 'HTMLObjectElement' | 'HTMLOListElement' | 'HTMLOptGroupElement' | 'HTMLOptionElement' | 'HTMLOutputElement' | 'HTMLParagraphElement' | 'HTMLParamElement' | 'HTMLPreElement' | 'HTMLProgressElement' | 'HTMLQuoteElement' | 'HTMLSlotElement' | 'HTMLScriptElement' | 'HTMLSelectElement' | 'HTMLSourceElement' | 'HTMLSpanElement' | 'HTMLStyleElement' | 'HTMLTableElement' | 'HTMLTableColElement' | 'HTMLTableRowElement' | 'HTMLTableSectionElement' | 'HTMLTemplateElement' | 'HTMLTextAreaElement' | 'HTMLTimeElement' | 'HTMLTitleElement' | 'HTMLTrackElement' | 'HTMLUListElement' | 'HTMLVideoElement';
export declare const isHTMLElementWithMetadata: (element?: HTMLElement | null) => element is HTMLElementWithMetadata<import("../types").Metadata> & {
parentElement: HTMLElement;
};

View File

@@ -0,0 +1,3 @@
import type { Serialized } from 'extension/types';
import type { References } from 'extension/utils/references';
export declare const serialize: <Data extends object>(data: Data, references: References) => Serialized<Data>;