@cord-sdk/react
Advanced tools
Comparing version 1.27.2 to 1.28.0
@@ -0,1 +1,2 @@ | ||
import type { TFunction } from 'i18next'; | ||
/** | ||
@@ -26,1 +27,4 @@ * Prepend "cord-" to a classname. Useful mostly to grep all places | ||
export declare function getStableColorPalette(userId: string): number; | ||
export declare function isDefined<T>(value: T | null | undefined): value is T; | ||
export declare function relativeTimestampString(date: Date, now: number, t: TFunction<'presence' | 'message' | 'notifications', 'timestamp'>): string; | ||
export declare function absoluteTimestampString(date: Date, now: number, t: TFunction<'message', 'absolute_timestamp'>): string; |
@@ -45,3 +45,3 @@ import * as React from 'react'; | ||
}; | ||
export declare function ThreadedComments({ className, location, groupId: propGroupID, messageOrder, sortBy, scrollDirection, composerPosition, threadUrl, threadName, topLevelComposerExpanded, replyComposerExpanded, showReplies, highlightThreadId, partialMatch, filter, threadMetadata, displayResolved, autofocus, enableFacepileTooltip, showPlaceholder, onMessageClick, onMessageMouseEnter, onMessageMouseLeave, onMessageEditStart, onMessageEditEnd, onThreadResolve, onThreadReopen, onRender, onLoading, onComposerFocus, onComposerBlur, onComposerClose, onSend, }: ThreadedCommentsReactComponentProps): React.JSX.Element | null; | ||
export declare function ThreadedComments(props: ThreadedCommentsReactComponentProps): React.JSX.Element | null; | ||
export {}; |
import * as React from 'react'; | ||
import type { AnnotationMode, BlurDisplayLocation, ICordSDK, Location, NavigateFn, InitErrorCallback, LoadCallback, ScreenshotOptions, JsonObject, Translations, CordSDKOptions } from '@cord-sdk/types'; | ||
import type { AnnotationMode, BlurDisplayLocation, ICordSDK, Location, NavigateFn, InitErrorCallback, LoadCallback, ScreenshotOptions as SnakeCaseScreenshotOptions, JsonObject, Translations, CordSDKOptions, CaptureScreenshotEvent } from '@cord-sdk/types'; | ||
export type CordContextValue = { | ||
@@ -21,3 +21,6 @@ sdk: ICordSDK | null; | ||
threadOptions?: ThreadOptions; | ||
screenshotOptions?: ScreenshotOptions; | ||
/** | ||
* Please use the camelCase version of the options. | ||
*/ | ||
screenshotOptions?: ScreenshotOptions & SnakeCaseScreenshotOptions; | ||
customRenderers?: Record<string, (m: Record<string, unknown>) => HTMLElement>; | ||
@@ -45,2 +48,8 @@ /** | ||
}; | ||
type ScreenshotOptions = { | ||
blur?: boolean; | ||
showBlurred?: BlurDisplayLocation; | ||
captureWhen?: CaptureScreenshotEvent[]; | ||
showScreenshot?: boolean; | ||
}; | ||
export declare function CordProvider({ clientAuthToken, enableTasks, enableAnnotations, enableSlack, blurScreenshots, enableScreenshotCapture, showBlurredScreenshots, screenshotOptions, customRenderers, annotationMode, cordScriptUrl, navigate, threadOptions, children, onLoad, onInitError, customEventMetadata, translations, language, beforeMessageCreate, }: React.PropsWithChildren<Props>): React.JSX.Element; | ||
@@ -47,0 +56,0 @@ export declare function useCordContext(hook: string): { |
export { SelectionComments, SelectionCommentsReactComponentProps, } from './components/SelectionComments'; | ||
export { ThreadFacepile } from './components/ThreadFacepile'; | ||
export { Avatar } from './experimental/components/Avatar'; | ||
export { Avatar, AvatarTooltip, AvatarFallback, type AvatarTooltipProps, type AvatarFallbackProps, } from './experimental/components/Avatar'; | ||
export { Facepile } from './experimental/components/Facepile'; | ||
export { PresenceFacepile } from './experimental/components/PresenceFacepile'; | ||
export { PresenceObserver } from './experimental/components/PresenceObserver'; | ||
export { AddReactionButton } from './experimental/components/AddReactionButton'; |
import * as React from 'react'; | ||
import type { ClientUserData } from '@cord-sdk/types'; | ||
import type { ClientUserData, ViewerUserData } from '@cord-sdk/types'; | ||
export type AvatarReactComponentProps = { | ||
@@ -8,6 +8,9 @@ userId: string; | ||
isAbsent?: boolean; | ||
Tooltip?: React.ComponentType<AvatarTooltipProps>; | ||
}; | ||
export declare const Avatar: React.ForwardRefExoticComponent<Omit<Omit<AvatarReactComponentProps & { | ||
export declare const Avatar: React.ForwardRefExoticComponent<(Omit<Omit<Omit<AvatarReactComponentProps & { | ||
children?: React.ReactNode; | ||
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>; | ||
} & React.RefAttributes<React.Component<React.PropsWithChildren<AvatarReactComponentProps>, any, any>>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<Omit<AvatarReactComponentProps & { | ||
children?: React.ReactNode; | ||
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">) & React.RefAttributes<HTMLDivElement>>; | ||
export type AvatarProps = { | ||
@@ -17,1 +20,10 @@ user: ClientUserData; | ||
}; | ||
export type AvatarFallbackProps = { | ||
userData: ClientUserData; | ||
}; | ||
export declare function AvatarFallback({ userData: user }: AvatarFallbackProps): React.JSX.Element; | ||
export type AvatarTooltipProps = { | ||
viewerData: ViewerUserData; | ||
userData: ClientUserData; | ||
}; | ||
export declare function AvatarTooltip({ viewerData, userData }: AvatarTooltipProps): React.JSX.Element; |
@@ -5,3 +5,3 @@ import * as React from 'react'; | ||
} | ||
export default function withCord<T extends Props = Props>(WrappedComponent: React.ComponentType<T>, componentName: string): React.ForwardRefExoticComponent<React.PropsWithoutRef<React.PropsWithoutRef<React.PropsWithoutRef<T> & React.RefAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>; | ||
export default function withCord<T extends Props = Props>(WrappedComponent: React.ComponentType<T>): React.ForwardRefExoticComponent<(React.PropsWithoutRef<React.PropsWithoutRef<React.PropsWithoutRef<React.PropsWithoutRef<T> & React.RefAttributes<React.Component<T, any, any>>> & React.RefAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>> | React.PropsWithoutRef<React.PropsWithoutRef<React.PropsWithoutRef<React.PropsWithRef<T>> & React.RefAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>) & React.RefAttributes<HTMLDivElement>>; | ||
export {}; |
@@ -7,3 +7,4 @@ import * as React from 'react'; | ||
}; | ||
export declare const WithTooltip: React.ForwardRefExoticComponent<TooltipProps & { | ||
export declare const WithTooltip: React.ForwardRefExoticComponent<{ | ||
tooltip: JSX.Element | null; | ||
popperPosition?: Placement | undefined; | ||
@@ -14,4 +15,6 @@ offset?: number | ((placement: Placement) => number) | undefined; | ||
className?: string | undefined; | ||
unstyled?: boolean | undefined; | ||
} & { | ||
children?: React.ReactNode; | ||
} & React.RefAttributes<unknown>>; | ||
export declare function DefaultTooltip({ subtitle, label }: TooltipProps): React.JSX.Element; |
{ | ||
"name": "@cord-sdk/react", | ||
"description": "React components for Cord", | ||
"version": "1.27.2", | ||
"version": "1.28.0", | ||
"homepage": "https://docs.cord.com/", | ||
@@ -22,4 +22,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"@cord-sdk/components": "1.27.2", | ||
"@cord-sdk/types": "1.27.2", | ||
"@cord-sdk/components": "1.28.0", | ||
"@cord-sdk/types": "1.28.0", | ||
"classnames": "^2.3.1", | ||
@@ -36,3 +36,3 @@ "@floating-ui/react-dom": "^1.3.0", | ||
"devDependencies": { | ||
"@cord-sdk/jsx": "1.27.2", | ||
"@cord-sdk/jsx": "1.28.0", | ||
"@types/react": "^18.2.25", | ||
@@ -39,0 +39,0 @@ "@types/react-dom": "^18.2.17", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
475232
147
9619
1
+ Added@cord-sdk/components@1.28.0(transitive)
+ Added@cord-sdk/types@1.28.0(transitive)
+ Added@radix-ui/react-slot@1.1.2(transitive)
- Removed@cord-sdk/components@1.27.2(transitive)
- Removed@cord-sdk/types@1.27.2(transitive)
- Removed@radix-ui/react-slot@1.1.1(transitive)
Updated@cord-sdk/components@1.28.0
Updated@cord-sdk/types@1.28.0