@lincros-ui/components 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.
- package/README.md +4 -4
- package/dist/index.js +156 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# lincros-ui Components
|
|
2
2
|
|
|
3
3
|
A comprehensive React component library for the Torre Frontend project, built on top of shadcn/ui and Radix UI primitives.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
lincros-ui contains all UI components, hooks, utilities, and styles extracted from the Torre Frontend project. This package is designed to be used as a shared component library across Torre projects.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -228,13 +228,13 @@ To use this package locally before publishing:
|
|
|
228
228
|
|
|
229
229
|
1. **Build the package:**
|
|
230
230
|
```bash
|
|
231
|
-
cd /home/tom/git/
|
|
231
|
+
cd /home/tom/git/lincros-ui
|
|
232
232
|
npm run build
|
|
233
233
|
```
|
|
234
234
|
|
|
235
235
|
2. **Link the package:**
|
|
236
236
|
```bash
|
|
237
|
-
cd /home/tom/git/
|
|
237
|
+
cd /home/tom/git/lincros-ui
|
|
238
238
|
npm link
|
|
239
239
|
```
|
|
240
240
|
|
package/dist/index.js
CHANGED
|
@@ -45,15 +45,15 @@ import { sortableKeyboardCoordinates, SortableContext, verticalListSortingStrate
|
|
|
45
45
|
import { CSS } from '@dnd-kit/utilities';
|
|
46
46
|
import { useQueryClient, useQuery, useMutation } from '@tanstack/react-query';
|
|
47
47
|
import { getAllUsersUseCase, grantUserUnidadePermissionUseCase, grantBulkUserUnidadePermissionsUseCase, removeUserUnidadePermissionUseCase, getUserUnidadesUseCase, getUnidadeUsersUseCase, createUserUseCase, updateUserUseCase, deleteUserUseCase, activateUserUseCase, deactivateUserUseCase, getUserByIdUseCase } from '@/application/use-cases';
|
|
48
|
-
import { AuthContext } from '
|
|
48
|
+
import { AuthContext } from '@/presentation/providers/AuthProvider';
|
|
49
49
|
import { TenantContext } from '@/presentation/contexts/TenantContext';
|
|
50
|
-
import { ROUTE_PATHS } from '
|
|
50
|
+
import { ROUTE_PATHS } from '@/constants/routes';
|
|
51
51
|
import { useLocation, Link, useNavigate, Navigate } from 'react-router-dom';
|
|
52
52
|
import { MenuPermissionLevel, canAccessMenu } from '@/lib/menu-permissions';
|
|
53
53
|
import { tenantService } from '@/services/api/tenant.service';
|
|
54
|
-
import '
|
|
54
|
+
import '@/types/ErrorType';
|
|
55
55
|
import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCenter } from '@dnd-kit/core';
|
|
56
|
-
import { useSSOContext } from '
|
|
56
|
+
import { useSSOContext } from '@/presentation/contexts/SSOContext';
|
|
57
57
|
import { getTenantFromSubdomain } from '@/lib/tenant-utils';
|
|
58
58
|
import { useEditor, EditorContent } from '@tiptap/react';
|
|
59
59
|
import StarterKit from '@tiptap/starter-kit';
|
|
@@ -61,7 +61,6 @@ import Image2 from '@tiptap/extension-image';
|
|
|
61
61
|
import Link3 from '@tiptap/extension-link';
|
|
62
62
|
import DOMPurify from 'dompurify';
|
|
63
63
|
import { toast as toast$1 } from 'sonner';
|
|
64
|
-
import { tenantService as tenantService$1 } from '../../services/api/tenant.service';
|
|
65
64
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
66
65
|
import * as z2 from 'zod';
|
|
67
66
|
import { HttpCredentialRepository } from '@/infrastructure/repositories/HttpCredentialRepository';
|
|
@@ -69,7 +68,7 @@ import { CreateCredentialUseCase } from '@/application/use-cases/credentials/Cre
|
|
|
69
68
|
import { UpdateCredentialUseCase } from '@/application/use-cases/credentials/UpdateCredentialUseCase';
|
|
70
69
|
import { ListCredentialsUseCase } from '@/application/use-cases/credentials/ListCredentialsUseCase';
|
|
71
70
|
import { TestCredentialUseCase } from '@/application/use-cases/credentials/TestCredentialUseCase';
|
|
72
|
-
import { authService } from '
|
|
71
|
+
import { authService } from '@/services/api/auth.service';
|
|
73
72
|
import { useExecutionStore } from '@/presentation/stores/execution.store';
|
|
74
73
|
import { ExecutionStatus } from '@/domain/entities/flow-execution';
|
|
75
74
|
import { useFlowEditorStore } from '@/presentation/stores/flow-editor.store';
|
|
@@ -6364,13 +6363,13 @@ function TenantSelectorLazy({ onTenantSelected, className, disabled }) {
|
|
|
6364
6363
|
setError(null);
|
|
6365
6364
|
let tenants = [];
|
|
6366
6365
|
try {
|
|
6367
|
-
tenants = await tenantService
|
|
6366
|
+
tenants = await tenantService.getAvailableTenants();
|
|
6368
6367
|
} catch {
|
|
6369
6368
|
try {
|
|
6370
|
-
tenants = await tenantService
|
|
6369
|
+
tenants = await tenantService.listTenantsPublic();
|
|
6371
6370
|
} catch {
|
|
6372
6371
|
try {
|
|
6373
|
-
tenants = await tenantService
|
|
6372
|
+
tenants = await tenantService.listTenants();
|
|
6374
6373
|
} catch {
|
|
6375
6374
|
console.warn("Could not load tenants from any endpoint");
|
|
6376
6375
|
tenants = [];
|
|
@@ -27448,6 +27447,153 @@ function useWebhookSubscriptions() {
|
|
|
27448
27447
|
};
|
|
27449
27448
|
}
|
|
27450
27449
|
|
|
27451
|
-
|
|
27450
|
+
// src/types/mcp.types.ts
|
|
27451
|
+
var MCPCategoryToNodeType = {
|
|
27452
|
+
"Communication": "action",
|
|
27453
|
+
"Data": "action",
|
|
27454
|
+
"AI": "ai_agent",
|
|
27455
|
+
"Logic": "condition",
|
|
27456
|
+
"Integration": "action",
|
|
27457
|
+
"Automation": "action",
|
|
27458
|
+
"Trigger": "trigger"
|
|
27459
|
+
};
|
|
27460
|
+
var MCPSubtypeToIcon = {
|
|
27461
|
+
"send_email": "Mail",
|
|
27462
|
+
"send_sms": "MessageSquare",
|
|
27463
|
+
"send_whatsapp": "MessageSquare",
|
|
27464
|
+
"database_query": "Database",
|
|
27465
|
+
"api_request": "Globe",
|
|
27466
|
+
"file_operation": "File",
|
|
27467
|
+
"ai_completion": "Brain",
|
|
27468
|
+
"ai_analysis": "Brain",
|
|
27469
|
+
"conditional": "GitBranch",
|
|
27470
|
+
"loop": "RefreshCw",
|
|
27471
|
+
"webhook": "Globe",
|
|
27472
|
+
"schedule": "Clock",
|
|
27473
|
+
"manual": "Zap"
|
|
27474
|
+
};
|
|
27475
|
+
var WebhookEventMapper = class _WebhookEventMapper {
|
|
27476
|
+
static toDomain(response) {
|
|
27477
|
+
if (!response) {
|
|
27478
|
+
return _WebhookEventMapper.createEmptyEvent();
|
|
27479
|
+
}
|
|
27480
|
+
return {
|
|
27481
|
+
id: response.id || "",
|
|
27482
|
+
eventId: response.event_id || "",
|
|
27483
|
+
type: response.type || WebhookEventType.MESSAGE_RECEIVED,
|
|
27484
|
+
status: response.status || WebhookEventStatus.PENDING,
|
|
27485
|
+
source: response.source || "unknown",
|
|
27486
|
+
payload: response.payload || {},
|
|
27487
|
+
metadata: response.metadata || {},
|
|
27488
|
+
retryCount: response.retry_count || 0,
|
|
27489
|
+
maxRetries: response.max_retries || 3,
|
|
27490
|
+
error: response.error ? {
|
|
27491
|
+
code: response.error.code,
|
|
27492
|
+
message: response.error.message,
|
|
27493
|
+
details: response.error.details,
|
|
27494
|
+
timestamp: new Date(response.error.timestamp)
|
|
27495
|
+
} : void 0,
|
|
27496
|
+
processedAt: response.processed_at ? new Date(response.processed_at) : void 0,
|
|
27497
|
+
createdAt: response.created_at ? new Date(response.created_at) : /* @__PURE__ */ new Date(),
|
|
27498
|
+
updatedAt: response.updated_at ? new Date(response.updated_at) : /* @__PURE__ */ new Date()
|
|
27499
|
+
};
|
|
27500
|
+
}
|
|
27501
|
+
static createEmptyEvent() {
|
|
27502
|
+
return {
|
|
27503
|
+
id: "",
|
|
27504
|
+
eventId: "",
|
|
27505
|
+
type: WebhookEventType.MESSAGE_RECEIVED,
|
|
27506
|
+
status: WebhookEventStatus.PENDING,
|
|
27507
|
+
source: "unknown",
|
|
27508
|
+
payload: {},
|
|
27509
|
+
metadata: {},
|
|
27510
|
+
retryCount: 0,
|
|
27511
|
+
maxRetries: 3,
|
|
27512
|
+
error: void 0,
|
|
27513
|
+
processedAt: void 0,
|
|
27514
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
27515
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
27516
|
+
};
|
|
27517
|
+
}
|
|
27518
|
+
static toResponse(event) {
|
|
27519
|
+
return {
|
|
27520
|
+
id: event.id,
|
|
27521
|
+
event_id: event.eventId,
|
|
27522
|
+
type: event.type,
|
|
27523
|
+
status: event.status,
|
|
27524
|
+
source: event.source,
|
|
27525
|
+
payload: event.payload,
|
|
27526
|
+
metadata: event.metadata,
|
|
27527
|
+
retry_count: event.retryCount,
|
|
27528
|
+
max_retries: event.maxRetries,
|
|
27529
|
+
error: event.error ? {
|
|
27530
|
+
code: event.error.code,
|
|
27531
|
+
message: event.error.message,
|
|
27532
|
+
details: event.error.details,
|
|
27533
|
+
timestamp: event.error.timestamp.toISOString()
|
|
27534
|
+
} : void 0,
|
|
27535
|
+
processed_at: event.processedAt?.toISOString(),
|
|
27536
|
+
created_at: event.createdAt.toISOString(),
|
|
27537
|
+
updated_at: event.updatedAt.toISOString()
|
|
27538
|
+
};
|
|
27539
|
+
}
|
|
27540
|
+
};
|
|
27541
|
+
var WebhookSubscriptionMapper = class {
|
|
27542
|
+
static toDomain(response) {
|
|
27543
|
+
return {
|
|
27544
|
+
id: response.id,
|
|
27545
|
+
url: response.url,
|
|
27546
|
+
events: response.events,
|
|
27547
|
+
active: response.active,
|
|
27548
|
+
secret: response.secret,
|
|
27549
|
+
headers: response.headers,
|
|
27550
|
+
retryPolicy: {
|
|
27551
|
+
maxRetries: response.retry_policy.max_retries,
|
|
27552
|
+
retryDelay: response.retry_policy.retry_delay,
|
|
27553
|
+
backoffMultiplier: response.retry_policy.backoff_multiplier,
|
|
27554
|
+
maxRetryDelay: response.retry_policy.max_retry_delay
|
|
27555
|
+
},
|
|
27556
|
+
createdAt: new Date(response.created_at),
|
|
27557
|
+
updatedAt: new Date(response.updated_at)
|
|
27558
|
+
};
|
|
27559
|
+
}
|
|
27560
|
+
static toResponse(subscription) {
|
|
27561
|
+
return {
|
|
27562
|
+
id: subscription.id,
|
|
27563
|
+
url: subscription.url,
|
|
27564
|
+
events: subscription.events,
|
|
27565
|
+
active: subscription.active,
|
|
27566
|
+
secret: subscription.secret,
|
|
27567
|
+
headers: subscription.headers,
|
|
27568
|
+
retry_policy: {
|
|
27569
|
+
max_retries: subscription.retryPolicy.maxRetries,
|
|
27570
|
+
retry_delay: subscription.retryPolicy.retryDelay,
|
|
27571
|
+
backoff_multiplier: subscription.retryPolicy.backoffMultiplier,
|
|
27572
|
+
max_retry_delay: subscription.retryPolicy.maxRetryDelay
|
|
27573
|
+
},
|
|
27574
|
+
created_at: subscription.createdAt.toISOString(),
|
|
27575
|
+
updated_at: subscription.updatedAt.toISOString()
|
|
27576
|
+
};
|
|
27577
|
+
}
|
|
27578
|
+
};
|
|
27579
|
+
var WebhookMetricsMapper = class {
|
|
27580
|
+
static toDomain(response) {
|
|
27581
|
+
return {
|
|
27582
|
+
total: response.total,
|
|
27583
|
+
success: response.success,
|
|
27584
|
+
failed: response.failed,
|
|
27585
|
+
pending: response.pending,
|
|
27586
|
+
processing: response.processing,
|
|
27587
|
+
retrying: response.retrying,
|
|
27588
|
+
averageProcessingTime: response.average_processing_time,
|
|
27589
|
+
successRate: response.success_rate,
|
|
27590
|
+
failureRate: response.failure_rate,
|
|
27591
|
+
byType: response.by_type,
|
|
27592
|
+
byHour: response.by_hour
|
|
27593
|
+
};
|
|
27594
|
+
}
|
|
27595
|
+
};
|
|
27596
|
+
|
|
27597
|
+
export { AIAgentConfigModal, AIAgentNode, Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionNode, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, BadgeGroup, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BreakpointIndicator, BreakpointsPanel, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CardWithIcon, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, ChatContainer, ChatHeader, ChatInput, ChatLayout, ChatMessages, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CompositeNode, CompositeNodeConfigModal, ConditionNode, ConditionalBreakpointModal, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ControlTowerSidebar, CountBadge, CredentialFormModal, CredentialSelector, CustomEdge, CustomEdgeWithTooltip, CustomSidebarMenuSub, CustomSidebarMenuSubButton, CustomSidebarMenuSubItem, DEFAULT_WEBHOOK_CONFIG, DebugControlPanel, DebugModeToggle, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogMaximizableContent, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EdgeLabel, EnsureTenant, EventInspector, ExecutableNode, ExecuteFlowModal, ExecutionDataNode, ExecutionDataNodeForm, ExecutionHistorySidebar, ExecutionProgress, ExpandableText, FlowEditor, FlowExecutionPanel, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GenericFilterBar, HoverCard, HoverCardContent, HoverCardTrigger, ImportErrorDisplay, ImportFlowFileModal, ImportFlowsModal, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, InputWithLabel, JSONSchemaEditor, Label3 as Label, LoopConfigModal, LoopExecutionMonitor, LoopNode, LoopResultsViewer, MCPCategoryToNodeType, MCPSubtypeToIcon, MCPToolNode, MainLayout, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MergeNode, MessageBubble, MessageHistory, MessageInput, ModelSelector, MotoristaFilters, MotoristaForm, MotoristaStatusBadge, MotoristaTable, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NodeLibraryPanel, NodeOutputViewer, NodePropertiesModal, NotificationBadge, PageHeader, Pagination, PaginationContent, PaginationControls, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, ParameterInput, Popover, PopoverContent, PopoverTrigger, Progress, PromptEditor, PromptTestModal, ProtectedRoute, QRCodeModal, RadioGroup4 as RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RichTextEditor, RichTextRenderer, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SendMessageModal, Separator5 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, SplitConfigModal, SplitNode, StandardPageLayout, StatusBadge, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TenantSelectorLazy, Textarea, Toggle, ToggleGroup, ToggleGroupItem, Tooltip2 as Tooltip, TooltipButton, TooltipContent, TooltipProvider, TooltipTrigger, TriggerNode, TypingIndicator, UnidadeNegocioCombobox, UserCombobox, VariablePicker, WEBHOOK_TEST_EVENTS, WebhookConfigModal, WebhookConfigPanel, WebhookEventCard, WebhookEventMapper, WebhookFlowLink, WebhookLogsViewer, WebhookMetricsChart, WebhookMetricsMapper, WebhookSubscriptionMapper, WebhookTestModal, WebhookTimeline, WebhookTokenManager, WhatsAppHealthMonitor, WhatsAppTriggerConfigModal, WhatsAppTriggerMetricsModal, WhatsAppTriggerNode, WhatsAppTriggerTestModal, badgeVariants, beautifyString, buttonVariants, calculateProcessingTime, capitalizeFirst, cn, formatDate, formatDateTime, formatEventType, formatLocalDate, formatLocalDateTime, formatLocalTime, formatStatus, formatTime, getEventTypeVariant, getMetricColor, getNodeBorderStyles, getNodeIconColor, getNodeIconTextColor, getStatusVariant, getTimelineColor, isValidWebhookPayload, navigationMenuTriggerStyle, sanitizeWebhookUrl, toCamelCase, toSnakeCase, toast, toggleVariants, useAuth, useAuthContext, useEmpresasForSelect, useFlowEditor, useFlows, useFormField, useIsMobile, useMCPNodeValidation, useMCPTools, useMotorista, useMotoristaByCpf, useMotoristaMutations, useMotoristas, useMotoristasbyEmpresa, usePaginatedUsers, usePerfilUsuario, usePerfilUsuarioFilters, usePermissions, usePersistedFilters, useSSO, useSearchMotoristas, useSidebar, useSidebarState, useTenant, useToast, useUnidadesNegocio, useUserById, useUserFilters, useUserUnidades, useUsers, useWebhookEventDetails, useWebhookEventMetrics, useWebhookEvents, useWebhookSubscriptions, useWhatsApp, useWhatsAppConfigs, useWhatsAppHealthMonitor, useWhatsAppQRCode, useWhatsAppTriggerExecutions, useWhatsAppTriggerMetrics, useWhatsAppTriggers, validateUrl };
|
|
27452
27598
|
//# sourceMappingURL=index.js.map
|
|
27453
27599
|
//# sourceMappingURL=index.js.map
|