@appgram/react 0.1.1 → 0.1.3

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 (39) hide show
  1. package/dist/{useVote-CLhkwtLT.d.mts → StatusBoard-DhKRu-An.d.mts} +125 -1
  2. package/dist/{useVote-CLhkwtLT.d.ts → StatusBoard-DhKRu-An.d.ts} +125 -1
  3. package/dist/{chunk-N6PJDQCU.mjs → chunk-NABMGLTY.mjs} +210 -6
  4. package/dist/chunk-NABMGLTY.mjs.map +1 -0
  5. package/dist/chunk-NSV6Q6QQ.js +202 -0
  6. package/dist/chunk-NSV6Q6QQ.js.map +1 -0
  7. package/dist/chunk-ONZ7RQBM.mjs +199 -0
  8. package/dist/chunk-ONZ7RQBM.mjs.map +1 -0
  9. package/dist/{chunk-75P634IK.js → chunk-UPTP7QX5.js} +213 -5
  10. package/dist/chunk-UPTP7QX5.js.map +1 -0
  11. package/dist/{chunk-AIDLOCVJ.mjs → chunk-UWIJR4ZY.mjs} +760 -15
  12. package/dist/chunk-UWIJR4ZY.mjs.map +1 -0
  13. package/dist/{chunk-3UBJGXCO.js → chunk-WZIN7KEM.js} +820 -74
  14. package/dist/chunk-WZIN7KEM.js.map +1 -0
  15. package/dist/components/index.d.mts +68 -106
  16. package/dist/components/index.d.ts +68 -106
  17. package/dist/components/index.js +29 -21
  18. package/dist/components/index.mjs +2 -2
  19. package/dist/hooks/index.d.mts +3 -572
  20. package/dist/hooks/index.d.ts +3 -572
  21. package/dist/hooks/index.js +33 -13
  22. package/dist/hooks/index.mjs +2 -2
  23. package/dist/index-DpZz_TZE.d.ts +917 -0
  24. package/dist/index-X95JANOa.d.mts +917 -0
  25. package/dist/index.d.mts +32 -5
  26. package/dist/index.d.ts +32 -5
  27. package/dist/index.js +123 -76
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +60 -41
  30. package/dist/index.mjs.map +1 -1
  31. package/package.json +1 -1
  32. package/dist/chunk-3UBJGXCO.js.map +0 -1
  33. package/dist/chunk-75P634IK.js.map +0 -1
  34. package/dist/chunk-AIDLOCVJ.mjs.map +0 -1
  35. package/dist/chunk-KPIKYXAN.mjs +0 -47
  36. package/dist/chunk-KPIKYXAN.mjs.map +0 -1
  37. package/dist/chunk-N6PJDQCU.mjs.map +0 -1
  38. package/dist/chunk-ZJZ3A2S3.js +0 -49
  39. package/dist/chunk-ZJZ3A2S3.js.map +0 -1
