worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
2
node_modules/@mui/system/useMediaQuery/index.d.ts
generated
vendored
Normal file
2
node_modules/@mui/system/useMediaQuery/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export { default } from "./useMediaQuery.js";
|
||||
export * from "./useMediaQuery.js";
|
||||
25
node_modules/@mui/system/useMediaQuery/index.js
generated
vendored
Normal file
25
node_modules/@mui/system/useMediaQuery/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _exportNames = {};
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _useMediaQuery.default;
|
||||
}
|
||||
});
|
||||
var _useMediaQuery = _interopRequireWildcard(require("./useMediaQuery"));
|
||||
Object.keys(_useMediaQuery).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _useMediaQuery[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _useMediaQuery[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
32
node_modules/@mui/system/useMediaQuery/useMediaQuery.d.ts
generated
vendored
Normal file
32
node_modules/@mui/system/useMediaQuery/useMediaQuery.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
export interface UseMediaQueryOptions {
|
||||
/**
|
||||
* As `window.matchMedia()` is unavailable on the server,
|
||||
* it returns a default matches during the first mount.
|
||||
* @default false
|
||||
*/
|
||||
defaultMatches?: boolean;
|
||||
/**
|
||||
* You can provide your own implementation of matchMedia.
|
||||
* This can be used for handling an iframe content window.
|
||||
*/
|
||||
matchMedia?: typeof window.matchMedia;
|
||||
/**
|
||||
* To perform the server-side hydration, the hook needs to render twice.
|
||||
* A first time with `defaultMatches`, the value of the server, and a second time with the resolved value.
|
||||
* This double pass rendering cycle comes with a drawback: it's slower.
|
||||
* You can set this option to `true` if you use the returned value **only** client-side.
|
||||
* @default false
|
||||
*/
|
||||
noSsr?: boolean;
|
||||
/**
|
||||
* You can provide your own implementation of `matchMedia`, it's used when rendering server-side.
|
||||
*/
|
||||
ssrMatchMedia?: (query: string) => {
|
||||
matches: boolean;
|
||||
};
|
||||
}
|
||||
export declare function unstable_createUseMediaQuery(params?: {
|
||||
themeId?: string;
|
||||
}): <Theme = unknown>(queryInput: string | ((theme: Theme) => string), options?: UseMediaQueryOptions) => boolean;
|
||||
declare const useMediaQuery: <Theme = unknown>(queryInput: string | ((theme: Theme) => string), options?: UseMediaQueryOptions) => boolean;
|
||||
export default useMediaQuery;
|
||||
129
node_modules/@mui/system/useMediaQuery/useMediaQuery.js
generated
vendored
Normal file
129
node_modules/@mui/system/useMediaQuery/useMediaQuery.js
generated
vendored
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
"use strict";
|
||||
'use client';
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
exports.unstable_createUseMediaQuery = unstable_createUseMediaQuery;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
||||
var _useThemeProps = require("../useThemeProps");
|
||||
var _useThemeWithoutDefault = _interopRequireDefault(require("../useThemeWithoutDefault"));
|
||||
// TODO React 17: Remove `useMediaQueryOld` once React 17 support is removed
|
||||
function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
|
||||
const [match, setMatch] = React.useState(() => {
|
||||
if (noSsr && matchMedia) {
|
||||
return matchMedia(query).matches;
|
||||
}
|
||||
if (ssrMatchMedia) {
|
||||
return ssrMatchMedia(query).matches;
|
||||
}
|
||||
|
||||
// Once the component is mounted, we rely on the
|
||||
// event listeners to return the correct matches value.
|
||||
return defaultMatches;
|
||||
});
|
||||
(0, _useEnhancedEffect.default)(() => {
|
||||
if (!matchMedia) {
|
||||
return undefined;
|
||||
}
|
||||
const queryList = matchMedia(query);
|
||||
const updateMatch = () => {
|
||||
setMatch(queryList.matches);
|
||||
};
|
||||
updateMatch();
|
||||
queryList.addEventListener('change', updateMatch);
|
||||
return () => {
|
||||
queryList.removeEventListener('change', updateMatch);
|
||||
};
|
||||
}, [query, matchMedia]);
|
||||
return match;
|
||||
}
|
||||
|
||||
// See https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379 for why
|
||||
const safeReact = {
|
||||
...React
|
||||
};
|
||||
const maybeReactUseSyncExternalStore = safeReact.useSyncExternalStore;
|
||||
function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
|
||||
const getDefaultSnapshot = React.useCallback(() => defaultMatches, [defaultMatches]);
|
||||
const getServerSnapshot = React.useMemo(() => {
|
||||
if (noSsr && matchMedia) {
|
||||
return () => matchMedia(query).matches;
|
||||
}
|
||||
if (ssrMatchMedia !== null) {
|
||||
const {
|
||||
matches
|
||||
} = ssrMatchMedia(query);
|
||||
return () => matches;
|
||||
}
|
||||
return getDefaultSnapshot;
|
||||
}, [getDefaultSnapshot, query, ssrMatchMedia, noSsr, matchMedia]);
|
||||
const [getSnapshot, subscribe] = React.useMemo(() => {
|
||||
if (matchMedia === null) {
|
||||
return [getDefaultSnapshot, () => () => {}];
|
||||
}
|
||||
const mediaQueryList = matchMedia(query);
|
||||
return [() => mediaQueryList.matches, notify => {
|
||||
mediaQueryList.addEventListener('change', notify);
|
||||
return () => {
|
||||
mediaQueryList.removeEventListener('change', notify);
|
||||
};
|
||||
}];
|
||||
}, [getDefaultSnapshot, matchMedia, query]);
|
||||
const match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
||||
return match;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
function unstable_createUseMediaQuery(params = {}) {
|
||||
const {
|
||||
themeId
|
||||
} = params;
|
||||
return function useMediaQuery(queryInput, options = {}) {
|
||||
let theme = (0, _useThemeWithoutDefault.default)();
|
||||
if (theme && themeId) {
|
||||
theme = theme[themeId] || theme;
|
||||
}
|
||||
// Wait for jsdom to support the match media feature.
|
||||
// All the browsers MUI support have this built-in.
|
||||
// This defensive check is here for simplicity.
|
||||
// Most of the time, the match media logic isn't central to people tests.
|
||||
const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
|
||||
const {
|
||||
defaultMatches = false,
|
||||
matchMedia = supportMatchMedia ? window.matchMedia : null,
|
||||
ssrMatchMedia = null,
|
||||
noSsr = false
|
||||
} = (0, _useThemeProps.getThemeProps)({
|
||||
name: 'MuiUseMediaQuery',
|
||||
props: options,
|
||||
theme
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (typeof queryInput === 'function' && theme === null) {
|
||||
console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
|
||||
}
|
||||
}
|
||||
let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
||||
query = query.replace(/^@media( ?)/m, '');
|
||||
if (query.includes('print')) {
|
||||
console.warn([`MUI: You have provided a \`print\` query to the \`useMediaQuery\` hook.`, 'Using the print media query to modify print styles can lead to unexpected results.', 'Consider using the `displayPrint` field in the `sx` prop instead.', 'More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print.'].join('\n'));
|
||||
}
|
||||
const useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;
|
||||
const match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
React.useDebugValue({
|
||||
query,
|
||||
match
|
||||
});
|
||||
}
|
||||
return match;
|
||||
};
|
||||
}
|
||||
const useMediaQuery = unstable_createUseMediaQuery();
|
||||
var _default = exports.default = useMediaQuery;
|
||||
Loading…
Add table
Add a link
Reference in a new issue