@carlonicora/nextjs-jsonapi 1.3.1 → 1.5.0
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/README.md +208 -127
- package/dist/AuthComponent-B_Ps2Vb9.d.ts +78 -0
- package/dist/AuthComponent-CxnGgvoh.d.mts +78 -0
- package/dist/{BlockNoteEditor-V625C23O.mjs → BlockNoteEditor-AIEEQM6A.mjs} +4 -6
- package/dist/{BlockNoteEditor-V625C23O.mjs.map → BlockNoteEditor-AIEEQM6A.mjs.map} +1 -1
- package/dist/{BlockNoteEditor-7WYPN34K.js → BlockNoteEditor-G6AK2NWA.js} +8 -10
- package/dist/BlockNoteEditor-G6AK2NWA.js.map +1 -0
- package/dist/chunk-3UELCPIN.js +46 -0
- package/dist/chunk-3UELCPIN.js.map +1 -0
- package/dist/{chunk-5QC7A6BL.mjs → chunk-J7YDGYSW.mjs} +2668 -1319
- package/dist/chunk-J7YDGYSW.mjs.map +1 -0
- package/dist/chunk-SZZYEG3P.mjs +46 -0
- package/dist/chunk-SZZYEG3P.mjs.map +1 -0
- package/dist/{chunk-K2ANOT66.js → chunk-VET55IZO.js} +1869 -520
- package/dist/chunk-VET55IZO.js.map +1 -0
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +3 -4
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +2 -3
- package/dist/components/index.d.mts +6 -69
- package/dist/components/index.d.ts +6 -69
- package/dist/components/index.js +3 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +2 -3
- package/dist/{content.interface-C_PGZMuy.d.ts → content.interface-CR2aBeAW.d.ts} +1 -1
- package/dist/{content.interface-D_WS6CrB.d.mts → content.interface-FpLfsaRm.d.mts} +1 -1
- package/dist/contexts/index.d.mts +3 -3
- package/dist/contexts/index.d.ts +3 -3
- package/dist/contexts/index.js +3 -4
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +2 -3
- package/dist/features/index.d.mts +50 -49
- package/dist/features/index.d.ts +50 -49
- package/dist/features/index.js +24 -3
- package/dist/features/index.js.map +1 -1
- package/dist/features/index.mjs +23 -2
- package/dist/hooks/index.d.mts +3 -3
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.js +3 -4
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +2 -3
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{notification.interface-BBgMUdLR.d.mts → notification.interface-B2BrLoDA.d.mts} +1 -1
- package/dist/{notification.interface-gyvT-Z2F.d.ts → notification.interface-DlZLnAfg.d.ts} +1 -1
- package/dist/roles/index.d.mts +7 -1
- package/dist/roles/index.d.ts +7 -1
- package/dist/roles/index.js +8 -2
- package/dist/roles/index.js.map +1 -1
- package/dist/roles/index.mjs +7 -1
- package/dist/scripts/generate-web-module/generator.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/generator.js +8 -5
- package/dist/scripts/generate-web-module/generator.js.map +1 -1
- package/dist/scripts/generate-web-module/index.js +1 -1
- package/dist/scripts/generate-web-module/index.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/editor.template.js +8 -1
- package/dist/scripts/generate-web-module/templates/components/editor.template.js.map +1 -1
- package/dist/scripts/generate-web-module/transformers/parent-detector.d.ts +4 -3
- package/dist/scripts/generate-web-module/transformers/parent-detector.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/transformers/parent-detector.js +9 -3
- package/dist/scripts/generate-web-module/transformers/parent-detector.js.map +1 -1
- package/dist/scripts/generate-web-module/transformers/relationship-resolver.d.ts +11 -0
- package/dist/scripts/generate-web-module/transformers/relationship-resolver.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/transformers/relationship-resolver.js +36 -9
- package/dist/scripts/generate-web-module/transformers/relationship-resolver.js.map +1 -1
- package/dist/scripts/generate-web-module/types/json-schema.interface.d.ts +2 -0
- package/dist/scripts/generate-web-module/types/json-schema.interface.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/types/template-data.interface.d.ts +1 -0
- package/dist/scripts/generate-web-module/types/template-data.interface.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/utils/i18n-updater.d.ts +4 -3
- package/dist/scripts/generate-web-module/utils/i18n-updater.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/utils/i18n-updater.js +9 -9
- package/dist/scripts/generate-web-module/utils/i18n-updater.js.map +1 -1
- package/dist/scripts/generate-web-module/validators/json-schema-validator.js +3 -3
- package/dist/scripts/generate-web-module/validators/json-schema-validator.js.map +1 -1
- package/dist/{useSocket-DzMKRKCA.d.ts → useSocket-BV6yMdWS.d.ts} +1 -1
- package/dist/{useSocket-Cn7fB_B1.d.mts → useSocket-L-An7_Mr.d.mts} +1 -1
- package/dist/{user.interface-CAsTIbuQ.d.mts → user.interface-CooB1R79.d.mts} +13 -13
- package/dist/{user.interface-CbWqMaaU.d.ts → user.interface-KnIT9pVY.d.ts} +13 -13
- package/package.json +1 -1
- package/scripts/generate-web-module/generator.ts +8 -5
- package/scripts/generate-web-module/index.ts +1 -1
- package/scripts/generate-web-module/templates/components/editor.template.ts +7 -2
- package/scripts/generate-web-module/transformers/parent-detector.ts +10 -3
- package/scripts/generate-web-module/transformers/relationship-resolver.ts +36 -9
- package/scripts/generate-web-module/types/json-schema.interface.ts +2 -0
- package/scripts/generate-web-module/types/template-data.interface.ts +1 -0
- package/scripts/generate-web-module/utils/i18n-updater.ts +9 -9
- package/scripts/generate-web-module/validators/json-schema-validator.ts +3 -3
- package/src/features/auth/components/details/LandingComponent.tsx +27 -29
- package/src/features/user/index.ts +1 -0
- package/src/roles/config.ts +15 -0
- package/src/roles/index.ts +9 -1
- package/dist/AuthComponent-hxOPs9o8.d.mts +0 -11
- package/dist/AuthComponent-hxOPs9o8.d.ts +0 -11
- package/dist/BlockNoteEditor-7WYPN34K.js.map +0 -1
- package/dist/chunk-4HCRAOS5.js +0 -28
- package/dist/chunk-4HCRAOS5.js.map +0 -1
- package/dist/chunk-5QC7A6BL.mjs.map +0 -1
- package/dist/chunk-BLWVZK6J.mjs +0 -28
- package/dist/chunk-BLWVZK6J.mjs.map +0 -1
- package/dist/chunk-HTLEKZND.mjs +0 -1375
- package/dist/chunk-HTLEKZND.mjs.map +0 -1
- package/dist/chunk-K2ANOT66.js.map +0 -1
- package/dist/chunk-PO5Q3H5I.js +0 -1375
- package/dist/chunk-PO5Q3H5I.js.map +0 -1
package/README.md
CHANGED
|
@@ -58,24 +58,28 @@ pnpm add @carlonicora/nextjs-jsonapi
|
|
|
58
58
|
If you want to use the package as a git submodule (for development or before npm release):
|
|
59
59
|
|
|
60
60
|
**1. Add the submodule**
|
|
61
|
+
|
|
61
62
|
```bash
|
|
62
63
|
cd /path/to/your-project
|
|
63
64
|
git submodule add https://github.com/carlonicora/nextjs-jsonapi packages/nextjs-jsonapi
|
|
64
65
|
```
|
|
65
66
|
|
|
66
67
|
**2. Verify it worked**
|
|
68
|
+
|
|
67
69
|
```bash
|
|
68
70
|
git submodule status
|
|
69
71
|
# Should show: <commit-sha> packages/nextjs-jsonapi (heads/master)
|
|
70
72
|
```
|
|
71
73
|
|
|
72
74
|
**3. Commit the submodule**
|
|
75
|
+
|
|
73
76
|
```bash
|
|
74
77
|
git add .gitmodules packages/nextjs-jsonapi
|
|
75
78
|
git commit -m "Add nextjs-jsonapi as submodule"
|
|
76
79
|
```
|
|
77
80
|
|
|
78
81
|
**4. Update your `package.json`** (e.g., `apps/web/package.json`)
|
|
82
|
+
|
|
79
83
|
```json
|
|
80
84
|
{
|
|
81
85
|
"dependencies": {
|
|
@@ -85,6 +89,7 @@ git commit -m "Add nextjs-jsonapi as submodule"
|
|
|
85
89
|
```
|
|
86
90
|
|
|
87
91
|
**5. Ensure `pnpm-workspace.yaml` includes packages**
|
|
92
|
+
|
|
88
93
|
```yaml
|
|
89
94
|
packages:
|
|
90
95
|
- "apps/*"
|
|
@@ -92,12 +97,14 @@ packages:
|
|
|
92
97
|
```
|
|
93
98
|
|
|
94
99
|
**6. Install and build**
|
|
100
|
+
|
|
95
101
|
```bash
|
|
96
102
|
pnpm install
|
|
97
103
|
cd packages/nextjs-jsonapi && pnpm build && cd ../..
|
|
98
104
|
```
|
|
99
105
|
|
|
100
106
|
**For CI/CD (GitHub Actions)**, add `submodules: recursive` to your checkout step:
|
|
107
|
+
|
|
101
108
|
```yaml
|
|
102
109
|
- uses: actions/checkout@v4
|
|
103
110
|
with:
|
|
@@ -105,6 +112,7 @@ cd packages/nextjs-jsonapi && pnpm build && cd ../..
|
|
|
105
112
|
```
|
|
106
113
|
|
|
107
114
|
**Cloning a project with submodules:**
|
|
115
|
+
|
|
108
116
|
```bash
|
|
109
117
|
# When cloning fresh
|
|
110
118
|
git clone --recurse-submodules https://github.com/your/repo.git
|
|
@@ -115,12 +123,12 @@ git submodule update --init --recursive
|
|
|
115
123
|
|
|
116
124
|
### Peer Dependencies
|
|
117
125
|
|
|
118
|
-
| Package | Version
|
|
119
|
-
| ----------------- |
|
|
120
|
-
| `next` | >=14.0.0
|
|
121
|
-
| `react` | >=18.0.0
|
|
122
|
-
| `react-dom` | >=18.0.0
|
|
123
|
-
| `react-hook-form` | >=7.0.0
|
|
126
|
+
| Package | Version | Required | Purpose |
|
|
127
|
+
| ----------------- | -------- | -------- | ----------------------------------- |
|
|
128
|
+
| `next` | >=14.0.0 | Yes | Next.js framework |
|
|
129
|
+
| `react` | >=18.0.0 | Yes | React library |
|
|
130
|
+
| `react-dom` | >=18.0.0 | Yes | React DOM |
|
|
131
|
+
| `react-hook-form` | >=7.0.0 | Optional | Form handling (for form components) |
|
|
124
132
|
|
|
125
133
|
## Quick Start
|
|
126
134
|
|
|
@@ -319,9 +327,9 @@ import {
|
|
|
319
327
|
JsonApiDataFactory,
|
|
320
328
|
|
|
321
329
|
// Registries
|
|
322
|
-
ModuleRegistry,
|
|
323
|
-
DataClassRegistry,
|
|
324
|
-
Modules,
|
|
330
|
+
ModuleRegistry, // Register modules during bootstrap
|
|
331
|
+
DataClassRegistry, // Register model classes for JSON:API translation
|
|
332
|
+
Modules, // Access registered modules (e.g., Modules.Article)
|
|
325
333
|
|
|
326
334
|
// Endpoint builder
|
|
327
335
|
EndpointBuilder,
|
|
@@ -360,11 +368,7 @@ import {
|
|
|
360
368
|
Server-side request utilities:
|
|
361
369
|
|
|
362
370
|
```typescript
|
|
363
|
-
import {
|
|
364
|
-
serverRequest,
|
|
365
|
-
getServerToken,
|
|
366
|
-
getCacheProfile,
|
|
367
|
-
} from "@carlonicora/nextjs-jsonapi/server";
|
|
371
|
+
import { serverRequest, getServerToken, getCacheProfile } from "@carlonicora/nextjs-jsonapi/server";
|
|
368
372
|
```
|
|
369
373
|
|
|
370
374
|
### Permissions (`/permissions`)
|
|
@@ -387,11 +391,11 @@ Built-in feature modules that can be used directly in your application:
|
|
|
387
391
|
```typescript
|
|
388
392
|
import {
|
|
389
393
|
// S3 Module (for file uploads via pre-signed URLs)
|
|
390
|
-
S3Module,
|
|
391
|
-
S3Service,
|
|
392
|
-
S3,
|
|
393
|
-
type S3Interface,
|
|
394
|
-
type S3Input,
|
|
394
|
+
S3Module, // Module definition factory
|
|
395
|
+
S3Service, // Service with getPreSignedUrl, getSignedUrl, deleteFile
|
|
396
|
+
S3, // Data class
|
|
397
|
+
type S3Interface, // Response interface
|
|
398
|
+
type S3Input, // Input parameters
|
|
395
399
|
} from "@carlonicora/nextjs-jsonapi/features";
|
|
396
400
|
|
|
397
401
|
// Usage example:
|
|
@@ -414,11 +418,11 @@ Utility functions:
|
|
|
414
418
|
|
|
415
419
|
```typescript
|
|
416
420
|
import {
|
|
417
|
-
cn,
|
|
418
|
-
composeRefs,
|
|
419
|
-
useComposedRefs,
|
|
420
|
-
useIsMobile,
|
|
421
|
-
type ClassValue,
|
|
421
|
+
cn, // Class name merger (clsx + tailwind-merge)
|
|
422
|
+
composeRefs, // Compose multiple refs
|
|
423
|
+
useComposedRefs, // Hook for composing refs
|
|
424
|
+
useIsMobile, // Mobile detection hook
|
|
425
|
+
type ClassValue, // Type for cn function
|
|
422
426
|
} from "@carlonicora/nextjs-jsonapi/utils";
|
|
423
427
|
```
|
|
424
428
|
|
|
@@ -429,51 +433,128 @@ All shadcn/ui components (requires `"use client"`):
|
|
|
429
433
|
```typescript
|
|
430
434
|
import {
|
|
431
435
|
// UI Components (41)
|
|
432
|
-
Accordion,
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
436
|
+
Accordion,
|
|
437
|
+
AccordionItem,
|
|
438
|
+
AccordionTrigger,
|
|
439
|
+
AccordionContent,
|
|
440
|
+
Alert,
|
|
441
|
+
AlertTitle,
|
|
442
|
+
AlertDescription,
|
|
443
|
+
AlertDialog,
|
|
444
|
+
AlertDialogTrigger,
|
|
445
|
+
AlertDialogContent /* ... */,
|
|
446
|
+
Avatar,
|
|
447
|
+
AvatarImage,
|
|
448
|
+
AvatarFallback,
|
|
449
|
+
Badge,
|
|
450
|
+
badgeVariants,
|
|
451
|
+
Breadcrumb,
|
|
452
|
+
BreadcrumbList,
|
|
453
|
+
BreadcrumbItem /* ... */,
|
|
454
|
+
Button,
|
|
455
|
+
buttonVariants,
|
|
439
456
|
Calendar,
|
|
440
|
-
Card,
|
|
441
|
-
|
|
442
|
-
|
|
457
|
+
Card,
|
|
458
|
+
CardHeader,
|
|
459
|
+
CardTitle,
|
|
460
|
+
CardDescription,
|
|
461
|
+
CardContent,
|
|
462
|
+
CardFooter,
|
|
463
|
+
Carousel,
|
|
464
|
+
CarouselContent,
|
|
465
|
+
CarouselItem,
|
|
466
|
+
CarouselPrevious,
|
|
467
|
+
CarouselNext,
|
|
468
|
+
ChartContainer,
|
|
469
|
+
ChartTooltip,
|
|
470
|
+
ChartTooltipContent,
|
|
471
|
+
ChartLegend /* ... */,
|
|
443
472
|
Checkbox,
|
|
444
|
-
Collapsible,
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
473
|
+
Collapsible,
|
|
474
|
+
CollapsibleTrigger,
|
|
475
|
+
CollapsibleContent,
|
|
476
|
+
Command,
|
|
477
|
+
CommandInput,
|
|
478
|
+
CommandList,
|
|
479
|
+
CommandItem /* ... */,
|
|
480
|
+
ContextMenu,
|
|
481
|
+
ContextMenuTrigger,
|
|
482
|
+
ContextMenuContent /* ... */,
|
|
483
|
+
Dialog,
|
|
484
|
+
DialogTrigger,
|
|
485
|
+
DialogContent,
|
|
486
|
+
DialogHeader /* ... */,
|
|
487
|
+
Drawer,
|
|
488
|
+
DrawerTrigger,
|
|
489
|
+
DrawerContent /* ... */,
|
|
490
|
+
DropdownMenu,
|
|
491
|
+
DropdownMenuTrigger,
|
|
492
|
+
DropdownMenuContent /* ... */,
|
|
493
|
+
Form,
|
|
494
|
+
FormField,
|
|
495
|
+
FormItem,
|
|
496
|
+
FormLabel,
|
|
497
|
+
FormControl /* ... */,
|
|
498
|
+
HoverCard,
|
|
499
|
+
HoverCardTrigger,
|
|
500
|
+
HoverCardContent,
|
|
452
501
|
Input,
|
|
453
502
|
Label,
|
|
454
|
-
NavigationMenu,
|
|
455
|
-
|
|
503
|
+
NavigationMenu,
|
|
504
|
+
NavigationMenuList,
|
|
505
|
+
NavigationMenuItem /* ... */,
|
|
506
|
+
Popover,
|
|
507
|
+
PopoverTrigger,
|
|
508
|
+
PopoverContent,
|
|
456
509
|
Progress,
|
|
457
|
-
RadioGroup,
|
|
458
|
-
|
|
459
|
-
|
|
510
|
+
RadioGroup,
|
|
511
|
+
RadioGroupItem,
|
|
512
|
+
ScrollArea,
|
|
513
|
+
ScrollBar,
|
|
514
|
+
Select,
|
|
515
|
+
SelectTrigger,
|
|
516
|
+
SelectValue,
|
|
517
|
+
SelectContent,
|
|
518
|
+
SelectItem /* ... */,
|
|
460
519
|
Separator,
|
|
461
|
-
Sheet,
|
|
462
|
-
|
|
520
|
+
Sheet,
|
|
521
|
+
SheetTrigger,
|
|
522
|
+
SheetContent,
|
|
523
|
+
SheetHeader /* ... */,
|
|
524
|
+
Sidebar,
|
|
525
|
+
SidebarProvider,
|
|
526
|
+
SidebarContent,
|
|
527
|
+
SidebarMenu /* ... */,
|
|
463
528
|
Skeleton,
|
|
464
529
|
Slider,
|
|
465
|
-
Sonner,
|
|
530
|
+
Sonner,
|
|
531
|
+
Toaster,
|
|
532
|
+
toast,
|
|
466
533
|
Switch,
|
|
467
|
-
Table,
|
|
468
|
-
|
|
534
|
+
Table,
|
|
535
|
+
TableHeader,
|
|
536
|
+
TableBody,
|
|
537
|
+
TableRow,
|
|
538
|
+
TableHead,
|
|
539
|
+
TableCell /* ... */,
|
|
540
|
+
Tabs,
|
|
541
|
+
TabsList,
|
|
542
|
+
TabsTrigger,
|
|
543
|
+
TabsContent,
|
|
469
544
|
Textarea,
|
|
470
|
-
Toggle,
|
|
471
|
-
|
|
545
|
+
Toggle,
|
|
546
|
+
toggleVariants,
|
|
547
|
+
Tooltip,
|
|
548
|
+
TooltipTrigger,
|
|
549
|
+
TooltipContent,
|
|
550
|
+
TooltipProvider,
|
|
472
551
|
|
|
473
552
|
// Custom Components (3)
|
|
474
|
-
Kanban,
|
|
475
|
-
|
|
476
|
-
|
|
553
|
+
Kanban,
|
|
554
|
+
KanbanColumn,
|
|
555
|
+
KanbanItem, // Drag-and-drop Kanban board
|
|
556
|
+
Link, // next-intl compatible Link
|
|
557
|
+
MultiSelect, // Multi-select dropdown
|
|
477
558
|
} from "@carlonicora/nextjs-jsonapi/shadcnui";
|
|
478
559
|
```
|
|
479
560
|
|
|
@@ -487,14 +568,14 @@ Fetch data from a JSON:API endpoint:
|
|
|
487
568
|
|
|
488
569
|
```typescript
|
|
489
570
|
const response = await JsonApiGet({
|
|
490
|
-
classKey: Modules.Article,
|
|
491
|
-
endpoint: "/articles/123",
|
|
492
|
-
companyId: "company-uuid",
|
|
493
|
-
language: "en",
|
|
571
|
+
classKey: Modules.Article, // Module definition
|
|
572
|
+
endpoint: "/articles/123", // API endpoint
|
|
573
|
+
companyId: "company-uuid", // Optional: for multi-tenant apps
|
|
574
|
+
language: "en", // Required: for i18n
|
|
494
575
|
});
|
|
495
576
|
|
|
496
577
|
if (response.ok) {
|
|
497
|
-
console.log(response.data);
|
|
578
|
+
console.log(response.data); // Deserialized data
|
|
498
579
|
console.log(response.pagination); // Pagination info
|
|
499
580
|
|
|
500
581
|
// Navigate pages
|
|
@@ -516,9 +597,9 @@ const response = await JsonApiPost({
|
|
|
516
597
|
language: "en",
|
|
517
598
|
|
|
518
599
|
// Optional
|
|
519
|
-
files: { attachment: file },
|
|
520
|
-
overridesJsonApiCreation: false,
|
|
521
|
-
responseType: Modules.OtherType,
|
|
600
|
+
files: { attachment: file }, // File uploads
|
|
601
|
+
overridesJsonApiCreation: false, // Use raw body instead of JSON:API format
|
|
602
|
+
responseType: Modules.OtherType, // If response type differs
|
|
522
603
|
});
|
|
523
604
|
```
|
|
524
605
|
|
|
@@ -555,21 +636,21 @@ Hook for fetching data with automatic refetching:
|
|
|
555
636
|
|
|
556
637
|
```typescript
|
|
557
638
|
const {
|
|
558
|
-
data,
|
|
559
|
-
loading,
|
|
560
|
-
error,
|
|
561
|
-
response,
|
|
562
|
-
refetch,
|
|
563
|
-
hasNextPage,
|
|
564
|
-
hasPreviousPage,
|
|
565
|
-
fetchNextPage,
|
|
639
|
+
data, // Fetched data or null
|
|
640
|
+
loading, // Loading state
|
|
641
|
+
error, // Error message or null
|
|
642
|
+
response, // Full API response
|
|
643
|
+
refetch, // Manual refetch function
|
|
644
|
+
hasNextPage, // Pagination: has next page
|
|
645
|
+
hasPreviousPage, // Pagination: has previous page
|
|
646
|
+
fetchNextPage, // Fetch next page
|
|
566
647
|
fetchPreviousPage, // Fetch previous page
|
|
567
648
|
} = useJsonApiGet<Article>({
|
|
568
649
|
classKey: Modules.Article,
|
|
569
650
|
endpoint: `/articles/${id}`,
|
|
570
651
|
companyId: companyId,
|
|
571
652
|
options: {
|
|
572
|
-
enabled: !!id,
|
|
653
|
+
enabled: !!id, // Conditionally enable
|
|
573
654
|
deps: [someDependency], // Refetch when these change
|
|
574
655
|
},
|
|
575
656
|
});
|
|
@@ -581,12 +662,12 @@ Hook for mutations (POST, PUT, PATCH, DELETE):
|
|
|
581
662
|
|
|
582
663
|
```typescript
|
|
583
664
|
const {
|
|
584
|
-
data,
|
|
585
|
-
loading,
|
|
586
|
-
error,
|
|
587
|
-
response,
|
|
588
|
-
mutate,
|
|
589
|
-
reset,
|
|
665
|
+
data, // Result data or null
|
|
666
|
+
loading, // Loading state
|
|
667
|
+
error, // Error message or null
|
|
668
|
+
response, // Full API response
|
|
669
|
+
mutate, // Execute the mutation
|
|
670
|
+
reset, // Reset state
|
|
590
671
|
} = useJsonApiMutation<Article>({
|
|
591
672
|
method: "POST",
|
|
592
673
|
classKey: Modules.Article,
|
|
@@ -669,56 +750,56 @@ The package includes 44 pre-built shadcn/ui components:
|
|
|
669
750
|
|
|
670
751
|
### Standard UI Components (41)
|
|
671
752
|
|
|
672
|
-
| Component
|
|
673
|
-
|
|
674
|
-
| `Accordion`
|
|
675
|
-
| `Alert`
|
|
676
|
-
| `AlertDialog`
|
|
677
|
-
| `Avatar`
|
|
678
|
-
| `Badge`
|
|
679
|
-
| `Breadcrumb`
|
|
680
|
-
| `Button`
|
|
681
|
-
| `Calendar`
|
|
682
|
-
| `Card`
|
|
683
|
-
| `Carousel`
|
|
684
|
-
| `Chart`
|
|
685
|
-
| `Checkbox`
|
|
686
|
-
| `Collapsible`
|
|
687
|
-
| `Command`
|
|
688
|
-
| `ContextMenu`
|
|
689
|
-
| `Dialog`
|
|
690
|
-
| `Drawer`
|
|
691
|
-
| `DropdownMenu`
|
|
692
|
-
| `Form`
|
|
693
|
-
| `HoverCard`
|
|
694
|
-
| `Input`
|
|
695
|
-
| `Label`
|
|
696
|
-
| `NavigationMenu` | Navigation menus
|
|
697
|
-
| `Popover`
|
|
698
|
-
| `Progress`
|
|
699
|
-
| `RadioGroup`
|
|
700
|
-
| `ScrollArea`
|
|
701
|
-
| `Select`
|
|
702
|
-
| `Separator`
|
|
703
|
-
| `Sheet`
|
|
704
|
-
| `Sidebar`
|
|
705
|
-
| `Skeleton`
|
|
706
|
-
| `Slider`
|
|
707
|
-
| `Sonner`
|
|
708
|
-
| `Switch`
|
|
709
|
-
| `Table`
|
|
710
|
-
| `Tabs`
|
|
711
|
-
| `Textarea`
|
|
712
|
-
| `Toggle`
|
|
713
|
-
| `Tooltip`
|
|
753
|
+
| Component | Description |
|
|
754
|
+
| ---------------- | ------------------------------- |
|
|
755
|
+
| `Accordion` | Collapsible content sections |
|
|
756
|
+
| `Alert` | Callout for important messages |
|
|
757
|
+
| `AlertDialog` | Modal dialog for confirmations |
|
|
758
|
+
| `Avatar` | User profile images |
|
|
759
|
+
| `Badge` | Status indicators and labels |
|
|
760
|
+
| `Breadcrumb` | Navigation breadcrumbs |
|
|
761
|
+
| `Button` | Click actions with variants |
|
|
762
|
+
| `Calendar` | Date picker calendar |
|
|
763
|
+
| `Card` | Content container |
|
|
764
|
+
| `Carousel` | Sliding content panels |
|
|
765
|
+
| `Chart` | Data visualization (Recharts) |
|
|
766
|
+
| `Checkbox` | Toggle options |
|
|
767
|
+
| `Collapsible` | Expandable sections |
|
|
768
|
+
| `Command` | Command palette (cmdk) |
|
|
769
|
+
| `ContextMenu` | Right-click menus |
|
|
770
|
+
| `Dialog` | Modal windows |
|
|
771
|
+
| `Drawer` | Sliding side panels (Vaul) |
|
|
772
|
+
| `DropdownMenu` | Dropdown menus |
|
|
773
|
+
| `Form` | Form handling (react-hook-form) |
|
|
774
|
+
| `HoverCard` | Hover-triggered cards |
|
|
775
|
+
| `Input` | Text input fields |
|
|
776
|
+
| `Label` | Form labels |
|
|
777
|
+
| `NavigationMenu` | Navigation menus |
|
|
778
|
+
| `Popover` | Floating content |
|
|
779
|
+
| `Progress` | Progress indicators |
|
|
780
|
+
| `RadioGroup` | Radio button groups |
|
|
781
|
+
| `ScrollArea` | Custom scrollbars |
|
|
782
|
+
| `Select` | Dropdown selects |
|
|
783
|
+
| `Separator` | Visual dividers |
|
|
784
|
+
| `Sheet` | Side panels |
|
|
785
|
+
| `Sidebar` | Application sidebars |
|
|
786
|
+
| `Skeleton` | Loading placeholders |
|
|
787
|
+
| `Slider` | Range sliders |
|
|
788
|
+
| `Sonner` | Toast notifications |
|
|
789
|
+
| `Switch` | Toggle switches |
|
|
790
|
+
| `Table` | Data tables |
|
|
791
|
+
| `Tabs` | Tabbed interfaces |
|
|
792
|
+
| `Textarea` | Multi-line text input |
|
|
793
|
+
| `Toggle` | Toggle buttons |
|
|
794
|
+
| `Tooltip` | Hover tooltips |
|
|
714
795
|
|
|
715
796
|
### Custom Components (3)
|
|
716
797
|
|
|
717
|
-
| Component
|
|
718
|
-
|
|
719
|
-
| `Kanban`
|
|
720
|
-
| `Link`
|
|
721
|
-
| `MultiSelect` | Multi-select dropdown with badges
|
|
798
|
+
| Component | Description |
|
|
799
|
+
| ------------- | ------------------------------------ |
|
|
800
|
+
| `Kanban` | Drag-and-drop Kanban board (dnd-kit) |
|
|
801
|
+
| `Link` | next-intl compatible link wrapper |
|
|
802
|
+
| `MultiSelect` | Multi-select dropdown with badges |
|
|
722
803
|
|
|
723
804
|
### Usage Example
|
|
724
805
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { R as RoleInterface, U as UserInterface } from './user.interface-KnIT9pVY.js';
|
|
3
|
+
|
|
4
|
+
type AddUserToRoleProps = {
|
|
5
|
+
role: RoleInterface;
|
|
6
|
+
refresh: () => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
declare function AddUserToRole(props: AddUserToRoleProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
type UserAvatarEditorProps = {
|
|
11
|
+
user?: UserInterface;
|
|
12
|
+
file?: File | null;
|
|
13
|
+
setFile: (file: File | null) => void;
|
|
14
|
+
resetImage: boolean;
|
|
15
|
+
setResetImage: (reset: boolean) => void;
|
|
16
|
+
};
|
|
17
|
+
declare function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }: UserAvatarEditorProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
type UserDeleterProps = {
|
|
20
|
+
user: UserInterface;
|
|
21
|
+
companyId?: string;
|
|
22
|
+
onDeleted?: () => void;
|
|
23
|
+
};
|
|
24
|
+
declare function UserDeleter(props: UserDeleterProps): react_jsx_runtime.JSX.Element | null;
|
|
25
|
+
|
|
26
|
+
type UserEditorProps = {
|
|
27
|
+
user?: UserInterface;
|
|
28
|
+
propagateChanges?: (user: UserInterface) => void;
|
|
29
|
+
adminCreated?: boolean;
|
|
30
|
+
trigger?: React.ReactNode;
|
|
31
|
+
onRevalidate?: (path: string) => Promise<void>;
|
|
32
|
+
};
|
|
33
|
+
declare function UserEditor(props: UserEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
34
|
+
|
|
35
|
+
type UserMultiSelectProps = {
|
|
36
|
+
id: string;
|
|
37
|
+
form: any;
|
|
38
|
+
currentUser?: UserInterface;
|
|
39
|
+
label?: string;
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
onChange?: (users?: UserInterface[]) => void;
|
|
42
|
+
maxCount?: number;
|
|
43
|
+
isRequired?: boolean;
|
|
44
|
+
};
|
|
45
|
+
declare function UserMultiSelect({ id, form, currentUser, label, placeholder, onChange, maxCount, isRequired, }: UserMultiSelectProps): react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
type UserReactivatorProps = {
|
|
48
|
+
user: UserInterface;
|
|
49
|
+
propagateChanges: (user: UserInterface) => void;
|
|
50
|
+
};
|
|
51
|
+
declare function UserReactivator(props: UserReactivatorProps): react_jsx_runtime.JSX.Element | null;
|
|
52
|
+
|
|
53
|
+
type UserResentInvitationEmailProps = {
|
|
54
|
+
user: UserInterface;
|
|
55
|
+
};
|
|
56
|
+
declare function UserResentInvitationEmail(props: UserResentInvitationEmailProps): react_jsx_runtime.JSX.Element | null;
|
|
57
|
+
|
|
58
|
+
type UserSelectorProps = {
|
|
59
|
+
id: string;
|
|
60
|
+
form: any;
|
|
61
|
+
label?: string;
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
onChange?: (user?: UserInterface) => void;
|
|
64
|
+
isRequired?: boolean;
|
|
65
|
+
};
|
|
66
|
+
declare function UserSelector({ id, form, label, placeholder, onChange, isRequired }: UserSelectorProps): react_jsx_runtime.JSX.Element;
|
|
67
|
+
|
|
68
|
+
declare enum AuthComponent {
|
|
69
|
+
Login = 0,
|
|
70
|
+
ForgotPassword = 1,
|
|
71
|
+
ResetPassword = 2,
|
|
72
|
+
ActivateAccount = 3,
|
|
73
|
+
AcceptInvitation = 4,
|
|
74
|
+
Register = 5,
|
|
75
|
+
Landing = 6
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { AuthComponent as A, UserAvatarEditor as U, AddUserToRole as a, UserDeleter as b, UserEditor as c, UserMultiSelect as d, UserReactivator as e, UserResentInvitationEmail as f, UserSelector as g };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { R as RoleInterface, U as UserInterface } from './user.interface-CooB1R79.mjs';
|
|
3
|
+
|
|
4
|
+
type AddUserToRoleProps = {
|
|
5
|
+
role: RoleInterface;
|
|
6
|
+
refresh: () => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
declare function AddUserToRole(props: AddUserToRoleProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
type UserAvatarEditorProps = {
|
|
11
|
+
user?: UserInterface;
|
|
12
|
+
file?: File | null;
|
|
13
|
+
setFile: (file: File | null) => void;
|
|
14
|
+
resetImage: boolean;
|
|
15
|
+
setResetImage: (reset: boolean) => void;
|
|
16
|
+
};
|
|
17
|
+
declare function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }: UserAvatarEditorProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
type UserDeleterProps = {
|
|
20
|
+
user: UserInterface;
|
|
21
|
+
companyId?: string;
|
|
22
|
+
onDeleted?: () => void;
|
|
23
|
+
};
|
|
24
|
+
declare function UserDeleter(props: UserDeleterProps): react_jsx_runtime.JSX.Element | null;
|
|
25
|
+
|
|
26
|
+
type UserEditorProps = {
|
|
27
|
+
user?: UserInterface;
|
|
28
|
+
propagateChanges?: (user: UserInterface) => void;
|
|
29
|
+
adminCreated?: boolean;
|
|
30
|
+
trigger?: React.ReactNode;
|
|
31
|
+
onRevalidate?: (path: string) => Promise<void>;
|
|
32
|
+
};
|
|
33
|
+
declare function UserEditor(props: UserEditorProps): react_jsx_runtime.JSX.Element | null;
|
|
34
|
+
|
|
35
|
+
type UserMultiSelectProps = {
|
|
36
|
+
id: string;
|
|
37
|
+
form: any;
|
|
38
|
+
currentUser?: UserInterface;
|
|
39
|
+
label?: string;
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
onChange?: (users?: UserInterface[]) => void;
|
|
42
|
+
maxCount?: number;
|
|
43
|
+
isRequired?: boolean;
|
|
44
|
+
};
|
|
45
|
+
declare function UserMultiSelect({ id, form, currentUser, label, placeholder, onChange, maxCount, isRequired, }: UserMultiSelectProps): react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
type UserReactivatorProps = {
|
|
48
|
+
user: UserInterface;
|
|
49
|
+
propagateChanges: (user: UserInterface) => void;
|
|
50
|
+
};
|
|
51
|
+
declare function UserReactivator(props: UserReactivatorProps): react_jsx_runtime.JSX.Element | null;
|
|
52
|
+
|
|
53
|
+
type UserResentInvitationEmailProps = {
|
|
54
|
+
user: UserInterface;
|
|
55
|
+
};
|
|
56
|
+
declare function UserResentInvitationEmail(props: UserResentInvitationEmailProps): react_jsx_runtime.JSX.Element | null;
|
|
57
|
+
|
|
58
|
+
type UserSelectorProps = {
|
|
59
|
+
id: string;
|
|
60
|
+
form: any;
|
|
61
|
+
label?: string;
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
onChange?: (user?: UserInterface) => void;
|
|
64
|
+
isRequired?: boolean;
|
|
65
|
+
};
|
|
66
|
+
declare function UserSelector({ id, form, label, placeholder, onChange, isRequired }: UserSelectorProps): react_jsx_runtime.JSX.Element;
|
|
67
|
+
|
|
68
|
+
declare enum AuthComponent {
|
|
69
|
+
Login = 0,
|
|
70
|
+
ForgotPassword = 1,
|
|
71
|
+
ResetPassword = 2,
|
|
72
|
+
ActivateAccount = 3,
|
|
73
|
+
AcceptInvitation = 4,
|
|
74
|
+
Register = 5,
|
|
75
|
+
Landing = 6
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { AuthComponent as A, UserAvatarEditor as U, AddUserToRole as a, UserDeleter as b, UserEditor as c, UserMultiSelect as d, UserReactivator as e, UserResentInvitationEmail as f, UserSelector as g };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
+
S3Service,
|
|
3
4
|
errorToast,
|
|
4
5
|
useCurrentUserContext
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J7YDGYSW.mjs";
|
|
6
7
|
import "./chunk-C7C7VY4F.mjs";
|
|
7
8
|
import {
|
|
8
9
|
Button
|
|
@@ -12,13 +13,10 @@ import {
|
|
|
12
13
|
BlockNoteWordDiffRendererUtil,
|
|
13
14
|
cn
|
|
14
15
|
} from "./chunk-JGFWIT2E.mjs";
|
|
15
|
-
import {
|
|
16
|
-
S3Service
|
|
17
|
-
} from "./chunk-HTLEKZND.mjs";
|
|
18
16
|
import "./chunk-AUXK7QSA.mjs";
|
|
19
17
|
import "./chunk-SM63SZCP.mjs";
|
|
20
18
|
import "./chunk-IKBA4AHN.mjs";
|
|
21
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-SZZYEG3P.mjs";
|
|
22
20
|
import "./chunk-Q2N6SQYW.mjs";
|
|
23
21
|
import "./chunk-FMBQZAIP.mjs";
|
|
24
22
|
import "./chunk-RBIVEH2K.mjs";
|
|
@@ -389,4 +387,4 @@ __name(BlockNoteEditor, "BlockNoteEditor");
|
|
|
389
387
|
export {
|
|
390
388
|
BlockNoteEditor as default
|
|
391
389
|
};
|
|
392
|
-
//# sourceMappingURL=BlockNoteEditor-
|
|
390
|
+
//# sourceMappingURL=BlockNoteEditor-AIEEQM6A.mjs.map
|