first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import * as React from 'react';
/**
* Props for the WindowProvider component.
*/
export type WindowProviderProps = {
/**
* Provide the active window.
*/
window: Window | undefined;
children?: React.ReactNode;
};
/**
* Context for providing the window.
*/
export declare const WindowContext: React.Context<WindowProviderProps>;
/**
* Hook to access the window object. This can be overridden contextually using the `WindowProvider`.
*/
export declare const useWindow: () => Window | undefined;
/**
* Hook to access the document object. This can be overridden contextually using the `WindowProvider`.
*/
export declare const useDocument: () => Document | undefined;
/**
* Component to provide the window object contextually. This is useful when rendering content to an element
* contained within a child window or iframe element, where event handlers and styling must be projected
* to an alternative window or document.
*/
export declare const WindowProvider: React.FunctionComponent<WindowProviderProps>;
+25
View File
@@ -0,0 +1,25 @@
import * as React from 'react';
/**
* Context for providing the window.
*/
export var WindowContext = React.createContext({
// eslint-disable-next-line no-restricted-globals
window: typeof window === 'object' ? window : undefined,
});
/**
* Hook to access the window object. This can be overridden contextually using the `WindowProvider`.
*/
export var useWindow = function () { return React.useContext(WindowContext).window; };
/**
* Hook to access the document object. This can be overridden contextually using the `WindowProvider`.
*/
export var useDocument = function () { var _a; return (_a = React.useContext(WindowContext).window) === null || _a === void 0 ? void 0 : _a.document; };
/**
* Component to provide the window object contextually. This is useful when rendering content to an element
* contained within a child window or iframe element, where event handlers and styling must be projected
* to an alternative window or document.
*/
export var WindowProvider = function (props) {
return React.createElement(WindowContext.Provider, { value: props }, props.children);
};
//# sourceMappingURL=WindowProvider.js.map
@@ -0,0 +1 @@
{"version":3,"file":"WindowProvider.js","sourceRoot":"../src/","sources":["WindowProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B;;GAEG;AACH,MAAM,CAAC,IAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAsB;IACpE,iDAAiD;IACjD,MAAM,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;CACxD,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,IAAM,SAAS,GAAG,cAA0B,OAAA,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,MAAM,EAAtC,CAAsC,CAAC;AAE1F;;GAEG;AACH,MAAM,CAAC,IAAM,WAAW,GAAG,sBAA4B,OAAA,MAAA,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,MAAM,0CAAE,QAAQ,CAAA,EAAA,CAAC;AAExG;;;;GAIG;AACH,MAAM,CAAC,IAAM,cAAc,GAAiD,UAAA,KAAK;IAC/E,OAAO,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAG,KAAK,CAAC,QAAQ,CAA0B,CAAC;AACzF,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\n/**\n * Props for the WindowProvider component.\n */\nexport type WindowProviderProps = {\n /**\n * Provide the active window.\n */\n window: Window | undefined;\n children?: React.ReactNode;\n};\n\n/**\n * Context for providing the window.\n */\nexport const WindowContext = React.createContext<WindowProviderProps>({\n // eslint-disable-next-line no-restricted-globals\n window: typeof window === 'object' ? window : undefined,\n});\n\n/**\n * Hook to access the window object. This can be overridden contextually using the `WindowProvider`.\n */\nexport const useWindow = (): Window | undefined => React.useContext(WindowContext).window;\n\n/**\n * Hook to access the document object. This can be overridden contextually using the `WindowProvider`.\n */\nexport const useDocument = (): Document | undefined => React.useContext(WindowContext).window?.document;\n\n/**\n * Component to provide the window object contextually. This is useful when rendering content to an element\n * contained within a child window or iframe element, where event handlers and styling must be projected\n * to an alternative window or document.\n */\nexport const WindowProvider: React.FunctionComponent<WindowProviderProps> = props => {\n return <WindowContext.Provider value={props}>{props.children}</WindowContext.Provider>;\n};\n"]}
+3
View File
@@ -0,0 +1,3 @@
export { WindowContext, useWindow, useDocument, WindowProvider } from './WindowProvider';
export type { WindowProviderProps } from './WindowProvider';
import './version';
+3
View File
@@ -0,0 +1,3 @@
export { WindowContext, useWindow, useDocument, WindowProvider } from './WindowProvider';
import './version';
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGzF,OAAO,WAAW,CAAC","sourcesContent":["export { WindowContext, useWindow, useDocument, WindowProvider } from './WindowProvider';\nexport type { WindowProviderProps } from './WindowProvider';\n\nimport './version';\n"]}
+1
View File
@@ -0,0 +1 @@
export {};
+5
View File
@@ -0,0 +1,5 @@
// Do not modify this file; it is generated as part of publish.
// The checked in version is a placeholder only and will not be updated.
import { setVersion } from '@fluentui/set-version';
setVersion('@fluentui/react-window-provider', '2.3.2');
//# sourceMappingURL=version.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wEAAwE;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,UAAU,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/react-window-provider', '2.3.2');"]}