@collabkit/react
Advanced tools
Comparing version 0.4.4 to 0.5.0
/// <reference types="react" /> | ||
import * as React from 'react'; | ||
import React__default, { ReactNode } from 'react'; | ||
import React__default, { ReactNode, ComponentProps } from 'react'; | ||
@@ -942,2 +942,9 @@ declare const colors = { | ||
subscribeInbox(props: { | ||
appId: string; | ||
workspaceId: string; | ||
subs: Subscriptions; | ||
onInboxChange: InboxChangeEventHandler; | ||
}): void; | ||
subscribeThread(props: { | ||
@@ -971,2 +978,3 @@ appId: string; | ||
}) => void; | ||
type InboxChangeEventHandler = (props: { event: WithID<Event>; threadId: string }) => void; | ||
@@ -1002,3 +1010,3 @@ type ThreadInfoChangeEvent = { | ||
viewId?: string; | ||
cellId?: string; | ||
cellId?: string; // todo rename to threadId | ||
} | ||
@@ -1012,2 +1020,9 @@ | ||
type DeepPartial<T> = T extends object | ||
? { | ||
[P in keyof T]?: DeepPartial<T[P]>; | ||
} | ||
: T; | ||
type SecureProps = { | ||
@@ -1109,2 +1124,3 @@ appId: string; | ||
| Commentable | ||
| MenuTarget | ||
| PinTarget | ||
@@ -1116,2 +1132,8 @@ | CommentEditButtonTarget | ||
type MenuTarget = { | ||
type: 'menu'; | ||
nodeId: string; | ||
parentId: string | null; | ||
}; | ||
type Commentable = { | ||
@@ -1139,3 +1161,8 @@ type: 'commentable'; | ||
type ComposerTarget = { type: 'composer'; threadId: string; workspaceId: string }; | ||
type ComposerTarget = { | ||
type: 'composer'; | ||
threadId: string; | ||
workspaceId: string; | ||
eventId: string | 'default'; | ||
}; | ||
@@ -1195,5 +1222,7 @@ type ThreadTarget = { type: 'thread'; threadId: string; workspaceId: string }; | ||
type EventType = 'message' | 'reaction' | 'adminMessage' | 'system' | 'delete' | 'edit'; | ||
// TODO: this should be a union of different message types | ||
type Event = { | ||
type: 'message' | 'reaction' | 'adminMessage' | 'system' | 'delete' | 'edit'; | ||
type: EventType; | ||
body: string; | ||
@@ -1209,6 +1238,2 @@ system?: 'resolve' | 'reopen'; | ||
type WithName<T> = T & { | ||
name: string; | ||
}; | ||
type WithID<T> = T & { | ||
@@ -1252,3 +1277,3 @@ id: string; | ||
$$mentions: MentionWithColor[]; | ||
sendButtonDisabled: boolean; | ||
enabled: { [eventId: string]: boolean; default: boolean }; | ||
isTypingTimeoutID?: ReturnType<typeof setTimeout>; | ||
@@ -1276,3 +1301,3 @@ isTyping: { [endUserId: string]: boolean }; | ||
pins: { [threadId: string]: Pin }; | ||
inbox: { [threadId: string]: WithHasProfile<WithID<WithName<Event>>> }; | ||
inbox: { [threadId: string]: WithID<Event> }; | ||
timeline: { [threadId: string]: Timeline }; | ||
@@ -1300,3 +1325,4 @@ composers: { [threadId: string]: Composer }; | ||
reactingId: null | Target; | ||
composingId: null | ThreadTarget; | ||
// composingId: null | ThreadTarget; | ||
menuId: null | Target; | ||
viewingId: null | Target; | ||
@@ -1306,3 +1332,4 @@ previewingId: null | Target; | ||
config: null | Config; | ||
profiles: { [profileId: string]: Profile }; | ||
avatarErrors: { [avatar: string]: boolean }; | ||
profiles: { [profileId: string]: Profile | undefined }; | ||
workspaces: { | ||
@@ -1326,196 +1353,464 @@ [workspaceId: string]: Workspace; | ||
interface Theme { | ||
fontSize: { | ||
0: string; | ||
1: string; | ||
2: string; | ||
3: string; | ||
mentionDropdownItemFontSize: string; | ||
sendButtonFontSize: string; | ||
button: string; | ||
indicatorText: string; | ||
}; | ||
lineHeights: { | ||
0: string; | ||
1: string; | ||
2: string; | ||
3: string; | ||
mentionDropdownItemLineHeight: string; | ||
button: string; | ||
indicatorText: string; | ||
}; | ||
fontWeights: { | ||
0: number; | ||
1: number; | ||
2: number; | ||
3: number; | ||
mentionDropdownItemFontWeight: string; | ||
mentionDropdownItemMark: number; | ||
sendButtonTextFontWeight: number; | ||
indicatorText: number; | ||
profileNameText: number; | ||
button: number; | ||
mention: number; | ||
}; | ||
radii: { | ||
0: string; | ||
1: string; | ||
2: string; | ||
pin: string; | ||
mentionDropdownBorderRadius: string; | ||
avatar: string; | ||
iconButton: string; | ||
composer: string; | ||
popoverThread: string; | ||
}; | ||
padding: { | ||
composer: string; | ||
commentTop: string | number; | ||
commentLeft: string | number; | ||
commentRight: string | number; | ||
commentBottom: string | number; | ||
mentionDropdownItemPadding: string; | ||
composerContainer: string; | ||
declare type AvatarProps = { | ||
profile: Profile; | ||
size?: number; | ||
}; | ||
0: string; | ||
1: string; | ||
2: string; | ||
3: string; | ||
4: string; | ||
}; | ||
sizes: { | ||
sendButton: string; | ||
threadWidth: string; | ||
threadPreviewWidth: string; | ||
pin: string; | ||
avatar: string; | ||
pinBorderWidth: string; | ||
popoverThreadWidth: string; | ||
iconButton: string; | ||
}; | ||
space: { | ||
0: string; | ||
1: string; | ||
2: string; | ||
3: string; | ||
4: string; | ||
commentHeaderBodyGap: string; | ||
}; | ||
borders: { | ||
composer: string; | ||
buttonPrimary: string; | ||
buttonSecondary: string; | ||
buttonTertiary: string; | ||
declare type Primitive$1 = string | boolean | number | null | undefined; | ||
declare type MapLeafNodes$1<Obj, LeafType> = { | ||
[Prop in keyof Obj]: Obj[Prop] extends Primitive$1 ? LeafType : Obj[Prop] extends Record<string | number, any> ? MapLeafNodes$1<Obj[Prop], LeafType> : never; | ||
}; | ||
buttonPrimaryActive: string; | ||
buttonSecondaryActive: string; | ||
buttonTertiaryActive: string; | ||
declare type CSSVarFunction = `var(--${string})` | `var(--${string}, ${string | number})`; | ||
declare type Primitive = string | boolean | number | null | undefined; | ||
declare type MapLeafNodes<Obj, LeafType> = { | ||
[Prop in keyof Obj]: Obj[Prop] extends Primitive ? LeafType : Obj[Prop] extends Record<string | number, any> ? MapLeafNodes<Obj[Prop], LeafType> : never; | ||
}; | ||
buttonPrimaryHover: string; | ||
buttonSecondaryHover: string; | ||
buttonTertiaryHover: string; | ||
}; | ||
offsets: { | ||
composerSendButtonTop: string; | ||
composerSendButtonRight: string; | ||
}; | ||
shadows: { | ||
mentionDropdownBoxShadow: string; | ||
}; | ||
colors: { | ||
// text | ||
primaryText: string; | ||
secondaryText: string; | ||
declare const vars: MapLeafNodes<{ | ||
thread: { | ||
background: string; | ||
border: string; | ||
borderRadius: string; | ||
boxShadow: string; | ||
header: { | ||
color: string; | ||
fontSize: string; | ||
fontWeight: string; | ||
lineHeight: string; | ||
letterSpacing: string; | ||
}; | ||
typingIndicator: { | ||
color: string; | ||
fontSize: string; | ||
lineHeight: string; | ||
fontWeight: string; | ||
letterSpacing: string; | ||
}; | ||
}; | ||
text: { | ||
tiny: { | ||
fontSize: string; | ||
letterSpacing: string; | ||
lineHeight: string; | ||
}; | ||
small: { | ||
fontSize: string; | ||
letterSpacing: string; | ||
lineHeight: string; | ||
}; | ||
base: { | ||
fontSize: string; | ||
letterSpacing: string; | ||
lineHeight: string; | ||
}; | ||
large: { | ||
fontSize: string; | ||
letterSpacing: string; | ||
lineHeight: string; | ||
}; | ||
}; | ||
fontWeights: { | ||
regular: string; | ||
medium: string; | ||
bold: string; | ||
}; | ||
space: { | ||
0: string; | ||
1: string; | ||
2: string; | ||
3: string; | ||
4: string; | ||
}; | ||
sidebar: { | ||
boxShadow: string; | ||
background: string; | ||
title: { | ||
fontSize: string; | ||
fontWeight: string; | ||
letterSpacing: string; | ||
lineHeight: string; | ||
borderBottom: string; | ||
color: string; | ||
paddingBottom: string; | ||
paddingTop: string; | ||
}; | ||
}; | ||
shadow: { | ||
standard: string; | ||
high: string; | ||
}; | ||
scrollbar: { | ||
thumb: { | ||
background: string; | ||
width: string; | ||
borderRadius: string; | ||
}; | ||
padding: string; | ||
background: string; | ||
hover: { | ||
background: string; | ||
}; | ||
borderRadius: string; | ||
}; | ||
profile: { | ||
avatar: { | ||
borderRadius: string; | ||
fontSize: string; | ||
fontWeight: string; | ||
color: string; | ||
background: string; | ||
}; | ||
name: { | ||
color: string; | ||
fontSize: string; | ||
fontWeight: string; | ||
lineHeight: string; | ||
letterSpacing: string; | ||
}; | ||
}; | ||
popoverThread: { | ||
background: string; | ||
border: string; | ||
borderRadius: string; | ||
boxShadow: string; | ||
width: string; | ||
padding: string; | ||
preview: { | ||
boxShadow: string; | ||
}; | ||
composer: { | ||
borderTop: string; | ||
padding: string; | ||
gap: string; | ||
contentEditable: { | ||
border: string; | ||
minHeight: string; | ||
focus: { | ||
border: string; | ||
}; | ||
}; | ||
}; | ||
}; | ||
menu: { | ||
background: string; | ||
border: string; | ||
borderRadius: string; | ||
boxShadow: string; | ||
item: { | ||
color: string; | ||
fontSize: string; | ||
fontWeight: string; | ||
letterSpacing: string; | ||
lineHeight: string; | ||
active: { | ||
color: string; | ||
background: string; | ||
}; | ||
hover: { | ||
color: string; | ||
background: string; | ||
}; | ||
}; | ||
}; | ||
mentions: { | ||
pill: { | ||
fontSize: string; | ||
fontWeight: string; | ||
letterSpacing: string; | ||
lineHeight: string; | ||
padding: string; | ||
color: string; | ||
borderRadius: string; | ||
background: string; | ||
}; | ||
typeahead: { | ||
background: string; | ||
border: string; | ||
borderRadius: string; | ||
boxShadow: string; | ||
padding: string; | ||
item: { | ||
fontSize: string; | ||
fontWeight: string; | ||
letterSpacing: string; | ||
lineHeight: string; | ||
padding: string; | ||
gap: string; | ||
color: string; | ||
borderRadius: string; | ||
background: string; | ||
hover: { | ||
background: string; | ||
}; | ||
mark: { | ||
fontWeight: string; | ||
color: string; | ||
background: string; | ||
borderRadius: string; | ||
}; | ||
active: { | ||
background: string; | ||
color: string; | ||
}; | ||
nameAndEmailWrapper: { | ||
gap: string; | ||
flexDirection: string; | ||
}; | ||
name: { | ||
fontSize: string; | ||
fontWeight: string; | ||
letterSpacing: string; | ||
lineHeight: string; | ||
color: string; | ||
active: { | ||
color: string; | ||
}; | ||
}; | ||
email: { | ||
fontSize: string; | ||
fontWeight: string; | ||
letterSpacing: string; | ||
lineHeight: string; | ||
display: string; | ||
color: string; | ||
active: { | ||
color: string; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
inbox: { | ||
gap: string; | ||
background: string; | ||
width: string; | ||
newIndicator: { | ||
color: string; | ||
fontSize: string; | ||
fontWeight: string; | ||
lineHeight: string; | ||
letterSpacing: string; | ||
inlay: { | ||
background: string; | ||
}; | ||
line: { | ||
background: string; | ||
}; | ||
}; | ||
item: { | ||
background: string; | ||
borderBottom: string; | ||
gap: string; | ||
paddingTop: string; | ||
paddingRight: string; | ||
paddingLeft: string; | ||
paddingBottom: string; | ||
hover: { | ||
background: string; | ||
}; | ||
active: { | ||
background: string; | ||
}; | ||
replyCount: { | ||
fontWeight: string; | ||
fontSize: string; | ||
lineHeight: string; | ||
letterSpacing: string; | ||
color: string; | ||
}; | ||
unreadDot: { | ||
width: string; | ||
height: string; | ||
borderRadius: string; | ||
background: string; | ||
}; | ||
}; | ||
}; | ||
facepile: { | ||
gap: string; | ||
avatar: { | ||
size: string; | ||
borderSize: string; | ||
borderColor: string; | ||
hover: { | ||
borderColor: string; | ||
}; | ||
}; | ||
}; | ||
composer: { | ||
background: string; | ||
border: string; | ||
borderRadius: string; | ||
caretColor: string; | ||
color: string; | ||
fontSize: string; | ||
lineHeight: string; | ||
fontWeight: string; | ||
letterSpacing: string; | ||
padding: string; | ||
active: { | ||
background: string; | ||
border: string; | ||
}; | ||
hover: { | ||
background: string; | ||
border: string; | ||
}; | ||
disabled: { | ||
background: string; | ||
border: string; | ||
color: string; | ||
}; | ||
placeholder: { | ||
color: string; | ||
}; | ||
}; | ||
comment: { | ||
paddingTop: string; | ||
paddingRight: string; | ||
paddingLeft: string; | ||
paddingBottom: string; | ||
hover: { | ||
background: string; | ||
}; | ||
header: { | ||
gap: string; | ||
nameAndTimestamp: { | ||
gap: string; | ||
}; | ||
profile: { | ||
gap: string; | ||
}; | ||
}; | ||
content: { | ||
gap: string; | ||
}; | ||
body: { | ||
color: string; | ||
fontSize: string; | ||
lineHeight: string; | ||
fontWeight: string; | ||
letterSpacing: string; | ||
}; | ||
timestamp: { | ||
color: string; | ||
fontSize: string; | ||
lineHeight: string; | ||
fontWeight: string; | ||
letterSpacing: string; | ||
}; | ||
}; | ||
color: { | ||
background: string; | ||
surface: string; | ||
surfaceOverlay: string; | ||
textPrimary: string; | ||
textSecondary: string; | ||
textDisabled: string; | ||
textLink: string; | ||
border: string; | ||
icon: string; | ||
attention: string; | ||
}; | ||
iconButton: { | ||
background: string; | ||
color: string; | ||
size: string; | ||
active: { | ||
background: string; | ||
}; | ||
hover: { | ||
background: string; | ||
}; | ||
}; | ||
buttonGroup: { | ||
gap: string; | ||
padding: string; | ||
}; | ||
button: { | ||
fontSize: string; | ||
fontWeight: string; | ||
letterSpacing: string; | ||
lineHeight: string; | ||
borderRadius: string; | ||
primary: { | ||
fontSize: string; | ||
fontWeight: string; | ||
lineHeight: string; | ||
letterSpacing: string; | ||
color: string; | ||
background: string; | ||
active: { | ||
color: string; | ||
background: string; | ||
}; | ||
hover: { | ||
color: string; | ||
background: string; | ||
}; | ||
disabled: { | ||
color: string; | ||
background: string; | ||
}; | ||
}; | ||
secondary: { | ||
fontWeight: string; | ||
letterSpacing: string; | ||
color: string; | ||
background: string; | ||
fontSize: string; | ||
lineHeight: string; | ||
active: { | ||
color: string; | ||
background: string; | ||
}; | ||
hover: { | ||
color: string; | ||
background: string; | ||
}; | ||
disabled: { | ||
color: string; | ||
background: string; | ||
}; | ||
}; | ||
disabled: { | ||
color: string; | ||
background: string; | ||
}; | ||
}; | ||
avatar: { | ||
size: string; | ||
fontSize: string; | ||
colors: { | ||
amber: string; | ||
blue: string; | ||
brown: string; | ||
crimson: string; | ||
cyan: string; | ||
grass: string; | ||
green: string; | ||
indigo: string; | ||
lime: string; | ||
mint: string; | ||
orange: string; | ||
pink: string; | ||
plum: string; | ||
purple: string; | ||
red: string; | ||
sky: string; | ||
teal: string; | ||
tomato: string; | ||
violet: string; | ||
yellow: string; | ||
}; | ||
}; | ||
}, CSSVarFunction>; | ||
badgeColor: string; | ||
primaryButtonBackground: string; | ||
declare type Theme = MapLeafNodes$1<typeof vars, string>; | ||
declare type CustomTheme = DeepPartial<Theme>; | ||
bubbleHoverBackground: string; | ||
selectionBackground: string; | ||
borderColor: string; | ||
pinBorderColor: string; | ||
backgroundColor: string; | ||
popoverThreadBackgroundColor: string; | ||
// unread indicator | ||
indicatorLineColor: string; | ||
indicatorText: string; | ||
// typing indicator | ||
typingDot: string; | ||
// comment | ||
commentHoverBackgroundColor: string; | ||
commentUnseenBackgroundColor: string; | ||
commentUnseenHoverBackgroundColor: string; | ||
caretColor: string; | ||
// composer | ||
composerBackground: string; | ||
composerPlaceholder: string; | ||
composerButtonBackground: string; | ||
composerButtonIconColor: string; | ||
sendButtonDisabledColor: string; | ||
sendButtonColor: string; | ||
sendButtonTextColor: string; | ||
sendButtonDisabledTextColor: string; | ||
// button | ||
buttonPrimaryBackground: string; | ||
buttonPrimaryHoverBackground: string; | ||
buttonPrimaryHoverText: string; | ||
buttonPrimaryActiveBackground: string; | ||
buttonPrimaryText: string; | ||
buttonPrimaryActiveText: string; | ||
buttonSecondaryBackground: string; | ||
buttonSecondaryHoverBackground: string; | ||
buttonSecondaryHoverText: string; | ||
buttonSecondaryActiveBackground: string; | ||
buttonSecondaryText: string; | ||
buttonTertiaryBackground: string; | ||
buttonTertiaryHoverBackground: string; | ||
buttonTertiaryHoverText: string; | ||
buttonTertiaryActiveBackground: string; | ||
buttonTertiaryText: string; | ||
buttonDisabledBackground: string; | ||
buttonDisabledText: string; | ||
// mentions | ||
mentionText: string; | ||
mentionTextBackground: string; | ||
mentionDropdownBackgroundColor: string; | ||
mentionDropdownTextColor: string; | ||
mentionDropdownMarkText: string; | ||
mentionDropdownMarkBackground: string; | ||
mentionDropdownItemHoverBackgroundColor: string; | ||
mentionDropdownItemHoverTextColor: string; | ||
mentionDropdownItemSelectedBackgroundColor: string; | ||
mentionDropdownItemSelectedTextColor: string; | ||
}; | ||
} | ||
type DeepPartial<T> = T extends object | ||
? { | ||
[P in keyof T]?: DeepPartial<T[P]>; | ||
} | ||
: T; | ||
type CustomTheme = DeepPartial<Theme>; | ||
declare type AvatarProps = { | ||
profile: Profile; | ||
size?: number; | ||
}; | ||
declare type ProviderProps = { | ||
children: React__default.ReactNode; | ||
theme?: CustomTheme; | ||
theme?: 'light' | 'dark' | CustomTheme; | ||
renderAvatar?: (props: AvatarProps) => ReactNode; | ||
@@ -1529,3 +1824,3 @@ renderThreadContextPreview?: (props: { | ||
} & (SecureProps | UnsecureProps) & ConfigProps; | ||
declare function CollabKitProvider({ children, colorScheme, theme, renderAvatar, renderThreadContextPreview, ...config }: ProviderProps): JSX.Element | null; | ||
declare function CollabKitProvider({ children, theme, renderAvatar, renderThreadContextPreview, ...config }: ProviderProps): JSX.Element | null; | ||
@@ -1633,3 +1928,3 @@ declare type Alignment = 'start' | 'end'; | ||
declare function usePopoverThread(props: { | ||
declare type DeprecatedPopoverProps = { | ||
name?: string; | ||
@@ -1639,3 +1934,11 @@ cellId: string; | ||
padding?: number; | ||
}): { | ||
}; | ||
declare type PopoverProps = { | ||
name?: string; | ||
threadId: string; | ||
_viewId?: string; | ||
offset?: number; | ||
padding?: number; | ||
}; | ||
declare function usePopoverThread(props: DeprecatedPopoverProps | PopoverProps): { | ||
context: { | ||
@@ -1678,3 +1981,3 @@ nodeId: string; | ||
children?: React__default.ReactNode; | ||
}): JSX.Element; | ||
}): JSX.Element | null; | ||
@@ -1691,8 +1994,19 @@ declare function useUnreadCommentsCount(props: { | ||
declare function InboxButton(): JSX.Element; | ||
declare function InboxButton(props: { | ||
customIcon?: React__default.ReactNode; | ||
customUnreadIcon?: React__default.ReactNode; | ||
}): JSX.Element; | ||
declare function SidePane(props: { | ||
declare type ThemeProviderProps = { | ||
theme?: 'light' | 'dark' | CustomTheme; | ||
children: React__default.ReactNode; | ||
}; | ||
declare function ThemeProvider({ theme, children }: ThemeProviderProps): JSX.Element; | ||
declare function Sidebar(props: { | ||
children: React__default.ReactNode; | ||
}): JSX.Element | null; | ||
export { AvatarProps, CollabKitProvider, Config, CustomTheme, Inbox, InboxButton, Mention, MentionProps, PopoverTrigger, CollabKitProvider as Provider, SidePane, Store, Subscriptions, Thread, Workspace, createValtioStore as internal_createStore, usePopoverThread, useUnreadCommentsCount as useUnreadCount, useUnreadThreadsCount }; | ||
declare function ThemeWrapper(props: ComponentProps<'div'>): JSX.Element; | ||
export { AvatarProps, CollabKitProvider, Config, CustomTheme, Inbox, InboxButton, Mention, MentionProps, PopoverTrigger, CollabKitProvider as Provider, Sidebar, Store, Subscriptions, ThemeProvider, ThemeWrapper, Thread, Workspace, createValtioStore as internal_createStore, usePopoverThread, useUnreadCommentsCount as useUnreadCount, useUnreadThreadsCount }; |
{ | ||
"name": "@collabkit/react", | ||
"version": "0.4.4", | ||
"version": "0.5.0", | ||
"type": "module", | ||
@@ -50,2 +50,7 @@ "files": [ | ||
"@types/sync-fetch": "^0.4.0", | ||
"@vanilla-extract/css": "^1.9.1", | ||
"@vanilla-extract/css-utils": "^0.1.2", | ||
"@vanilla-extract/dynamic": "^2.0.2", | ||
"@vanilla-extract/recipes": "^0.2.5", | ||
"@vanilla-extract/vite-plugin": "^3.6.0", | ||
"@vitejs/plugin-react": "^2.0.1", | ||
@@ -68,2 +73,3 @@ "date-fns": "^2.28.0", | ||
"react-test-renderer": "^18.2.0", | ||
"react-transition-group": "^4.4.5", | ||
"rollup": "2.77.3", | ||
@@ -81,4 +87,3 @@ "rollup-plugin-dts": "^4.2.2", | ||
"printWidth": 100 | ||
}, | ||
"dependencies": {} | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
2120589
42052
50