@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.
Files changed (56) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +1 -0
  3. package/dist/components/provider.js +1 -3
  4. package/dist/components/provider.js.map +1 -1
  5. package/dist/components/root.d.ts +1 -1
  6. package/dist/hooks/index.d.ts +3 -0
  7. package/dist/hooks/use-resolved-user-presence.js +1 -2
  8. package/dist/hooks/use-resolved-user-presence.js.map +1 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/lib/config.js +1 -1
  11. package/dist/lib/showable-presence.d.ts +1 -1
  12. package/dist/lib/widget-context.d.ts +1 -0
  13. package/dist/package.js.map +1 -0
  14. package/dist/types.d.ts +1 -1
  15. package/package.json +16 -4
  16. package/dist/react/package.js.map +0 -1
  17. package/dist/sdk/src/client/client/client.gen.js +0 -174
  18. package/dist/sdk/src/client/client/client.gen.js.map +0 -1
  19. package/dist/sdk/src/client/client/index.js +0 -5
  20. package/dist/sdk/src/client/client/utils.gen.js +0 -177
  21. package/dist/sdk/src/client/client/utils.gen.js.map +0 -1
  22. package/dist/sdk/src/client/core/auth.gen.js +0 -12
  23. package/dist/sdk/src/client/core/auth.gen.js.map +0 -1
  24. package/dist/sdk/src/client/core/bodySerializer.gen.js +0 -6
  25. package/dist/sdk/src/client/core/bodySerializer.gen.js.map +0 -1
  26. package/dist/sdk/src/client/core/params.gen.js +0 -9
  27. package/dist/sdk/src/client/core/params.gen.js.map +0 -1
  28. package/dist/sdk/src/client/core/pathSerializer.gen.js +0 -82
  29. package/dist/sdk/src/client/core/pathSerializer.gen.js.map +0 -1
  30. package/dist/sdk/src/client/core/serverSentEvents.gen.js +0 -96
  31. package/dist/sdk/src/client/core/serverSentEvents.gen.js.map +0 -1
  32. package/dist/sdk/src/client/core/utils.gen.js +0 -78
  33. package/dist/sdk/src/client/core/utils.gen.js.map +0 -1
  34. package/src/components/chimeling.ts +0 -9
  35. package/src/components/index.ts +0 -8
  36. package/src/components/logo.tsx +0 -18
  37. package/src/components/popover.tsx +0 -44
  38. package/src/components/provider.tsx +0 -26
  39. package/src/components/root.tsx +0 -91
  40. package/src/components/trigger.tsx +0 -33
  41. package/src/hooks/index.ts +0 -4
  42. package/src/hooks/use-client.ts +0 -8
  43. package/src/hooks/use-resolved-user-presence.ts +0 -27
  44. package/src/index.ts +0 -4
  45. package/src/lib/config.ts +0 -9
  46. package/src/lib/context.ts +0 -24
  47. package/src/lib/format-activity-duration.ts +0 -21
  48. package/src/lib/icon-url.ts +0 -5
  49. package/src/lib/presence-key.ts +0 -5
  50. package/src/lib/showable-presence.ts +0 -22
  51. package/src/lib/widget-context.ts +0 -33
  52. package/src/types.ts +0 -3
  53. package/tsconfig.json +0 -14
  54. package/tsdown.config.ts +0 -13
  55. package/turbo.json +0 -10
  56. /package/dist/{react/package.js → package.js} +0 -0
@@ -1,5 +0,0 @@
1
- import { PACKAGE_NAME } from './config'
2
-
3
- export function resolvedUserPresenceKey(userId: string, baseUrl: string) {
4
- return [PACKAGE_NAME, 'resolved-user-presence', baseUrl, userId] as const
5
- }
@@ -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
@@ -1,3 +0,0 @@
1
- import type { Options } from '@cairntale/chimeling-js'
2
-
3
- export type ChimelingClient = NonNullable<Options['client']>
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
@@ -1,13 +0,0 @@
1
- import { defineConfig } from 'tsdown'
2
-
3
- export default defineConfig({
4
- entry: ['./src/index.ts'],
5
- platform: 'neutral',
6
- unbundle: true,
7
- fixedExtension: false,
8
- sourcemap: true,
9
- publint: true,
10
- attw: {
11
- profile: 'esm-only',
12
- },
13
- })
package/turbo.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/turbo/schema.json",
3
- "extends": ["//"],
4
- "tasks": {
5
- "build": {
6
- "dependsOn": ["$TURBO_EXTENDS$", "typecheck"],
7
- "outputs": ["dist/**"]
8
- }
9
- }
10
- }
File without changes