@cairntale/chimeling-react 1.0.0-alpha.0 → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE +1 -0
- package/dist/components/provider.js +1 -3
- package/dist/components/provider.js.map +1 -1
- package/dist/components/root.d.ts +1 -1
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/use-resolved-user-presence.js +1 -2
- package/dist/hooks/use-resolved-user-presence.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/lib/config.js +1 -1
- package/dist/lib/showable-presence.d.ts +1 -1
- package/dist/lib/widget-context.d.ts +1 -0
- package/dist/package.js.map +1 -0
- package/dist/types.d.ts +1 -1
- package/package.json +16 -4
- package/dist/react/package.js.map +0 -1
- package/dist/sdk/src/client/client/client.gen.js +0 -174
- package/dist/sdk/src/client/client/client.gen.js.map +0 -1
- package/dist/sdk/src/client/client/index.js +0 -5
- package/dist/sdk/src/client/client/utils.gen.js +0 -177
- package/dist/sdk/src/client/client/utils.gen.js.map +0 -1
- package/dist/sdk/src/client/core/auth.gen.js +0 -12
- package/dist/sdk/src/client/core/auth.gen.js.map +0 -1
- package/dist/sdk/src/client/core/bodySerializer.gen.js +0 -6
- package/dist/sdk/src/client/core/bodySerializer.gen.js.map +0 -1
- package/dist/sdk/src/client/core/params.gen.js +0 -9
- package/dist/sdk/src/client/core/params.gen.js.map +0 -1
- package/dist/sdk/src/client/core/pathSerializer.gen.js +0 -82
- package/dist/sdk/src/client/core/pathSerializer.gen.js.map +0 -1
- package/dist/sdk/src/client/core/serverSentEvents.gen.js +0 -96
- package/dist/sdk/src/client/core/serverSentEvents.gen.js.map +0 -1
- package/dist/sdk/src/client/core/utils.gen.js +0 -78
- package/dist/sdk/src/client/core/utils.gen.js.map +0 -1
- package/src/components/chimeling.ts +0 -9
- package/src/components/index.ts +0 -8
- package/src/components/logo.tsx +0 -18
- package/src/components/popover.tsx +0 -44
- package/src/components/provider.tsx +0 -26
- package/src/components/root.tsx +0 -91
- package/src/components/trigger.tsx +0 -33
- package/src/hooks/index.ts +0 -4
- package/src/hooks/use-client.ts +0 -8
- package/src/hooks/use-resolved-user-presence.ts +0 -27
- package/src/index.ts +0 -4
- package/src/lib/config.ts +0 -9
- package/src/lib/context.ts +0 -24
- package/src/lib/format-activity-duration.ts +0 -21
- package/src/lib/icon-url.ts +0 -5
- package/src/lib/presence-key.ts +0 -5
- package/src/lib/showable-presence.ts +0 -22
- package/src/lib/widget-context.ts +0 -33
- package/src/types.ts +0 -3
- package/tsconfig.json +0 -14
- package/tsdown.config.ts +0 -13
- package/turbo.json +0 -10
- /package/dist/{react/package.js → package.js} +0 -0
package/src/lib/presence-key.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { GetResolvedUserPresenceResponse } from '@cairntale/chimeling-js'
|
|
2
|
-
|
|
3
|
-
type PresenceWithActivity = Extract<GetResolvedUserPresenceResponse, { status: 'online' | 'idle' }>
|
|
4
|
-
|
|
5
|
-
export type PresenceActivity = NonNullable<PresenceWithActivity['activity']>
|
|
6
|
-
|
|
7
|
-
export type ShowablePresence = Omit<PresenceWithActivity, 'activity'> & {
|
|
8
|
-
activity: PresenceActivity
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function getShowablePresence(
|
|
12
|
-
presence: GetResolvedUserPresenceResponse | undefined,
|
|
13
|
-
): ShowablePresence | null {
|
|
14
|
-
if (!presence || presence.status === 'offline' || presence.activity == null) {
|
|
15
|
-
return null
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
status: presence.status,
|
|
20
|
-
activity: presence.activity,
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { createContext, useContext } from 'react'
|
|
4
|
-
import type { PopoverPositionerProps } from '@base-ui/react/popover'
|
|
5
|
-
import { packageErrorMessage } from './config'
|
|
6
|
-
import type { ShowablePresence } from './showable-presence'
|
|
7
|
-
|
|
8
|
-
export type WidgetPlacement = Pick<PopoverPositionerProps, 'side' | 'align' | 'sideOffset'>
|
|
9
|
-
|
|
10
|
-
export type WidgetContextValue = {
|
|
11
|
-
showable: ShowablePresence | null
|
|
12
|
-
now: Date
|
|
13
|
-
poweredBy: boolean
|
|
14
|
-
openOnHover: boolean
|
|
15
|
-
hoverOpenDelay: number
|
|
16
|
-
hoverCloseDelay: number
|
|
17
|
-
placement: WidgetPlacement
|
|
18
|
-
baseUrl: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const WidgetContext = createContext<WidgetContextValue | null>(null)
|
|
22
|
-
|
|
23
|
-
export function useWidgetContext(): WidgetContextValue {
|
|
24
|
-
const context = useContext(WidgetContext)
|
|
25
|
-
if (!context) {
|
|
26
|
-
throw new Error(
|
|
27
|
-
packageErrorMessage(
|
|
28
|
-
'This component can only be used within the <Chimeling.Root /> component.',
|
|
29
|
-
),
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
return context
|
|
33
|
-
}
|
package/src/types.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "es2025",
|
|
5
|
-
"lib": ["ES2025", "DOM"],
|
|
6
|
-
"module": "preserve",
|
|
7
|
-
"moduleResolution": "bundler",
|
|
8
|
-
"resolveJsonModule": true,
|
|
9
|
-
"verbatimModuleSyntax": true,
|
|
10
|
-
"noEmit": true,
|
|
11
|
-
"jsx": "react-jsx"
|
|
12
|
-
},
|
|
13
|
-
"include": ["./src"]
|
|
14
|
-
}
|
package/tsdown.config.ts
DELETED
package/turbo.json
DELETED
|
File without changes
|