nucleus-core-ts 0.9.164 → 0.9.166
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/dist/fe/components/ChatPanel/theme/index.d.ts +15 -0
- package/dist/fe/components/ChatPanel/theme/index.js +16 -1
- package/dist/fe/components/ChatPanel/types/index.d.ts +14 -0
- package/dist/index.js +2 -2
- package/dist/nucleus.config.d.ts +1 -1
- package/dist/src/Client/ApiCaller/types.d.ts +10 -2
- package/dist/src/Client/PubSub/index.js +2 -0
- package/dist/src/Client/PubSub/store.js +50 -0
- package/dist/src/Client/PubSub/types.js +1 -0
- package/dist/src/Client/PubSub/usePubSub.js +239 -0
- package/package.json +1 -1
- package/scripts/generate-schema.ts +4 -0
|
@@ -57,6 +57,21 @@ export declare const chatPanelTheme: {
|
|
|
57
57
|
readonly pendingChip: "inline-flex items-center gap-1 rounded-lg bg-zinc-100 px-2 py-1 text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300";
|
|
58
58
|
};
|
|
59
59
|
readonly error: "border-t border-red-200 bg-red-50 px-4 py-2 text-xs text-red-600 dark:border-red-900 dark:bg-red-950/40 dark:text-red-300";
|
|
60
|
+
readonly picker: {
|
|
61
|
+
readonly overlay: "fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 backdrop-blur-sm sm:items-center";
|
|
62
|
+
readonly panel: "flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-800 dark:bg-zinc-950";
|
|
63
|
+
readonly header: "flex items-center justify-between gap-2 border-b border-zinc-200 px-4 py-3 dark:border-zinc-800";
|
|
64
|
+
readonly title: "text-sm font-semibold";
|
|
65
|
+
readonly closeButton: "inline-flex h-8 w-8 items-center justify-center rounded-lg text-zinc-500 transition hover:bg-zinc-100 dark:hover:bg-zinc-800";
|
|
66
|
+
readonly searchWrap: "border-b border-zinc-200 p-3 dark:border-zinc-800";
|
|
67
|
+
readonly search: "w-full rounded-xl border border-zinc-200 bg-zinc-50 px-3 py-2 text-sm outline-none focus:border-zinc-400 dark:border-zinc-800 dark:bg-zinc-900";
|
|
68
|
+
readonly list: "flex-1 overflow-y-auto p-1.5";
|
|
69
|
+
readonly item: "flex w-full items-center gap-3 rounded-xl px-2.5 py-2 text-left transition hover:bg-zinc-100 disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-zinc-900";
|
|
70
|
+
readonly avatar: "flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-zinc-200 text-sm font-semibold text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300";
|
|
71
|
+
readonly name: "truncate text-sm font-medium";
|
|
72
|
+
readonly subtitle: "truncate text-xs text-zinc-500 dark:text-zinc-400";
|
|
73
|
+
readonly empty: "px-4 py-8 text-center text-sm text-zinc-400";
|
|
74
|
+
};
|
|
60
75
|
};
|
|
61
76
|
export declare function extendChatPanelTheme(overrides: Partial<{
|
|
62
77
|
[K in keyof ChatPanelTheme]: Partial<ChatPanelTheme[K]>;
|
|
@@ -55,7 +55,22 @@ export const chatPanelTheme = {
|
|
|
55
55
|
pendingFiles: 'flex flex-wrap gap-1.5 px-4 pb-2',
|
|
56
56
|
pendingChip: 'inline-flex items-center gap-1 rounded-lg bg-zinc-100 px-2 py-1 text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300'
|
|
57
57
|
},
|
|
58
|
-
error: 'border-t border-red-200 bg-red-50 px-4 py-2 text-xs text-red-600 dark:border-red-900 dark:bg-red-950/40 dark:text-red-300'
|
|
58
|
+
error: 'border-t border-red-200 bg-red-50 px-4 py-2 text-xs text-red-600 dark:border-red-900 dark:bg-red-950/40 dark:text-red-300',
|
|
59
|
+
picker: {
|
|
60
|
+
overlay: 'fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 backdrop-blur-sm sm:items-center',
|
|
61
|
+
panel: 'flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-800 dark:bg-zinc-950',
|
|
62
|
+
header: 'flex items-center justify-between gap-2 border-b border-zinc-200 px-4 py-3 dark:border-zinc-800',
|
|
63
|
+
title: 'text-sm font-semibold',
|
|
64
|
+
closeButton: 'inline-flex h-8 w-8 items-center justify-center rounded-lg text-zinc-500 transition hover:bg-zinc-100 dark:hover:bg-zinc-800',
|
|
65
|
+
searchWrap: 'border-b border-zinc-200 p-3 dark:border-zinc-800',
|
|
66
|
+
search: 'w-full rounded-xl border border-zinc-200 bg-zinc-50 px-3 py-2 text-sm outline-none focus:border-zinc-400 dark:border-zinc-800 dark:bg-zinc-900',
|
|
67
|
+
list: 'flex-1 overflow-y-auto p-1.5',
|
|
68
|
+
item: 'flex w-full items-center gap-3 rounded-xl px-2.5 py-2 text-left transition hover:bg-zinc-100 disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-zinc-900',
|
|
69
|
+
avatar: 'flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-zinc-200 text-sm font-semibold text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300',
|
|
70
|
+
name: 'truncate text-sm font-medium',
|
|
71
|
+
subtitle: 'truncate text-xs text-zinc-500 dark:text-zinc-400',
|
|
72
|
+
empty: 'px-4 py-8 text-center text-sm text-zinc-400'
|
|
73
|
+
}
|
|
59
74
|
};
|
|
60
75
|
export function extendChatPanelTheme(overrides) {
|
|
61
76
|
const merged = {};
|
|
@@ -43,11 +43,25 @@ export type ChatPanelActions = {
|
|
|
43
43
|
id: string;
|
|
44
44
|
}, ChatActionResponse>;
|
|
45
45
|
};
|
|
46
|
+
/** A selectable person for the built-in "new conversation" people picker. */
|
|
47
|
+
export type ChatDirectoryUser = {
|
|
48
|
+
userId: string;
|
|
49
|
+
name: string;
|
|
50
|
+
avatarUrl?: string;
|
|
51
|
+
/** Secondary line, e.g. job title or department. */
|
|
52
|
+
subtitle?: string;
|
|
53
|
+
};
|
|
46
54
|
export type ChatPanelProps = {
|
|
47
55
|
/** The authenticated user's id (must match the verified session). */
|
|
48
56
|
currentUserId: string;
|
|
49
57
|
/** Generated API actions wired by the consumer. */
|
|
50
58
|
actions: ChatPanelActions;
|
|
59
|
+
/**
|
|
60
|
+
* People the current user can start a conversation with. When provided, the
|
|
61
|
+
* "new conversation" button opens a built-in searchable people picker
|
|
62
|
+
* (Facebook/LinkedIn style). The current user is filtered out automatically.
|
|
63
|
+
*/
|
|
64
|
+
directory?: ChatDirectoryUser[];
|
|
51
65
|
/** Absolute WebSocket origin, e.g. "wss://api.example.com". Defaults to current host. */
|
|
52
66
|
wsUrl?: string;
|
|
53
67
|
/** WebSocket path (default: "/api/events/subscribe"). */
|