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

20
node_modules/@floating-ui/devtools/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,20 @@
MIT License
Copyright (c) 2021-present Floating UI contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

63
node_modules/@floating-ui/devtools/README.md generated vendored Normal file
View File

@@ -0,0 +1,63 @@
# Floating UI Devtools
This is the platform-agnostic devtools package of Floating UI, exposing
mechanisms to be used together with
[Chrome devtools extension](https://chromewebstore.google.com/detail/floating-ui-devtools/ninlhpbnkjidaokbmgebblaehpokdmgb?hl=en)
to help debugging Floating UI
## How to use
This package exposes a [middleware](https://floating-ui.com/docs/middleware) to
be added at the end of the middleware chain, which will inject the data to be
consumed by the devtools extension.
> ⚠️ Do not forget to remove the middleware before shipping to production
### Install
```bash
npm install @floating-ui/devtools
```
### Usage
```js
// example with @floating-ui/react
import {devtools} from '@floating-ui/devtools';
export const Default = () => {
const [isOpen, setIsOpen] = useState(false);
const {refs, floatingStyles, context} = useFloating({
open: isOpen,
onOpenChange: setIsOpen,
// add the middleware to the end of the middleware chain if in dev mode
middleware: [import.meta.env.DEV && devtools(document)],
});
const click = useClick(context);
const {getReferenceProps, getFloatingProps} = useInteractions([click]);
return (
<>
<button ref={refs.setReference} {...getReferenceProps()}>
Reference element
</button>
{isOpen && (
<div
ref={refs.setFloating}
style={floatingStyles}
{...getFloatingProps()}
>
Floating element
</div>
)}
</>
);
};
```
## Contribution
- run `pnpm --filter @floating-ui/devtools run build` from root folder

View File

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

View File

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

View File

@@ -0,0 +1,185 @@
/**
* @internal
*/
const CONTROLLER = '__FUIDT_CONTROLLER__';
/**
* @internal
*/
const ELEMENT_METADATA = '__FUIDT_ELEMENT_METADATA__';
/**
* @internal
*/
const HTML_ELEMENT_REFERENCE = '__FUIDT_HTML_ELEMENT_REFERENCE__';
/**
* @internal
*/
const SERIALIZED_DATA_CHANGE = '__FUIDT_SERIALIZED_DATA_CHANGE__';
/**
* 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
* ```
*
*/
function isHTMLElement(element, options) {
var _typedElement$ownerDo, _options$constructorN;
const typedElement = element;
return Boolean((typedElement == null || (_typedElement$ownerDo = typedElement.ownerDocument) == null ? void 0 : _typedElement$ownerDo.defaultView) && typedElement instanceof typedElement.ownerDocument.defaultView[(_options$constructorN = void 0 ) != null ? _options$constructorN : 'HTMLElement']);
}
/**
* @internal
*/
const isHTMLElementWithMetadata = element => Boolean(isHTMLElement(element) && ELEMENT_METADATA in element && element.parentElement !== null);
const createController = defaultView => {
let selectedElement = null;
const observer = new MutationObserver(mutations => {
if (!selectedElement) {
return;
}
for (const mutation of mutations) {
if (mutation.type === 'childList' && Array.from(mutation.removedNodes).includes(selectedElement)) {
controller.withdraw();
}
}
});
const controller = {
get selectedElement() {
return selectedElement;
},
select: nextSelectedElement => {
if (isHTMLElementWithMetadata(nextSelectedElement)) {
selectedElement = nextSelectedElement;
observer.observe(nextSelectedElement.parentElement, {
childList: true,
subtree: false
});
}
if (selectedElement && nextSelectedElement) {
const metadata = selectedElement[ELEMENT_METADATA];
if (metadata.references.has(nextSelectedElement)) {
return selectedElement;
}
}
controller.withdraw();
return selectedElement;
},
withdraw: () => {
selectedElement = null;
observer.disconnect();
defaultView.postMessage(SERIALIZED_DATA_CHANGE);
}
};
return controller;
};
const injectController = _ref => {
let {
defaultView
} = _ref;
if (!defaultView) {
return;
}
if (!defaultView[CONTROLLER]) {
defaultView[CONTROLLER] = createController(defaultView);
}
};
const getController = targetDocument => {
var _targetDocument$defau, _targetDocument$defau2;
injectController(targetDocument);
return (_targetDocument$defau = (_targetDocument$defau2 = targetDocument.defaultView) == null ? void 0 : _targetDocument$defau2[CONTROLLER]) != null ? _targetDocument$defau : null;
};
const serialize = (data, references) => {
const serializedData = JSON.parse(JSON.stringify(data, (_, value) => {
if (isHTMLElement(value)) return references.add(value);
if (typeof value === 'object' && value && Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== Array.prototype) {
if ('toString' in value) {
return value.toString();
}
return undefined;
}
return value;
}));
return serializedData;
};
let counter = 0;
const generateReferenceId = () => HTML_ELEMENT_REFERENCE + ":" + counter++;
const createReferences = () => {
const map = new Map();
const weakMap = new WeakMap();
const references = {
add: element => {
if (weakMap.has(element)) {
return weakMap.get(element);
}
const id = generateReferenceId();
map.set(id, element);
weakMap.set(element, id);
return id;
},
get: id => {
const element = map.get(id);
if (element && weakMap.has(element)) {
return element;
}
},
has: element => {
return weakMap.has(element);
}
};
return references;
};
/**
* devtools middleware
* @public
*/
const devtools = function (targetDocument, middlewareDataCallback) {
if (targetDocument === void 0) {
targetDocument = document;
}
if (middlewareDataCallback === void 0) {
middlewareDataCallback = floatingUIMiddlewareDataCallback;
}
return {
name: '@floating-ui/devtools',
fn: state => {
const {
[ELEMENT_METADATA]: metadata
} = isHTMLElementWithMetadata(state.elements.floating) ? state.elements.floating : Object.assign(state.elements.floating, {
[ELEMENT_METADATA]: {
references: createReferences(),
serializedData: []
}
});
const serializedData = serialize(middlewareDataCallback(state), metadata.references);
metadata.serializedData.unshift(serializedData);
const controller = getController(targetDocument);
if (metadata.serializedData.length > 1 && state.elements.floating === (controller == null ? void 0 : controller.selectedElement)) {
var _targetDocument$defau;
(_targetDocument$defau = targetDocument.defaultView) == null || _targetDocument$defau.postMessage(SERIALIZED_DATA_CHANGE);
}
return {};
}
};
};
const floatingUIMiddlewareDataCallback = state => ({
...state,
type: 'FloatingUIMiddleware'
});
export { devtools, devtools as middleware };

View File

@@ -0,0 +1,185 @@
/**
* @internal
*/
const CONTROLLER = '__FUIDT_CONTROLLER__';
/**
* @internal
*/
const ELEMENT_METADATA = '__FUIDT_ELEMENT_METADATA__';
/**
* @internal
*/
const HTML_ELEMENT_REFERENCE = '__FUIDT_HTML_ELEMENT_REFERENCE__';
/**
* @internal
*/
const SERIALIZED_DATA_CHANGE = '__FUIDT_SERIALIZED_DATA_CHANGE__';
/**
* 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
* ```
*
*/
function isHTMLElement(element, options) {
var _typedElement$ownerDo, _options$constructorN;
const typedElement = element;
return Boolean((typedElement == null || (_typedElement$ownerDo = typedElement.ownerDocument) == null ? void 0 : _typedElement$ownerDo.defaultView) && typedElement instanceof typedElement.ownerDocument.defaultView[(_options$constructorN = void 0 ) != null ? _options$constructorN : 'HTMLElement']);
}
/**
* @internal
*/
const isHTMLElementWithMetadata = element => Boolean(isHTMLElement(element) && ELEMENT_METADATA in element && element.parentElement !== null);
const createController = defaultView => {
let selectedElement = null;
const observer = new MutationObserver(mutations => {
if (!selectedElement) {
return;
}
for (const mutation of mutations) {
if (mutation.type === 'childList' && Array.from(mutation.removedNodes).includes(selectedElement)) {
controller.withdraw();
}
}
});
const controller = {
get selectedElement() {
return selectedElement;
},
select: nextSelectedElement => {
if (isHTMLElementWithMetadata(nextSelectedElement)) {
selectedElement = nextSelectedElement;
observer.observe(nextSelectedElement.parentElement, {
childList: true,
subtree: false
});
}
if (selectedElement && nextSelectedElement) {
const metadata = selectedElement[ELEMENT_METADATA];
if (metadata.references.has(nextSelectedElement)) {
return selectedElement;
}
}
controller.withdraw();
return selectedElement;
},
withdraw: () => {
selectedElement = null;
observer.disconnect();
defaultView.postMessage(SERIALIZED_DATA_CHANGE);
}
};
return controller;
};
const injectController = _ref => {
let {
defaultView
} = _ref;
if (!defaultView) {
return;
}
if (!defaultView[CONTROLLER]) {
defaultView[CONTROLLER] = createController(defaultView);
}
};
const getController = targetDocument => {
var _targetDocument$defau, _targetDocument$defau2;
injectController(targetDocument);
return (_targetDocument$defau = (_targetDocument$defau2 = targetDocument.defaultView) == null ? void 0 : _targetDocument$defau2[CONTROLLER]) != null ? _targetDocument$defau : null;
};
const serialize = (data, references) => {
const serializedData = JSON.parse(JSON.stringify(data, (_, value) => {
if (isHTMLElement(value)) return references.add(value);
if (typeof value === 'object' && value && Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== Array.prototype) {
if ('toString' in value) {
return value.toString();
}
return undefined;
}
return value;
}));
return serializedData;
};
let counter = 0;
const generateReferenceId = () => HTML_ELEMENT_REFERENCE + ":" + counter++;
const createReferences = () => {
const map = new Map();
const weakMap = new WeakMap();
const references = {
add: element => {
if (weakMap.has(element)) {
return weakMap.get(element);
}
const id = generateReferenceId();
map.set(id, element);
weakMap.set(element, id);
return id;
},
get: id => {
const element = map.get(id);
if (element && weakMap.has(element)) {
return element;
}
},
has: element => {
return weakMap.has(element);
}
};
return references;
};
/**
* devtools middleware
* @public
*/
const devtools = function (targetDocument, middlewareDataCallback) {
if (targetDocument === void 0) {
targetDocument = document;
}
if (middlewareDataCallback === void 0) {
middlewareDataCallback = floatingUIMiddlewareDataCallback;
}
return {
name: '@floating-ui/devtools',
fn: state => {
const {
[ELEMENT_METADATA]: metadata
} = isHTMLElementWithMetadata(state.elements.floating) ? state.elements.floating : Object.assign(state.elements.floating, {
[ELEMENT_METADATA]: {
references: createReferences(),
serializedData: []
}
});
const serializedData = serialize(middlewareDataCallback(state), metadata.references);
metadata.serializedData.unshift(serializedData);
const controller = getController(targetDocument);
if (metadata.serializedData.length > 1 && state.elements.floating === (controller == null ? void 0 : controller.selectedElement)) {
var _targetDocument$defau;
(_targetDocument$defau = targetDocument.defaultView) == null || _targetDocument$defau.postMessage(SERIALIZED_DATA_CHANGE);
}
return {};
}
};
};
const floatingUIMiddlewareDataCallback = state => ({
...state,
type: 'FloatingUIMiddleware'
});
export { devtools, devtools as middleware };

View File

@@ -0,0 +1,194 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.FloatingUIDevtools = {}));
})(this, (function (exports) { 'use strict';
/**
* @internal
*/
const CONTROLLER = '__FUIDT_CONTROLLER__';
/**
* @internal
*/
const ELEMENT_METADATA = '__FUIDT_ELEMENT_METADATA__';
/**
* @internal
*/
const HTML_ELEMENT_REFERENCE = '__FUIDT_HTML_ELEMENT_REFERENCE__';
/**
* @internal
*/
const SERIALIZED_DATA_CHANGE = '__FUIDT_SERIALIZED_DATA_CHANGE__';
/**
* 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
* ```
*
*/
function isHTMLElement(element, options) {
var _typedElement$ownerDo, _options$constructorN;
const typedElement = element;
return Boolean((typedElement == null || (_typedElement$ownerDo = typedElement.ownerDocument) == null ? void 0 : _typedElement$ownerDo.defaultView) && typedElement instanceof typedElement.ownerDocument.defaultView[(_options$constructorN = void 0 ) != null ? _options$constructorN : 'HTMLElement']);
}
/**
* @internal
*/
const isHTMLElementWithMetadata = element => Boolean(isHTMLElement(element) && ELEMENT_METADATA in element && element.parentElement !== null);
const createController = defaultView => {
let selectedElement = null;
const observer = new MutationObserver(mutations => {
if (!selectedElement) {
return;
}
for (const mutation of mutations) {
if (mutation.type === 'childList' && Array.from(mutation.removedNodes).includes(selectedElement)) {
controller.withdraw();
}
}
});
const controller = {
get selectedElement() {
return selectedElement;
},
select: nextSelectedElement => {
if (isHTMLElementWithMetadata(nextSelectedElement)) {
selectedElement = nextSelectedElement;
observer.observe(nextSelectedElement.parentElement, {
childList: true,
subtree: false
});
}
if (selectedElement && nextSelectedElement) {
const metadata = selectedElement[ELEMENT_METADATA];
if (metadata.references.has(nextSelectedElement)) {
return selectedElement;
}
}
controller.withdraw();
return selectedElement;
},
withdraw: () => {
selectedElement = null;
observer.disconnect();
defaultView.postMessage(SERIALIZED_DATA_CHANGE);
}
};
return controller;
};
const injectController = _ref => {
let {
defaultView
} = _ref;
if (!defaultView) {
return;
}
if (!defaultView[CONTROLLER]) {
defaultView[CONTROLLER] = createController(defaultView);
}
};
const getController = targetDocument => {
var _targetDocument$defau, _targetDocument$defau2;
injectController(targetDocument);
return (_targetDocument$defau = (_targetDocument$defau2 = targetDocument.defaultView) == null ? void 0 : _targetDocument$defau2[CONTROLLER]) != null ? _targetDocument$defau : null;
};
const serialize = (data, references) => {
const serializedData = JSON.parse(JSON.stringify(data, (_, value) => {
if (isHTMLElement(value)) return references.add(value);
if (typeof value === 'object' && value && Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== Array.prototype) {
if ('toString' in value) {
return value.toString();
}
return undefined;
}
return value;
}));
return serializedData;
};
let counter = 0;
const generateReferenceId = () => HTML_ELEMENT_REFERENCE + ":" + counter++;
const createReferences = () => {
const map = new Map();
const weakMap = new WeakMap();
const references = {
add: element => {
if (weakMap.has(element)) {
return weakMap.get(element);
}
const id = generateReferenceId();
map.set(id, element);
weakMap.set(element, id);
return id;
},
get: id => {
const element = map.get(id);
if (element && weakMap.has(element)) {
return element;
}
},
has: element => {
return weakMap.has(element);
}
};
return references;
};
/**
* devtools middleware
* @public
*/
const devtools = function (targetDocument, middlewareDataCallback) {
if (targetDocument === void 0) {
targetDocument = document;
}
if (middlewareDataCallback === void 0) {
middlewareDataCallback = floatingUIMiddlewareDataCallback;
}
return {
name: '@floating-ui/devtools',
fn: state => {
const {
[ELEMENT_METADATA]: metadata
} = isHTMLElementWithMetadata(state.elements.floating) ? state.elements.floating : Object.assign(state.elements.floating, {
[ELEMENT_METADATA]: {
references: createReferences(),
serializedData: []
}
});
const serializedData = serialize(middlewareDataCallback(state), metadata.references);
metadata.serializedData.unshift(serializedData);
const controller = getController(targetDocument);
if (metadata.serializedData.length > 1 && state.elements.floating === (controller == null ? void 0 : controller.selectedElement)) {
var _targetDocument$defau;
(_targetDocument$defau = targetDocument.defaultView) == null || _targetDocument$defau.postMessage(SERIALIZED_DATA_CHANGE);
}
return {};
}
};
};
const floatingUIMiddlewareDataCallback = state => ({
...state,
type: 'FloatingUIMiddleware'
});
exports.devtools = devtools;
exports.middleware = devtools;
}));

