-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[base] Move presence into @sanity/base
- Loading branch information
1 parent
88a4c4a
commit 4efefc4
Showing
118 changed files
with
1,064 additions
and
1,011 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = require('./lib/components-public-api') | ||
module.exports = require('./lib/components') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './src/components-public-api' | ||
export * from './src/components' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
module.exports = require('./lib/presence/public-api') | ||
module.exports = require('./lib/presence') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './src/presence' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
7 changes: 3 additions & 4 deletions
7
...nity/components/src/avatar/UserAvatar.tsx → ...sanity/base/src/components/UserAvatar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './UserAvatar' |
4 changes: 2 additions & 2 deletions
4
packages/@sanity/base/src/datastores/presence/message-transports/bifurTransport.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/@sanity/base/src/datastores/presence/message-transports/transport.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/@sanity/base/src/datastores/presence/useDocumentPresence.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/@sanity/base/src/datastores/presence/useGlobalPresence.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import createUserStore from './createUserStore' | ||
|
||
export default createUserStore() | ||
|
||
export * from './types' |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.root { | ||
padding: 0.25em 0; | ||
} | ||
|
||
.item { | ||
padding: 0.25em 0.5em; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.avatarContainer { | ||
/* */ | ||
} | ||
|
||
.textContainer { | ||
flex: 1; | ||
min-width: 0; | ||
white-space: nowrap; | ||
margin-top: -1px; | ||
margin-left: 0.5em; | ||
font-size: 13px; | ||
line-height: 16px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* eslint-disable react/require-default-props */ | ||
|
||
import {Tooltip, TooltipPlacement} from 'part:@sanity/components/tooltip' | ||
import React from 'react' | ||
import {UserAvatar} from '../components/UserAvatar' | ||
import {FormFieldPresence} from './types' | ||
|
||
import styles from './PresenceTooltip.css' | ||
|
||
interface PresenceTooltipProps { | ||
children?: JSX.Element | ||
items: FormFieldPresence[] | ||
placement?: TooltipPlacement | ||
} | ||
|
||
export function PresenceTooltip(props: PresenceTooltipProps) { | ||
const {children, items, placement} = props | ||
|
||
const content = ( | ||
<div className={styles.root}> | ||
{items.map(item => ( | ||
<div className={styles.item} key={item.user.id}> | ||
<div className={styles.avatarContainer}> | ||
<UserAvatar user={item.user} status="online" /> | ||
</div> | ||
|
||
<div className={styles.textContainer}> | ||
<div className={styles.item__displayName}>{item.user.displayName}</div> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
) | ||
|
||
return ( | ||
<Tooltip content={content as any} placement={placement}> | ||
{children as any} | ||
</Tooltip> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import React from 'react' | ||
import {FormFieldPresence} from './types' | ||
|
||
export const FormFieldPresenceContext = React.createContext<FormFieldPresence[]>([]) |
Oops, something went wrong.