@dashx/react 0.4.2 → 0.4.4
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/cjs/components/popover copy.d.ts +47 -0
- package/dist/cjs/hooks/use-in-app.js +1 -1
- package/dist/cjs/hooks/use-in-app.js.map +3 -3
- package/dist/cjs/tsconfig.tsbuildinfo +1 -0
- package/dist/cjs/variants/button copy.d.ts +254 -0
- package/dist/esm/components/popover copy.d.ts +47 -0
- package/dist/esm/hooks/use-in-app.js +1 -1
- package/dist/esm/hooks/use-in-app.js.map +3 -3
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/dist/esm/variants/button copy.d.ts +254 -0
- package/package.json +2 -2
- package/src/hooks/use-in-app.ts +45 -12
- package/CHANGELOG.md +0 -81
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
2
|
+
declare const button: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
size: {
|
|
4
|
+
extrasmall: string;
|
|
5
|
+
small: string;
|
|
6
|
+
medium: string;
|
|
7
|
+
large: string;
|
|
8
|
+
extralarge: string;
|
|
9
|
+
};
|
|
10
|
+
variant: {
|
|
11
|
+
fill: string;
|
|
12
|
+
outline: string;
|
|
13
|
+
simple: string;
|
|
14
|
+
ghost: string;
|
|
15
|
+
};
|
|
16
|
+
mode: {
|
|
17
|
+
distinct: string;
|
|
18
|
+
subtle: string;
|
|
19
|
+
negative: string;
|
|
20
|
+
};
|
|
21
|
+
roundness: {};
|
|
22
|
+
elevation: {};
|
|
23
|
+
shape: {
|
|
24
|
+
square: string;
|
|
25
|
+
rect: string;
|
|
26
|
+
};
|
|
27
|
+
inset: {
|
|
28
|
+
left: string;
|
|
29
|
+
right: string;
|
|
30
|
+
both: string;
|
|
31
|
+
};
|
|
32
|
+
}, undefined, "ease-fluid inline-flex items-center justify-center gap-2 outline-none transition-[box-shadow,background-color,color] duration-300 select-none data-[focus-visible]:outline-2 data-[focus-visible]:outline-offset-2 data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[disabled]:shadow-none", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
33
|
+
size: {
|
|
34
|
+
extrasmall: string;
|
|
35
|
+
small: string;
|
|
36
|
+
medium: string;
|
|
37
|
+
large: string;
|
|
38
|
+
extralarge: string;
|
|
39
|
+
};
|
|
40
|
+
variant: {
|
|
41
|
+
fill: string;
|
|
42
|
+
outline: string;
|
|
43
|
+
simple: string;
|
|
44
|
+
ghost: string;
|
|
45
|
+
};
|
|
46
|
+
mode: {
|
|
47
|
+
distinct: string;
|
|
48
|
+
subtle: string;
|
|
49
|
+
negative: string;
|
|
50
|
+
};
|
|
51
|
+
roundness: {};
|
|
52
|
+
elevation: {};
|
|
53
|
+
shape: {
|
|
54
|
+
square: string;
|
|
55
|
+
rect: string;
|
|
56
|
+
};
|
|
57
|
+
inset: {
|
|
58
|
+
left: string;
|
|
59
|
+
right: string;
|
|
60
|
+
both: string;
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
size: {
|
|
64
|
+
extrasmall: string;
|
|
65
|
+
small: string;
|
|
66
|
+
medium: string;
|
|
67
|
+
large: string;
|
|
68
|
+
extralarge: string;
|
|
69
|
+
};
|
|
70
|
+
roundness: {
|
|
71
|
+
none: string;
|
|
72
|
+
small: string;
|
|
73
|
+
medium: string;
|
|
74
|
+
large: string;
|
|
75
|
+
full: string;
|
|
76
|
+
};
|
|
77
|
+
elevation: {
|
|
78
|
+
none: string;
|
|
79
|
+
small: string;
|
|
80
|
+
medium: string;
|
|
81
|
+
large: string;
|
|
82
|
+
};
|
|
83
|
+
}>, {
|
|
84
|
+
size: {
|
|
85
|
+
extrasmall: string;
|
|
86
|
+
small: string;
|
|
87
|
+
medium: string;
|
|
88
|
+
large: string;
|
|
89
|
+
extralarge: string;
|
|
90
|
+
};
|
|
91
|
+
roundness: {
|
|
92
|
+
none: string;
|
|
93
|
+
small: string;
|
|
94
|
+
medium: string;
|
|
95
|
+
large: string;
|
|
96
|
+
full: string;
|
|
97
|
+
};
|
|
98
|
+
elevation: {
|
|
99
|
+
none: string;
|
|
100
|
+
small: string;
|
|
101
|
+
medium: string;
|
|
102
|
+
large: string;
|
|
103
|
+
};
|
|
104
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
105
|
+
size: {
|
|
106
|
+
extrasmall: string;
|
|
107
|
+
small: string;
|
|
108
|
+
medium: string;
|
|
109
|
+
large: string;
|
|
110
|
+
extralarge: string;
|
|
111
|
+
};
|
|
112
|
+
roundness: {
|
|
113
|
+
none: string;
|
|
114
|
+
small: string;
|
|
115
|
+
medium: string;
|
|
116
|
+
large: string;
|
|
117
|
+
full: string;
|
|
118
|
+
};
|
|
119
|
+
elevation: {
|
|
120
|
+
none: string;
|
|
121
|
+
small: string;
|
|
122
|
+
medium: string;
|
|
123
|
+
large: string;
|
|
124
|
+
};
|
|
125
|
+
}, undefined, undefined, import("tailwind-variants/dist/config.js").TVConfig<{
|
|
126
|
+
size: {
|
|
127
|
+
extrasmall: string;
|
|
128
|
+
small: string;
|
|
129
|
+
medium: string;
|
|
130
|
+
large: string;
|
|
131
|
+
extralarge: string;
|
|
132
|
+
};
|
|
133
|
+
roundness: {
|
|
134
|
+
none: string;
|
|
135
|
+
small: string;
|
|
136
|
+
medium: string;
|
|
137
|
+
large: string;
|
|
138
|
+
full: string;
|
|
139
|
+
};
|
|
140
|
+
elevation: {
|
|
141
|
+
none: string;
|
|
142
|
+
small: string;
|
|
143
|
+
medium: string;
|
|
144
|
+
large: string;
|
|
145
|
+
};
|
|
146
|
+
}, {
|
|
147
|
+
size: {
|
|
148
|
+
extrasmall: string;
|
|
149
|
+
small: string;
|
|
150
|
+
medium: string;
|
|
151
|
+
large: string;
|
|
152
|
+
extralarge: string;
|
|
153
|
+
};
|
|
154
|
+
roundness: {
|
|
155
|
+
none: string;
|
|
156
|
+
small: string;
|
|
157
|
+
medium: string;
|
|
158
|
+
large: string;
|
|
159
|
+
full: string;
|
|
160
|
+
};
|
|
161
|
+
elevation: {
|
|
162
|
+
none: string;
|
|
163
|
+
small: string;
|
|
164
|
+
medium: string;
|
|
165
|
+
large: string;
|
|
166
|
+
};
|
|
167
|
+
}>, {
|
|
168
|
+
size: {
|
|
169
|
+
extrasmall: string;
|
|
170
|
+
small: string;
|
|
171
|
+
medium: string;
|
|
172
|
+
large: string;
|
|
173
|
+
extralarge: string;
|
|
174
|
+
};
|
|
175
|
+
roundness: {
|
|
176
|
+
none: string;
|
|
177
|
+
small: string;
|
|
178
|
+
medium: string;
|
|
179
|
+
large: string;
|
|
180
|
+
full: string;
|
|
181
|
+
};
|
|
182
|
+
elevation: {
|
|
183
|
+
none: string;
|
|
184
|
+
small: string;
|
|
185
|
+
medium: string;
|
|
186
|
+
large: string;
|
|
187
|
+
};
|
|
188
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
189
|
+
size: {
|
|
190
|
+
extrasmall: string;
|
|
191
|
+
small: string;
|
|
192
|
+
medium: string;
|
|
193
|
+
large: string;
|
|
194
|
+
extralarge: string;
|
|
195
|
+
};
|
|
196
|
+
roundness: {
|
|
197
|
+
none: string;
|
|
198
|
+
small: string;
|
|
199
|
+
medium: string;
|
|
200
|
+
large: string;
|
|
201
|
+
full: string;
|
|
202
|
+
};
|
|
203
|
+
elevation: {
|
|
204
|
+
none: string;
|
|
205
|
+
small: string;
|
|
206
|
+
medium: string;
|
|
207
|
+
large: string;
|
|
208
|
+
};
|
|
209
|
+
}, undefined, undefined, import("tailwind-variants/dist/config.js").TVConfig<{
|
|
210
|
+
size: {
|
|
211
|
+
extrasmall: string;
|
|
212
|
+
small: string;
|
|
213
|
+
medium: string;
|
|
214
|
+
large: string;
|
|
215
|
+
extralarge: string;
|
|
216
|
+
};
|
|
217
|
+
roundness: {
|
|
218
|
+
none: string;
|
|
219
|
+
small: string;
|
|
220
|
+
medium: string;
|
|
221
|
+
large: string;
|
|
222
|
+
full: string;
|
|
223
|
+
};
|
|
224
|
+
elevation: {
|
|
225
|
+
none: string;
|
|
226
|
+
small: string;
|
|
227
|
+
medium: string;
|
|
228
|
+
large: string;
|
|
229
|
+
};
|
|
230
|
+
}, {
|
|
231
|
+
size: {
|
|
232
|
+
extrasmall: string;
|
|
233
|
+
small: string;
|
|
234
|
+
medium: string;
|
|
235
|
+
large: string;
|
|
236
|
+
extralarge: string;
|
|
237
|
+
};
|
|
238
|
+
roundness: {
|
|
239
|
+
none: string;
|
|
240
|
+
small: string;
|
|
241
|
+
medium: string;
|
|
242
|
+
large: string;
|
|
243
|
+
full: string;
|
|
244
|
+
};
|
|
245
|
+
elevation: {
|
|
246
|
+
none: string;
|
|
247
|
+
small: string;
|
|
248
|
+
medium: string;
|
|
249
|
+
large: string;
|
|
250
|
+
};
|
|
251
|
+
}>, unknown, unknown, undefined>>>;
|
|
252
|
+
type ButtonVariantProps = VariantProps<typeof button>;
|
|
253
|
+
export type { ButtonVariantProps };
|
|
254
|
+
export { button };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
|
+
import type { PopoverVariantProps } from '../variants/popover.js';
|
|
4
|
+
interface PopoverRootProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root> {
|
|
5
|
+
}
|
|
6
|
+
declare const PopoverRoot: React.FC<PopoverRootProps>;
|
|
7
|
+
interface PopoverTriggerProps extends React.PropsWithChildren<{}> {
|
|
8
|
+
}
|
|
9
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
interface PopoverContentProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>, React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Portal>, PopoverVariantProps {
|
|
11
|
+
maxWidth?: number | string;
|
|
12
|
+
minWidth?: number | string;
|
|
13
|
+
width?: number | string;
|
|
14
|
+
maxHeight?: number | string;
|
|
15
|
+
minHeight?: number | string;
|
|
16
|
+
height?: number | string;
|
|
17
|
+
}
|
|
18
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
type PopoverBodyProps = React.PropsWithChildren<{
|
|
20
|
+
asChild?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
declare const PopoverBody: React.ForwardRefExoticComponent<{
|
|
23
|
+
asChild?: boolean;
|
|
24
|
+
} & {
|
|
25
|
+
children?: React.ReactNode | undefined;
|
|
26
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
type PopoverHeaderProps = React.PropsWithChildren<{
|
|
28
|
+
asChild?: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
declare const PopoverHeader: React.ForwardRefExoticComponent<{
|
|
31
|
+
asChild?: boolean;
|
|
32
|
+
} & {
|
|
33
|
+
children?: React.ReactNode | undefined;
|
|
34
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
type PopoverFooterProps = React.PropsWithChildren<{
|
|
36
|
+
asChild?: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
declare const PopoverFooter: React.ForwardRefExoticComponent<{
|
|
39
|
+
asChild?: boolean;
|
|
40
|
+
} & {
|
|
41
|
+
children?: React.ReactNode | undefined;
|
|
42
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
interface PopoverCloseProps extends React.PropsWithChildren<{}> {
|
|
44
|
+
}
|
|
45
|
+
declare const PopoverClose: React.ForwardRefExoticComponent<PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
46
|
+
export { PopoverRoot as Root, PopoverContent as Content, PopoverBody as Body, PopoverHeader as Header, PopoverFooter as Footer, PopoverTrigger as Trigger, PopoverClose as Close, };
|
|
47
|
+
export type { PopoverRootProps as RootProps, PopoverContentProps as ContentProps, PopoverBodyProps as BodyProps, PopoverHeaderProps as HeaderProps, PopoverFooterProps as FooterProps, PopoverTriggerProps as TriggerProps, PopoverCloseProps as CloseProps, };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import w from"react-hot-toast";import{useEffect as m,useState as o}from"react";import{WebsocketMessage as E,IN_APP_MESSAGES_PAGE_SIZE as d}from"@dashx/browser";import U from"./use-dashx-provider.js";import{useWebSocket as R}from"../providers/DashXProvider.js";const S=({showToast:i=!0}={})=>{let a=U();const{subscribe:p}=R(),[M,A]=o([]),[f,h]=o(null),[c,g]=o(!1),[u,l]=o(!1),k=e=>s=>{console.error(e,s)},t=(e,s)=>{const r=k(s);try{return Promise.resolve(e()).then(()=>{},n=>{r(n)})}catch(n){return r(n),Promise.resolve()}},b=e=>t(()=>a.trackMessage({id:e,status:"READ"}),"DashX: failed to mark in-app message as read"),y=e=>t(()=>a.trackMessage({id:e,status:"UNREAD"}),"DashX: failed to mark in-app message as unread"),I=()=>t(()=>a.trackAllMessages(),"DashX: failed to mark all in-app messages as read"),P=async()=>{if(!(u||!c)){l(!0);try{const{hasMore:e}=await a.fetchMoreInAppMessages();g(e)}catch(e){console.error("DashX: failed to fetch more in-app messages",e)}finally{l(!1)}}};return m(()=>{const e=a.watchFetchInAppMessages(r=>{A(r),r.length<=d&&g(r.length===d)}),s=a.watchFetchInAppMessagesAggregate(h);return()=>{e(),s()}},[a]),m(()=>i?p(s=>{s?.type===E.IN_APP_MESSAGE&&w(s.data.renderedContent.body)}):void 0,[p,i]),{messages:M,unreadMessagesCount:f,hasMore:c,isLoadingMore:u,loadMore:P,markMessageAsRead:b,markMessageAsUnread:y,markAllMessagesAsRead:I}};var F=S;export{F as default};
|
|
2
2
|
//# sourceMappingURL=use-in-app.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/use-in-app.ts"],
|
|
4
|
-
"sourcesContent": ["import toast from 'react-hot-toast';\nimport { useEffect, useState } from 'react';\nimport { WebsocketMessage, IN_APP_MESSAGES_PAGE_SIZE } from '@dashx/browser';\nimport type { InAppMessages, WebsocketMessageType } from '@dashx/browser';\n\nimport useDashXProvider from './use-dashx-provider.js';\nimport { useWebSocket } from '../providers/DashXProvider.js';\n\ntype UseInAppHookResponse = {\n messages: InAppMessages;\n unreadMessagesCount: number | null;\n hasMore: boolean;\n isLoadingMore: boolean;\n loadMore: () => Promise<void>;\n markMessageAsRead: (id: string) => Promise<any>;\n markMessageAsUnread: (id: string) => Promise<any>;\n markAllMessagesAsRead: () => Promise<any>;\n};\n\ntype UseInAppOptions = {\n /**\n * Fires a react-hot-toast for every live IN_APP_MESSAGE. Only useful with a mounted\n * `<Toast>`, which is also what runs react-hot-toast's expiration timers - without one\n * the toasts never render and its store just retains the last few entries. Set false\n * when the host renders its own notification stack.\n */\n showToast?: boolean;\n};\n\nconst useInApp = ({ showToast = true }: UseInAppOptions = {}): UseInAppHookResponse => {\n let dashX = useDashXProvider();\n const { subscribe } = useWebSocket();\n const [messages, setMessages] = useState<InAppMessages>([]);\n const [unreadMessagesCount, setUnreadMessagesCount] = useState<number | null>(null);\n const [hasMore, setHasMore] = useState(false);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n\n const
|
|
5
|
-
"mappings": "AAAA,OAAOA,MAAW,kBAClB,OAAS,aAAAC,EAAW,YAAAC,MAAgB,QACpC,OAAS,oBAAAC,EAAkB,6BAAAC,MAAiC,iBAG5D,OAAOC,MAAsB,0BAC7B,OAAS,gBAAAC,MAAoB,gCAuB7B,MAAMC,EAAW,CAAC,CAAE,UAAAC,EAAY,EAAK,EAAqB,CAAC,IAA4B,CACrF,IAAIC,EAAQJ,EAAiB,EAC7B,KAAM,CAAE,UAAAK,CAAU,EAAIJ,EAAa,EAC7B,CAACK,EAAUC,CAAW,EAAIV,EAAwB,CAAC,CAAC,EACpD,CAACW,EAAqBC,CAAsB,EAAIZ,EAAwB,IAAI,EAC5E,CAACa,EAASC,CAAU,EAAId,EAAS,EAAK,EACtC,CAACe,EAAeC,CAAgB,EAAIhB,EAAS,EAAK,
|
|
6
|
-
"names": ["toast", "useEffect", "useState", "WebsocketMessage", "IN_APP_MESSAGES_PAGE_SIZE", "useDashXProvider", "useWebSocket", "useInApp", "showToast", "dashX", "subscribe", "messages", "setMessages", "unreadMessagesCount", "setUnreadMessagesCount", "hasMore", "setHasMore", "isLoadingMore", "setIsLoadingMore", "
|
|
4
|
+
"sourcesContent": ["import toast from 'react-hot-toast';\nimport { useEffect, useState } from 'react';\nimport { WebsocketMessage, IN_APP_MESSAGES_PAGE_SIZE } from '@dashx/browser';\nimport type { InAppMessages, WebsocketMessageType } from '@dashx/browser';\n\nimport useDashXProvider from './use-dashx-provider.js';\nimport { useWebSocket } from '../providers/DashXProvider.js';\n\ntype UseInAppHookResponse = {\n messages: InAppMessages;\n unreadMessagesCount: number | null;\n hasMore: boolean;\n isLoadingMore: boolean;\n loadMore: () => Promise<void>;\n markMessageAsRead: (id: string) => Promise<any>;\n markMessageAsUnread: (id: string) => Promise<any>;\n markAllMessagesAsRead: () => Promise<any>;\n};\n\ntype UseInAppOptions = {\n /**\n * Fires a react-hot-toast for every live IN_APP_MESSAGE. Only useful with a mounted\n * `<Toast>`, which is also what runs react-hot-toast's expiration timers - without one\n * the toasts never render and its store just retains the last few entries. Set false\n * when the host renders its own notification stack.\n */\n showToast?: boolean;\n};\n\nconst useInApp = ({ showToast = true }: UseInAppOptions = {}): UseInAppHookResponse => {\n let dashX = useDashXProvider();\n const { subscribe } = useWebSocket();\n const [messages, setMessages] = useState<InAppMessages>([]);\n const [unreadMessagesCount, setUnreadMessagesCount] = useState<number | null>(null);\n const [hasMore, setHasMore] = useState(false);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n\n // `trackMessage` and `trackAllMessages` throw SYNCHRONOUSLY when no account is\n // identified, before any promise exists, so a chained `.catch` never sees it and the\n // error escapes into the caller's click handler. Route both shapes through one guard.\n const reportFailure = (message: string) => (error: unknown) => {\n console.error(message, error);\n };\n\n const trackQuietly = (track: () => unknown, message: string): Promise<void> => {\n const onFailure = reportFailure(message);\n\n try {\n return Promise.resolve(track()).then(\n () => undefined,\n (error: unknown) => {\n onFailure(error);\n },\n );\n } catch (error) {\n onFailure(error);\n return Promise.resolve();\n }\n };\n\n const markMessageAsRead = (id: string) =>\n trackQuietly(\n () => dashX.trackMessage({ id, status: 'READ' }),\n 'DashX: failed to mark in-app message as read',\n );\n\n const markMessageAsUnread = (id: string) =>\n trackQuietly(\n () => dashX.trackMessage({ id, status: 'UNREAD' }),\n 'DashX: failed to mark in-app message as unread',\n );\n\n const markAllMessagesAsRead = () =>\n trackQuietly(\n () => dashX.trackAllMessages(),\n 'DashX: failed to mark all in-app messages as read',\n );\n\n const loadMore = async () => {\n if (isLoadingMore || !hasMore) return;\n setIsLoadingMore(true);\n try {\n const { hasMore: more } = await dashX.fetchMoreInAppMessages();\n setHasMore(more);\n } catch (error) {\n // hasMore stays true so a later scroll retries the page.\n console.error('DashX: failed to fetch more in-app messages', error);\n } finally {\n setIsLoadingMore(false);\n }\n };\n\n useEffect(() => {\n // Set up in-app message watchers (automatically refetch on WebSocket reconnection).\n // Both return an unsubscribe; without calling it the watchQuery subscriptions outlive\n // the component and keep pushing state into it after unmount.\n const unwatchMessages = dashX.watchFetchInAppMessages((nextMessages) => {\n setMessages(nextMessages);\n // While the list is a single page (initial load, empty inbox, or a reconnect\n // refetch of page 1), a full page implies more; past that, loadMore owns hasMore.\n if (nextMessages.length <= IN_APP_MESSAGES_PAGE_SIZE) {\n setHasMore(nextMessages.length === IN_APP_MESSAGES_PAGE_SIZE);\n }\n });\n const unwatchAggregate = dashX.watchFetchInAppMessagesAggregate(setUnreadMessagesCount);\n\n return () => {\n unwatchMessages();\n unwatchAggregate();\n };\n }, [dashX]);\n\n useEffect(() => {\n if (!showToast) return;\n\n // Subscribe to WebSocket messages for in-app messages\n const unsubscribe = subscribe((message: WebsocketMessageType) => {\n // Handle only IN_APP_MESSAGE for toast display\n // The client handles all other message processing internally\n if (message?.type === WebsocketMessage.IN_APP_MESSAGE) {\n toast(message.data.renderedContent.body);\n }\n });\n\n return unsubscribe;\n }, [subscribe, showToast]);\n\n return {\n messages,\n unreadMessagesCount,\n hasMore,\n isLoadingMore,\n loadMore,\n markMessageAsRead,\n markMessageAsUnread,\n markAllMessagesAsRead,\n };\n};\n\nexport default useInApp;\nexport type { UseInAppOptions };\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAW,kBAClB,OAAS,aAAAC,EAAW,YAAAC,MAAgB,QACpC,OAAS,oBAAAC,EAAkB,6BAAAC,MAAiC,iBAG5D,OAAOC,MAAsB,0BAC7B,OAAS,gBAAAC,MAAoB,gCAuB7B,MAAMC,EAAW,CAAC,CAAE,UAAAC,EAAY,EAAK,EAAqB,CAAC,IAA4B,CACrF,IAAIC,EAAQJ,EAAiB,EAC7B,KAAM,CAAE,UAAAK,CAAU,EAAIJ,EAAa,EAC7B,CAACK,EAAUC,CAAW,EAAIV,EAAwB,CAAC,CAAC,EACpD,CAACW,EAAqBC,CAAsB,EAAIZ,EAAwB,IAAI,EAC5E,CAACa,EAASC,CAAU,EAAId,EAAS,EAAK,EACtC,CAACe,EAAeC,CAAgB,EAAIhB,EAAS,EAAK,EAKlDiB,EAAiBC,GAAqBC,GAAmB,CAC7D,QAAQ,MAAMD,EAASC,CAAK,CAC9B,EAEMC,EAAe,CAACC,EAAsBH,IAAmC,CAC7E,MAAMI,EAAYL,EAAcC,CAAO,EAEvC,GAAI,CACF,OAAO,QAAQ,QAAQG,EAAM,CAAC,EAAE,KAC9B,IAAG,GACFF,GAAmB,CAClBG,EAAUH,CAAK,CACjB,CACF,CACF,OAASA,EAAO,CACd,OAAAG,EAAUH,CAAK,EACR,QAAQ,QAAQ,CACzB,CACF,EAEMI,EAAqBC,GACzBJ,EACE,IAAMb,EAAM,aAAa,CAAE,GAAAiB,EAAI,OAAQ,MAAO,CAAC,EAC/C,8CACF,EAEIC,EAAuBD,GAC3BJ,EACE,IAAMb,EAAM,aAAa,CAAE,GAAAiB,EAAI,OAAQ,QAAS,CAAC,EACjD,gDACF,EAEIE,EAAwB,IAC5BN,EACE,IAAMb,EAAM,iBAAiB,EAC7B,mDACF,EAEIoB,EAAW,SAAY,CAC3B,GAAI,EAAAZ,GAAiB,CAACF,GACtB,CAAAG,EAAiB,EAAI,EACrB,GAAI,CACF,KAAM,CAAE,QAASY,CAAK,EAAI,MAAMrB,EAAM,uBAAuB,EAC7DO,EAAWc,CAAI,CACjB,OAAST,EAAO,CAEd,QAAQ,MAAM,8CAA+CA,CAAK,CACpE,QAAE,CACAH,EAAiB,EAAK,CACxB,EACF,EAEA,OAAAjB,EAAU,IAAM,CAId,MAAM8B,EAAkBtB,EAAM,wBAAyBuB,GAAiB,CACtEpB,EAAYoB,CAAY,EAGpBA,EAAa,QAAU5B,GACzBY,EAAWgB,EAAa,SAAW5B,CAAyB,CAEhE,CAAC,EACK6B,EAAmBxB,EAAM,iCAAiCK,CAAsB,EAEtF,MAAO,IAAM,CACXiB,EAAgB,EAChBE,EAAiB,CACnB,CACF,EAAG,CAACxB,CAAK,CAAC,EAEVR,EAAU,IACHO,EAGeE,EAAWU,GAAkC,CAG3DA,GAAS,OAASjB,EAAiB,gBACrCH,EAAMoB,EAAQ,KAAK,gBAAgB,IAAI,CAE3C,CAAC,EATe,OAYf,CAACV,EAAWF,CAAS,CAAC,EAElB,CACL,SAAAG,EACA,oBAAAE,EACA,QAAAE,EACA,cAAAE,EACA,SAAAY,EACA,kBAAAJ,EACA,oBAAAE,EACA,sBAAAC,CACF,CACF,EAEA,IAAOM,EAAQ3B",
|
|
6
|
+
"names": ["toast", "useEffect", "useState", "WebsocketMessage", "IN_APP_MESSAGES_PAGE_SIZE", "useDashXProvider", "useWebSocket", "useInApp", "showToast", "dashX", "subscribe", "messages", "setMessages", "unreadMessagesCount", "setUnreadMessagesCount", "hasMore", "setHasMore", "isLoadingMore", "setIsLoadingMore", "reportFailure", "message", "error", "trackQuietly", "track", "onFailure", "markMessageAsRead", "id", "markMessageAsUnread", "markAllMessagesAsRead", "loadMore", "more", "unwatchMessages", "nextMessages", "unwatchAggregate", "use_in_app_default"]
|
|
7
7
|
}
|