View File

@@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIDevtools={})}(this,(function(e){"use strict";const t="__FUIDT_CONTROLLER__",n="__FUIDT_ELEMENT_METADATA__",o="__FUIDT_SERIALIZED_DATA_CHANGE__";function l(e,t){var n;const o=e;return Boolean((null==o||null==(n=o.ownerDocument)?void 0:n.defaultView)&&o instanceof o.ownerDocument.defaultView[null!=void 0?undefined:"HTMLElement"])}const i=e=>Boolean(l(e)&&n in e&&null!==e.parentElement),r=e=>{let{defaultView:l}=e;l&&(l[t]||(l[t]=(e=>{let t=null;const l=new MutationObserver((e=>{if(t)for(const n of e)"childList"===n.type&&Array.from(n.removedNodes).includes(t)&&r.withdraw()})),r={get selectedElement(){return t},select:e=>(i(e)&&(t=e,l.observe(e.parentElement,{childList:!0,subtree:!1})),t&&e&&t[n].references.has(e)||r.withdraw(),t),withdraw:()=>{t=null,l.disconnect(),e.postMessage(o)}};return r})(l)))};let s=0;const a=()=>{const e=new Map,t=new WeakMap;return{add:n=>{if(t.has(n))return t.get(n);const o="__FUIDT_HTML_ELEMENT_REFERENCE__:"+s++;return e.set(o,n),t.set(n,o),o},get:n=>{const o=e.get(n);if(o&&t.has(o))return o},has:e=>t.has(e)}},d=function(e,s){return void 0===e&&(e=document),void 0===s&&(s=u),{name:"@floating-ui/devtools",fn:d=>{const{[n]:u}=i(d.elements.floating)?d.elements.floating:Object.assign(d.elements.floating,{[n]:{references:a(),serializedData:[]}}),f=(c=s(d),_=u.references,JSON.parse(JSON.stringify(c,((e,t)=>l(t)?_.add(t):"object"==typeof t&&t&&Object.getPrototypeOf(t)!==Object.prototype&&Object.getPrototypeOf(t)!==Array.prototype?"toString"in t?t.toString():void 0:t))));var c,_;u.serializedData.unshift(f);const p=(e=>{var n,o;return r(e),null!=(n=null==(o=e.defaultView)?void 0:o[t])?n:null})(e);var g;u.serializedData.length>1&&d.elements.floating===(null==p?void 0:p.selectedElement)&&(null==(g=e.defaultView)||g.postMessage(o));return{}}}},u=e=>({...e,type:"FloatingUIMiddleware"});e.devtools=d,e.middleware=d}));

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>;

