@mui/x-internals
Advanced tools
Comparing version 8.0.0-alpha.11 to 8.0.0-alpha.12
const is = Object.is; | ||
/** | ||
* Fast shallow compare for objects. | ||
* @returns true if objects are equal. | ||
*/ | ||
export function fastObjectShallowCompare(a, b) { | ||
@@ -3,0 +8,0 @@ if (a === b) { |
import * as React from 'react'; | ||
import reactMajor from "../reactMajor.js"; | ||
import reactMajor from "../reactMajor/index.js"; | ||
@@ -4,0 +4,0 @@ // Compatibility shim that ensures stable props object for forwardRef components |
const warnedOnceCache = new Set(); | ||
// TODO move to @base_ui/internals. Base UI, etc. need this helper. | ||
/** | ||
* Logs a message to the console on development mode. The warning will only be logged once. | ||
* | ||
* The message is the log's cache key. Two identical messages will only be logged once. | ||
* | ||
* This function is a no-op in production. | ||
* | ||
* @param message the message to log | ||
* @param gravity the gravity of the warning. Defaults to `'warning'`. | ||
* @returns | ||
*/ | ||
export function warnOnce(message, gravity = 'warning') { | ||
@@ -5,0 +15,0 @@ if (process.env.NODE_ENV === 'production') { |
export type EventListener = (...args: any[]) => void; | ||
export interface EventListenerOptions { | ||
isFirst?: boolean; | ||
isFirst?: boolean; | ||
} | ||
interface EventListenerCollection { | ||
/** | ||
* List of listeners to run before the others | ||
* They are run in the opposite order of the registration order | ||
*/ | ||
highPriority: Map<EventListener, true>; | ||
/** | ||
* List of events to run after the high priority listeners | ||
* They are run in the registration order | ||
*/ | ||
regular: Map<EventListener, true>; | ||
/** | ||
* List of listeners to run before the others | ||
* They are run in the opposite order of the registration order | ||
*/ | ||
highPriority: Map<EventListener, true>; | ||
/** | ||
* List of events to run after the high priority listeners | ||
* They are run in the registration order | ||
*/ | ||
regular: Map<EventListener, true>; | ||
} | ||
export declare class EventManager { | ||
maxListeners: number; | ||
warnOnce: boolean; | ||
events: { | ||
[eventName: string]: EventListenerCollection; | ||
}; | ||
on(eventName: string, listener: EventListener, options?: EventListenerOptions): void; | ||
removeListener(eventName: string, listener: EventListener): void; | ||
removeAllListeners(): void; | ||
emit(eventName: string, ...args: any[]): void; | ||
once(eventName: string, listener: EventListener): void; | ||
maxListeners: number; | ||
warnOnce: boolean; | ||
events: { | ||
[eventName: string]: EventListenerCollection; | ||
}; | ||
on(eventName: string, listener: EventListener, options?: EventListenerOptions): void; | ||
removeListener(eventName: string, listener: EventListener): void; | ||
removeAllListeners(): void; | ||
emit(eventName: string, ...args: any[]): void; | ||
once(eventName: string, listener: EventListener): void; | ||
} | ||
export {}; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
export { EventManager } from './EventManager'; | ||
export type { EventListenerOptions } from './EventManager'; | ||
export { EventManager } from "./EventManager.js"; | ||
export type { EventListenerOptions } from './EventManager'; |
@@ -1,1 +0,1 @@ | ||
export declare function fastMemo<T>(component: T): T; | ||
export declare function fastMemo<T>(component: T): T; |
@@ -1,1 +0,1 @@ | ||
export { fastMemo } from './fastMemo'; | ||
export { fastMemo } from "./fastMemo.js"; |
@@ -1,1 +0,5 @@ | ||
export declare function fastObjectShallowCompare<T extends Record<string, any> | null>(a: T, b: T): boolean; | ||
/** | ||
* Fast shallow compare for objects. | ||
* @returns true if objects are equal. | ||
*/ | ||
export declare function fastObjectShallowCompare<T extends Record<string, any> | null>(a: T, b: T): boolean; |
@@ -8,2 +8,7 @@ "use strict"; | ||
const is = Object.is; | ||
/** | ||
* Fast shallow compare for objects. | ||
* @returns true if objects are equal. | ||
*/ | ||
function fastObjectShallowCompare(a, b) { | ||
@@ -10,0 +15,0 @@ if (a === b) { |
@@ -1,1 +0,1 @@ | ||
export { fastObjectShallowCompare } from './fastObjectShallowCompare'; | ||
export { fastObjectShallowCompare } from "./fastObjectShallowCompare.js"; |
import * as React from 'react'; | ||
export declare const forwardRef: <T, P = {}>(render: React.ForwardRefRenderFunction<T, P & { | ||
ref: React.Ref<T>; | ||
}>) => React.ForwardRefExoticComponent<P> | React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>; | ||
ref: React.Ref<T>; | ||
}>) => React.ForwardRefExoticComponent<P> | React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>; |
@@ -1,1 +0,1 @@ | ||
export * from './forwardRef'; | ||
export * from "./forwardRef.js"; |
@@ -1,1 +0,1 @@ | ||
export { isObjectEmpty } from './isObjectEmpty'; | ||
export { isObjectEmpty } from "./isObjectEmpty.js"; |
@@ -1,1 +0,1 @@ | ||
export declare function isObjectEmpty(object: any): boolean; | ||
export declare function isObjectEmpty(object: any): boolean; |
const is = Object.is; | ||
/** | ||
* Fast shallow compare for objects. | ||
* @returns true if objects are equal. | ||
*/ | ||
export function fastObjectShallowCompare(a, b) { | ||
@@ -3,0 +8,0 @@ if (a === b) { |
import * as React from 'react'; | ||
import reactMajor from "../reactMajor.js"; | ||
import reactMajor from "../reactMajor/index.js"; | ||
@@ -4,0 +4,0 @@ // Compatibility shim that ensures stable props object for forwardRef components |
const warnedOnceCache = new Set(); | ||
// TODO move to @base_ui/internals. Base UI, etc. need this helper. | ||
/** | ||
* Logs a message to the console on development mode. The warning will only be logged once. | ||
* | ||
* The message is the log's cache key. Two identical messages will only be logged once. | ||
* | ||
* This function is a no-op in production. | ||
* | ||
* @param message the message to log | ||
* @param gravity the gravity of the warning. Defaults to `'warning'`. | ||
* @returns | ||
*/ | ||
export function warnOnce(message, gravity = 'warning') { | ||
@@ -5,0 +15,0 @@ if (process.env.NODE_ENV === 'production') { |
{ | ||
"name": "@mui/x-internals", | ||
"version": "8.0.0-alpha.11", | ||
"version": "8.0.0-alpha.12", | ||
"description": "Utility functions for the MUI X packages (internal use only).", | ||
@@ -34,4 +34,4 @@ "author": "MUI Team", | ||
"dependencies": { | ||
"@babel/runtime": "^7.26.7", | ||
"@mui/utils": "^5.16.6 || ^6.0.0" | ||
"@babel/runtime": "^7.26.9", | ||
"@mui/utils": "^5.16.6 || ^6.0.0 || ^7.0.0-alpha" | ||
}, | ||
@@ -44,3 +44,33 @@ "peerDependencies": { | ||
}, | ||
"private": false | ||
"private": false, | ||
"exports": { | ||
".": { | ||
"require": { | ||
"types": "./index.d.ts", | ||
"default": "./index.js" | ||
}, | ||
"import": { | ||
"types": "./esm/index.d.ts", | ||
"default": "./esm/index.js" | ||
}, | ||
"mui-modern": { | ||
"types": "./modern/index.d.ts", | ||
"default": "./modern/index.js" | ||
} | ||
}, | ||
"./*": { | ||
"require": { | ||
"types": "./*/index.d.ts", | ||
"default": "./*/index.js" | ||
}, | ||
"import": { | ||
"types": "./esm/*/index.d.ts", | ||
"default": "./esm/*/index.js" | ||
}, | ||
"mui-modern": { | ||
"types": "./modern/*/index.d.ts", | ||
"default": "./modern/*/index.js" | ||
} | ||
} | ||
} | ||
} |
import * as React from 'react'; | ||
export type PropsFromSlot<Slot extends React.JSXElementConstructor<any> | React.ElementType | null | undefined> = NonNullable<Slot> extends React.ElementType<infer P> ? P : React.ComponentProps<NonNullable<Slot>>; | ||
export type PropsFromSlot<Slot extends React.JSXElementConstructor<any> | React.ElementType | null | undefined> = NonNullable<Slot> extends React.ElementType<infer P> ? P : React.ComponentProps<NonNullable<Slot>>; |
@@ -1,1 +0,1 @@ | ||
export { throttle } from './throttle'; | ||
export { throttle } from "./throttle.js"; |
export interface Cancelable { | ||
clear(): void; | ||
clear(): void; | ||
} | ||
export declare function throttle<T extends (...args: any[]) => any>(func: T, wait?: number): T & Cancelable; | ||
export declare function throttle<T extends (...args: any[]) => any>(func: T, wait?: number): T & Cancelable; |
@@ -10,5 +10,3 @@ type CapitalizeFirstLetter<S extends string> = S extends `${infer First}${infer Rest}` ? `${Uppercase<First>}${Rest}` : S; | ||
*/ | ||
export type AppendKeys<T, P extends string, K extends string = string> = { | ||
[key in keyof T as key extends K ? `${key}${CapitalizeFirstLetter<P>}` : key]: T[key]; | ||
}; | ||
export {}; | ||
export type AppendKeys<T, P extends string, K extends string = string> = { [key in keyof T as key extends K ? `${key}${CapitalizeFirstLetter<P>}` : key]: T[key] }; | ||
export {}; |
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
export type DefaultizedProps<P extends {}, RequiredProps extends keyof P, AdditionalProps extends {} = {}> = Omit<P, RequiredProps | keyof AdditionalProps> & Required<Pick<P, RequiredProps>> & AdditionalProps; | ||
export type DefaultizedProps<P extends {}, RequiredProps extends keyof P, AdditionalProps extends {} = {}> = Omit<P, RequiredProps | keyof AdditionalProps> & Required<Pick<P, RequiredProps>> & AdditionalProps; |
@@ -1,7 +0,7 @@ | ||
export * from './AppendKeys'; | ||
export * from './DefaultizedProps'; | ||
export * from './MakeOptional'; | ||
export * from './MakeRequired'; | ||
export * from './PrependKeys'; | ||
export * from './RefObject'; | ||
export * from './SlotComponentPropsFromProps'; | ||
export * from "./AppendKeys.js"; | ||
export * from "./DefaultizedProps.js"; | ||
export * from "./MakeOptional.js"; | ||
export * from "./MakeRequired.js"; | ||
export * from "./PrependKeys.js"; | ||
export * from "./RefObject.js"; | ||
export * from "./SlotComponentPropsFromProps.js"; |
@@ -7,2 +7,2 @@ /** | ||
*/ | ||
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>; | ||
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>; |
@@ -7,2 +7,2 @@ /** | ||
*/ | ||
export type MakeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>; | ||
export type MakeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>; |
@@ -10,5 +10,3 @@ type CapitalizeFirstLetter<S extends string> = S extends `${infer First}${infer Rest}` ? `${Uppercase<First>}${Rest}` : S; | ||
*/ | ||
export type PrependKeys<T, P extends string, K extends string = string> = { | ||
[key in keyof T as key extends K ? `${P}${CapitalizeFirstLetter<key>}` : key]: T[key]; | ||
}; | ||
export {}; | ||
export type PrependKeys<T, P extends string, K extends string = string> = { [key in keyof T as key extends K ? `${P}${CapitalizeFirstLetter<key>}` : key]: T[key] }; | ||
export {}; |
@@ -8,2 +8,2 @@ import * as React from 'react'; | ||
*/ | ||
export type RefObject<T> = typeof React.useRef extends () => any ? React.MutableRefObject<T> : React.RefObject<T>; | ||
export type RefObject<T> = typeof React.useRef extends (() => any) ? React.MutableRefObject<T> : React.RefObject<T>; |
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
export type SlotComponentPropsFromProps<TProps extends {}, TOverrides extends {}, TOwnerState extends {}> = (Partial<TProps> & TOverrides) | ((ownerState: TOwnerState) => Partial<TProps> & TOverrides); | ||
export type SlotComponentPropsFromProps<TProps extends {}, TOverrides extends {}, TOwnerState extends {}> = (Partial<TProps> & TOverrides) | ((ownerState: TOwnerState) => Partial<TProps> & TOverrides); |
@@ -1,1 +0,1 @@ | ||
export { useResizeObserver } from './useResizeObserver'; | ||
export { useResizeObserver } from "./useResizeObserver.js"; |
import * as React from 'react'; | ||
export declare function useResizeObserver(ref: React.RefObject<HTMLElement | undefined | null>, fn: (entries: ResizeObserverEntry[]) => void, enabled?: boolean): void; | ||
export declare function useResizeObserver(ref: React.RefObject<HTMLElement | undefined | null>, fn: (entries: ResizeObserverEntry[]) => void, enabled?: boolean): void; |
@@ -1,1 +0,1 @@ | ||
export { warnOnce, clearWarningsCache } from './warning'; | ||
export { warnOnce, clearWarningsCache } from "./warning.js"; |
@@ -0,2 +1,13 @@ | ||
/** | ||
* Logs a message to the console on development mode. The warning will only be logged once. | ||
* | ||
* The message is the log's cache key. Two identical messages will only be logged once. | ||
* | ||
* This function is a no-op in production. | ||
* | ||
* @param message the message to log | ||
* @param gravity the gravity of the warning. Defaults to `'warning'`. | ||
* @returns | ||
*/ | ||
export declare function warnOnce(message: string | string[], gravity?: 'warning' | 'error'): void; | ||
export declare function clearWarningsCache(): void; | ||
export declare function clearWarningsCache(): void; |
@@ -10,3 +10,13 @@ "use strict"; | ||
// TODO move to @base_ui/internals. Base UI, etc. need this helper. | ||
/** | ||
* Logs a message to the console on development mode. The warning will only be logged once. | ||
* | ||
* The message is the log's cache key. Two identical messages will only be logged once. | ||
* | ||
* This function is a no-op in production. | ||
* | ||
* @param message the message to log | ||
* @param gravity the gravity of the warning. Defaults to `'warning'`. | ||
* @returns | ||
*/ | ||
function warnOnce(message, gravity = 'warning') { | ||
@@ -13,0 +23,0 @@ if (process.env.NODE_ENV === 'production') { |
Sorry, the diff of this file is too big to display
457460
175
1339
+ Added@mui/utils@7.0.0-alpha.2(transitive)
- Removed@mui/utils@6.4.3(transitive)
Updated@babel/runtime@^7.26.9