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