@@ -1,572 +1,3 @@
1
- import { W as WishFilters, b as Wish, c as Comment, k as CommentCreateInput, o as Roadmap, p as RoadmapColumn, d as Release, g as HelpArticle, H as HelpCollection, f as HelpFlow, h as SupportRequest, S as SupportRequestInput } from '../useVote-CLhkwtLT.mjs';
2
- export { U as UseVoteOptions, y as UseVoteResult, E as useVote } from '../useVote-CLhkwtLT.mjs';
3
-
4
- /**
5
- * useWishes Hook
6
- *
7
- * Fetches and manages a list of wishes with filtering and pagination.
8
- * Provides headless access to the wishes API for custom UI implementations.
9
- *
10
- * @example
11
- * ```tsx
12
- * import { useWishes } from '@appgram/react'
13
- *
14
- * function WishList() {
15
- * const { wishes, isLoading, error, setFilters, refetch } = useWishes({
16
- * filters: { sort_by: 'votes', status: 'pending' },
17
- * refreshInterval: 30000,
18
- * })
19
- *
20
- * if (isLoading) return <Spinner />
21
- * if (error) return <Error message={error} onRetry={refetch} />
22
- *
23
- * return (
24
- * <ul>
25
- * {wishes.map(wish => (
26
- * <li key={wish.id}>{wish.title}</li>
27
- * ))}
28
- * </ul>
29
- * )
30
- * }
31
- * ```
32
- *
33
- * @example
34
- * ```tsx
35
- * // With search and pagination
36
- * function SearchableWishes() {
37
- * const { wishes, isLoading, setFilters, page, totalPages, setPage } = useWishes()
38
- *
39
- * const handleSearch = (query: string) => {
40
- * setFilters({ search: query, page: 1 })
41
- * }
42
- *
43
- * return (
44
- * <>
45
- * <Search onSearch={handleSearch} />
46
- * <WishGrid wishes={wishes} loading={isLoading} />
47
- * <Pagination
48
- * current={page}
49
- * total={totalPages}
50
- * onChange={setPage}
51
- * />
52
- * </>
53
- * )
54
- * }
55
- * ```
56
- */
57
-
58
- interface UseWishesOptions {
59
- /**
60
- * Initial filters
61
- */
62
- filters?: WishFilters;
63
- /**
64
- * Auto-refresh interval in milliseconds (0 to disable)
65
- * @default 0
66
- */
67
- refreshInterval?: number;
68
- /**
69
- * Skip initial fetch
70
- * @default false
71
- */
72
- skip?: boolean;
73
- }
74
- interface UseWishesResult {
75
- /**
76
- * List of wishes
77
- */
78
- wishes: Wish[];
79
- /**
80
- * Loading state
81
- */
82
- isLoading: boolean;
83
- /**
84
- * Error message if any
85
- */
86
- error: string | null;
87
- /**
88
- * Total number of wishes
89
- */
90
- total: number;
91
- /**
92
- * Current page
93
- */
94
- page: number;
95
- /**
96
- * Total pages
97
- */
98
- totalPages: number;
99
- /**
100
- * Update filters
101
- */
102
- setFilters: (filters: WishFilters) => void;
103
- /**
104
- * Go to a specific page
105
- */
106
- setPage: (page: number) => void;
107
- /**
108
- * Manually refetch data
109
- */
110
- refetch: () => Promise<void>;
111
- }
112
- declare function useWishes(options?: UseWishesOptions): UseWishesResult;
113
-
114
- /**
115
- * useWish Hook
116
- *
117
- * Fetches and manages a single wish.
118
- */
119
-
120
- interface UseWishOptions {
121
- /**
122
- * The wish ID to fetch
123
- */
124
- wishId: string;
125
- /**
126
- * Skip initial fetch
127
- * @default false
128
- */
129
- skip?: boolean;
130
- }
131
- interface UseWishResult {
132
- /**
133
- * The wish data
134
- */
135
- wish: Wish | null;
136
- /**
137
- * Loading state
138
- */
139
- isLoading: boolean;
140
- /**
141
- * Error message if any
142
- */
143
- error: string | null;
144
- /**
145
- * Manually refetch data
146
- */
147
- refetch: () => Promise<void>;
148
- }
149
- declare function useWish(options: UseWishOptions): UseWishResult;
150
-
151
- /**
152
- * useComments Hook
153
- *
154
- * Fetches and manages comments for a wish.
155
- */
156
-
157
- interface UseCommentsOptions {
158
- /**
159
- * The wish ID to fetch comments for
160
- */
161
- wishId: string;
162
- /**
163
- * Number of comments per page
164
- * @default 20
165
- */
166
- perPage?: number;
167
- /**
168
- * Skip initial fetch
169
- * @default false
170
- */
171
- skip?: boolean;
172
- }
173
- interface UseCommentsResult {
174
- /**
175
- * List of comments
176
- */
177
- comments: Comment[];
178
- /**
179
- * Loading state
180
- */
181
- isLoading: boolean;
182
- /**
183
- * Loading state for creating a comment
184
- */
185
- isCreating: boolean;
186
- /**
187
- * Error message if any
188
- */
189
- error: string | null;
190
- /**
191
- * Total number of comments
192
- */
193
- total: number;
194
- /**
195
- * Current page
196
- */
197
- page: number;
198
- /**
199
- * Total pages
200
- */
201
- totalPages: number;
202
- /**
203
- * Go to next page
204
- */
205
- nextPage: () => void;
206
- /**
207
- * Go to previous page
208
- */
209
- prevPage: () => void;
210
- /**
211
- * Go to specific page
212
- */
213
- setPage: (page: number) => void;
214
- /**
215
- * Create a new comment
216
- */
217
- createComment: (data: Omit<CommentCreateInput, 'wish_id'>) => Promise<Comment | null>;
218
- /**
219
- * Manually refetch data
220
- */
221
- refetch: () => Promise<void>;
222
- }
223
- declare function useComments(options: UseCommentsOptions): UseCommentsResult;
224
-
225
- /**
226
- * useRoadmap Hook
227
- *
228
- * Fetches and manages roadmap data for custom UI implementations.
229
- *
230
- * @example
231
- * ```tsx
232
- * import { useRoadmap } from '@appgram/react'
233
- *
234
- * function CustomRoadmap() {
235
- * const { roadmap, isLoading, error, refetch } = useRoadmap({
236
- * refreshInterval: 60000,
237
- * })
238
- *
239
- * if (isLoading) return <Skeleton />
240
- * if (error) return <Error message={error} />
241
- *
242
- * return (
243
- * <div className="roadmap-columns">
244
- * {roadmap?.columns.map(col => (
245
- * <Column key={col.id} title={col.title} items={col.items} />
246
- * ))}
247
- * </div>
248
- * )
249
- * }
250
- * ```
251
- */
252
-
253
- interface UseRoadmapOptions {
254
- /**
255
- * Auto-refresh interval in milliseconds (0 to disable)
256
- * @default 0
257
- */
258
- refreshInterval?: number;
259
- /**
260
- * Skip initial fetch
261
- * @default false
262
- */
263
- skip?: boolean;
264
- }
265
- interface UseRoadmapResult {
266
- /**
267
- * Roadmap data
268
- */
269
- roadmap: Roadmap | null;
270
- /**
271
- * Roadmap columns with items
272
- */
273
- columns: RoadmapColumn[];
274
- /**
275
- * Total number of items
276
- */
277
- totalItems: number;
278
- /**
279
- * Loading state
280
- */
281
- isLoading: boolean;
282
- /**
283
- * Error message if any
284
- */
285
- error: string | null;
286
- /**
287
- * Manually refetch data
288
- */
289
- refetch: () => Promise<void>;
290
- }
291
- declare function useRoadmap(options?: UseRoadmapOptions): UseRoadmapResult;
292
-
293
- /**
294
- * useReleases Hook
295
- *
296
- * Fetches and manages releases/changelog data for custom UI implementations.
297
- *
298
- * @example
299
- * ```tsx
300
- * import { useReleases } from '@appgram/react'
301
- *
302
- * function ChangelogList() {
303
- * const { releases, isLoading, error, refetch } = useReleases({ limit: 10 })
304
- *
305
- * if (isLoading) return <Spinner />
306
- * if (error) return <Alert>{error}</Alert>
307
- *
308
- * return (
309
- * <ul className="changelog">
310
- * {releases.map(release => (
311
- * <li key={release.id}>
312
- * <h3>{release.title}</h3>
313
- * <time>{formatDate(release.published_at)}</time>
314
- * <div dangerouslySetInnerHTML={{ __html: release.content }} />
315
- * </li>
316
- * ))}
317
- * </ul>
318
- * )
319
- * }
320
- * ```
321
- */
322
-
323
- interface UseReleasesOptions {
324
- /**
325
- * Maximum number of releases to fetch
326
- * @default 50
327
- */
328
- limit?: number;
329
- /**
330
- * Skip initial fetch
331
- * @default false
332
- */
333
- skip?: boolean;
334
- }
335
- interface UseReleasesResult {
336
- /**
337
- * List of releases
338
- */
339
- releases: Release[];
340
- /**
341
- * Loading state
342
- */
343
- isLoading: boolean;
344
- /**
345
- * Error message if any
346
- */
347
- error: string | null;
348
- /**
349
- * Manually refetch data
350
- */
351
- refetch: () => Promise<void>;
352
- }
353
- declare function useReleases(options?: UseReleasesOptions): UseReleasesResult;
354
- /**
355
- * useRelease Hook
356
- *
357
- * Fetches a single release by slug.
358
- */
359
- interface UseReleaseOptions {
360
- /**
361
- * The release slug to fetch
362
- */
363
- releaseSlug: string;
364
- /**
365
- * Skip initial fetch
366
- * @default false
367
- */
368
- skip?: boolean;
369
- }
370
- interface UseReleaseResult {
371
- /**
372
- * The release data
373
- */
374
- release: Release | null;
375
- /**
376
- * Loading state
377
- */
378
- isLoading: boolean;
379
- /**
380
- * Error message if any
381
- */
382
- error: string | null;
383
- /**
384
- * Manually refetch data
385
- */
386
- refetch: () => Promise<void>;
387
- }
388
- declare function useRelease(options: UseReleaseOptions): UseReleaseResult;
389
-
390
- /**
391
- * useHelpCenter Hook
392
- *
393
- * Fetches and manages help center data.
394
- */
395
-
396
- interface UseHelpCenterOptions {
397
- /**
398
- * Skip initial fetch
399
- * @default false
400
- */
401
- skip?: boolean;
402
- }
403
- interface UseHelpCenterResult {
404
- /**
405
- * Help collection
406
- */
407
- collection: HelpCollection | null;
408
- /**
409
- * Help flows
410
- */
411
- flows: HelpFlow[];
412
- /**
413
- * Loading state
414
- */
415
- isLoading: boolean;
416
- /**
417
- * Error message if any
418
- */
419
- error: string | null;
420
- /**
421
- * Manually refetch data
422
- */
423
- refetch: () => Promise<void>;
424
- }
425
- declare function useHelpCenter(options?: UseHelpCenterOptions): UseHelpCenterResult;
426
- /**
427
- * useHelpFlow Hook
428
- *
429
- * Fetches a single help flow by slug.
430
- */
431
- interface UseHelpFlowOptions {
432
- /**
433
- * The flow slug to fetch
434
- */
435
- flowSlug: string;
436
- /**
437
- * Skip initial fetch
438
- * @default false
439
- */
440
- skip?: boolean;
441
- }
442
- interface UseHelpFlowResult {
443
- /**
444
- * The flow data
445
- */
446
- flow: HelpFlow | null;
447
- /**
448
- * Loading state
449
- */
450
- isLoading: boolean;
451
- /**
452
- * Error message if any
453
- */
454
- error: string | null;
455
- /**
456
- * Manually refetch data
457
- */
458
- refetch: () => Promise<void>;
459
- }
460
- declare function useHelpFlow(options: UseHelpFlowOptions): UseHelpFlowResult;
461
- /**
462
- * useHelpArticle Hook
463
- *
464
- * Fetches a single help article by slug.
465
- */
466
- interface UseHelpArticleOptions {
467
- /**
468
- * The article slug to fetch
469
- */
470
- articleSlug: string;
471
- /**
472
- * The flow ID the article belongs to
473
- */
474
- flowId: string;
475
- /**
476
- * Skip initial fetch
477
- * @default false
478
- */
479
- skip?: boolean;
480
- }
481
- interface UseHelpArticleResult {
482
- /**
483
- * The article data
484
- */
485
- article: HelpArticle | null;
486
- /**
487
- * Loading state
488
- */
489
- isLoading: boolean;
490
- /**
491
- * Error message if any
492
- */
493
- error: string | null;
494
- /**
495
- * Manually refetch data
496
- */
497
- refetch: () => Promise<void>;
498
- }
499
- declare function useHelpArticle(options: UseHelpArticleOptions): UseHelpArticleResult;
500
-
501
- /**
502
- * useSupport Hook
503
- *
504
- * Manages support ticket submissions and access.
505
- */
506
-
507
- interface UseSupportOptions {
508
- /**
509
- * Callback when a ticket is successfully submitted
510
- */
511
- onSubmitSuccess?: (ticket: SupportRequest) => void;
512
- /**
513
- * Callback when a submission fails
514
- */
515
- onSubmitError?: (error: string) => void;
516
- }
517
- interface UseSupportResult {
518
- /**
519
- * Loading state for ticket submission
520
- */
521
- isSubmitting: boolean;
522
- /**
523
- * Loading state for magic link request
524
- */
525
- isSendingMagicLink: boolean;
526
- /**
527
- * Loading state for token verification
528
- */
529
- isVerifying: boolean;
530
- /**
531
- * Error message if any
532
- */
533
- error: string | null;
534
- /**
535
- * Success message after submitting
536
- */
537
- successMessage: string | null;
538
- /**
539
- * Submit a new support ticket
540
- */
541
- submitTicket: (data: SupportRequestInput) => Promise<SupportRequest | null>;
542
- /**
543
- * Request a magic link to access tickets
544
- */
545
- requestMagicLink: (email: string) => Promise<boolean>;
546
- /**
547
- * Verify a magic link token
548
- */
549
- verifyToken: (token: string) => Promise<{
550
- tickets: SupportRequest[];
551
- userEmail: string;
552
- } | null>;
553
- /**
554
- * Get a specific ticket by ID with token
555
- */
556
- getTicket: (ticketId: string, token: string) => Promise<SupportRequest | null>;
557
- /**
558
- * Add a message to a ticket
559
- */
560
- addMessage: (ticketId: string, token: string, content: string) => Promise<{
561
- id: string;
562
- content: string;
563
- created_at: string;
564
- } | null>;
565
- /**
566
- * Clear any error or success messages
567
- */
568
- clearMessages: () => void;
569
- }
570
- declare function useSupport(options?: UseSupportOptions): UseSupportResult;
571
-
572
- export { type UseCommentsOptions, type UseCommentsResult, type UseHelpArticleOptions, type UseHelpArticleResult, type UseHelpCenterOptions, type UseHelpCenterResult, type UseHelpFlowOptions, type UseHelpFlowResult, type UseReleaseOptions, type UseReleaseResult, type UseReleasesOptions, type UseReleasesResult, type UseRoadmapOptions, type UseRoadmapResult, type UseSupportOptions, type UseSupportResult, type UseWishOptions, type UseWishResult, type UseWishesOptions, type UseWishesResult, useComments, useHelpArticle, useHelpCenter, useHelpFlow, useRelease, useReleases, useRoadmap, useSupport, useWish, useWishes };
1
+ export { U as UseCommentsOptions, s as UseCommentsResult, t as UseContactFormOptions, u as UseContactFormResult, v as UseContactFormSubmitOptions, w as UseContactFormSubmitResult, x as UseHelpArticleOptions, y as UseHelpArticleResult, z as UseHelpCenterOptions, A as UseHelpCenterResult, B as UseHelpFlowOptions, D as UseHelpFlowResult, E as UseReleaseOptions, F as UseReleaseResult, G as UseReleasesOptions, H as UseReleasesResult, I as UseRoadmapOptions, J as UseRoadmapResult, K as UseStatusOptions, L as UseStatusResult, M as UseSupportOptions, N as UseSupportResult, O as UseSurveyOptions, P as UseSurveyResult, Q as UseSurveySubmitOptions, R as UseSurveySubmitResult, T as UseWishOptions, V as UseWishResult, W as UseWishesOptions, X as UseWishesResult, Y as useComments, Z as useContactForm, _ as useContactFormSubmit, $ as useHelpArticle, a0 as useHelpCenter, a1 as useHelpFlow, a2 as useRelease, a3 as useReleases, a4 as useRoadmap, a5 as useStatus, a6 as useSupport, a7 as useSurvey, a8 as useSurveySubmit, a9 as useWish, aa as useWishes } from '../index-X95JANOa.mjs';
2
+ export { U as UseVoteOptions, L as UseVoteResult, Q as useVote } from '../StatusBoard-DhKRu-An.mjs';
3
+ import 'react';