49
node_modules/@floating-ui/devtools/package.json generated vendored Normal file
View File

@@ -0,0 +1,49 @@
{
"name": "@floating-ui/devtools",
"version": "0.2.3",
"main": "./dist/floating-ui.devtools.umd.js",
"module": "./dist/floating-ui.devtools.esm.js",
"unpkg": "./dist/floating-ui.devtools.umd.min.js",
"types": "./dist/floating-ui.devtools.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/floating-ui.devtools.d.mts",
"default": "./dist/floating-ui.devtools.mjs"
},
"types": "./dist/floating-ui.devtools.d.ts",
"module": "./dist/floating-ui.devtools.esm.js",
"default": "./dist/floating-ui.devtools.umd.js"
}
},
"files": [
"dist/",
"**/*.d.ts",
"**/*.d.mts"
],
"license": "MIT",
"bugs": "https://github.com/floating-ui/floating-ui",
"repository": {
"type": "git",
"url": "https://github.com/floating-ui/floating-ui.git",
"directory": "packages/devtools"
},
"peerDependencies": {
"@floating-ui/dom": "^1.0.0"
},
"devDependencies": {
"@floating-ui/dom": "^1.0.0",
"config": "0.0.0"
},
"scripts": {
"lint": "eslint .",
"format": "prettier --write .",
"clean": "rimraf dist out-tsc",
"dev": "rollup -c -w",
"build": "rollup -c",
"build:api": "build-api",
"publint": "publint",
"typecheck": "tsc -b"
}
}