Merge branch 'main' into plugin-ux-fix
This commit is contained in:
commit
0178bedd12
2 changed files with 63 additions and 7 deletions
|
|
@ -1,10 +1,11 @@
|
|||
import type { StackScreenProps } from '@react-navigation/stack'
|
||||
import type { ReactNavigationParamList } from '@revenge-mod/externals/react-navigation'
|
||||
import type { AnyFunction } from '@revenge-mod/utils/types'
|
||||
import type { AnyFunction, AnyObject } from '@revenge-mod/utils/types'
|
||||
import type {
|
||||
ComponentProps,
|
||||
ComponentType,
|
||||
FC,
|
||||
ForwardRefExoticComponent,
|
||||
MemoExoticComponent,
|
||||
ReactElement,
|
||||
ReactNode,
|
||||
|
|
@ -180,9 +181,20 @@ export namespace DiscordModules {
|
|||
openLazy<T extends ComponentType<any>>(
|
||||
sheet: Promise<{ default: T }>,
|
||||
key: string,
|
||||
props: ComponentProps<T>,
|
||||
props: {
|
||||
impressionName?: string
|
||||
impressionProperties?: AnyObject
|
||||
backdropKind?: string
|
||||
disableHapticOnOpen?: boolean
|
||||
appEntryKey?: string
|
||||
} & ComponentProps<T>,
|
||||
// See ActionSheetStore reducer
|
||||
stackingBehavior?: 'replaceTopSheet' | 'replaceAll' | 'stack',
|
||||
): void
|
||||
hideActionSheet(key?: string): void
|
||||
hideAllActionSheets(): void
|
||||
setActionSheetZIndex(zIndex: number): void
|
||||
resetActionSheetsForAppEntryKey(appEntryKey: string): void
|
||||
}
|
||||
|
||||
// export namespace ActionSheetActionCreators {
|
||||
|
|
@ -397,10 +409,50 @@ export namespace DiscordModules {
|
|||
// export type FormCheckbox = FC
|
||||
|
||||
export interface ActionSheetProps {
|
||||
children: ReactNode
|
||||
scrollable?: boolean
|
||||
startExpanded?: boolean
|
||||
/** Whether the bottom sheet handle is disabled. */
|
||||
handleDisabled?: boolean
|
||||
showGradient?: boolean
|
||||
|
||||
startHeight?: number
|
||||
maxHeight?: number
|
||||
containerHeight?: number
|
||||
contentHeight?: number
|
||||
backdropOpacity?: number
|
||||
|
||||
children?: ReactNode
|
||||
header?: ReactNode
|
||||
footer?: ReactNode
|
||||
extraContent?: ReactNode
|
||||
backdropChildren?: ReactNode
|
||||
|
||||
handleComponent?: ComponentType<any> | null
|
||||
backgroundComponent?: ComponentType<any>
|
||||
|
||||
bodyStyles?: StyleProp<ViewStyle>
|
||||
contentStyles?: StyleProp<ViewStyle>
|
||||
backgroundStyles?: StyleProp<ViewStyle>
|
||||
borderGradient?: string[] | Record<string, any>
|
||||
|
||||
onExpand?: () => void
|
||||
onDismiss?: () => void
|
||||
animatedIndex?: unknown
|
||||
|
||||
keyboardShouldPersistTaps?: 'always' | 'never' | 'handled' | boolean
|
||||
dismissAccessibilityLabel?: string
|
||||
}
|
||||
|
||||
export type ActionSheet = FC<ActionSheetProps>
|
||||
export type ActionSheet = ForwardRefExoticComponent<
|
||||
ActionSheetProps &
|
||||
// See useBottomSheetImperativeHandle
|
||||
RefAttributes<{
|
||||
expandActionSheet(): void
|
||||
closeActionSheet(force?: boolean): void
|
||||
collapseActionSheet(): void
|
||||
snapToIndex(index: number): void
|
||||
}>
|
||||
>
|
||||
|
||||
export interface ActionSheetCloseButtonProps
|
||||
extends Pick<ComponentProps<IconButton>, 'variant' | 'onPress'> {}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import {
|
|||
ApiDependencyId,
|
||||
computePendingNodes,
|
||||
DiscordDependencyId,
|
||||
isReservedDependency,
|
||||
pLeafOrSingleNodes,
|
||||
pListOrdered,
|
||||
pPending,
|
||||
|
|
@ -347,9 +348,12 @@ export function registerInternalPlugin<O extends PluginApiExtensionsOptions>(
|
|||
manifest.version ??= InternalPluginVersion
|
||||
// TODO: This has to be shared from native somehow.
|
||||
manifest.format ??= 1
|
||||
manifest.dependencies ??= {}
|
||||
manifest.dependencies[ApiDependencyId] ??= { version: '*' }
|
||||
manifest.dependencies[DiscordDependencyId] ??= { version: '*' }
|
||||
|
||||
if (!isReservedDependency(manifest.id)) {
|
||||
manifest.dependencies ??= {}
|
||||
manifest.dependencies[ApiDependencyId] ??= { version: '*' }
|
||||
manifest.dependencies[DiscordDependencyId] ??= { version: '*' }
|
||||
}
|
||||
|
||||
return register(manifest as PluginManifest, options, defflags, iflags)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue