organify-ui 0.3.2 → 0.3.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/dist/{chunk-GQZMW7XN.js → chunk-Z7OW3K7Y.js} +20 -37
- package/dist/chunk-Z7OW3K7Y.js.map +1 -0
- package/dist/components/chat/index.js +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +69 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunk-GQZMW7XN.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ChatMessages, ChatSidebar, CreateRoomDialog, MOCK_PROJECTS, MOCK_USERS, MentionPopover, MessageBubble, MessageInput, OrganifyChat, RoomManagementPanel, TypingIndicatorMock, generateAutoReplies, getMockMentionOptions, getRoomPermissions, typingIndicator, useChat } from '../../chunk-
|
|
1
|
+
export { ChatMessages, ChatSidebar, CreateRoomDialog, MOCK_PROJECTS, MOCK_USERS, MentionPopover, MessageBubble, MessageInput, OrganifyChat, RoomManagementPanel, TypingIndicatorMock, generateAutoReplies, getMockMentionOptions, getRoomPermissions, typingIndicator, useChat } from '../../chunk-Z7OW3K7Y.js';
|
|
2
2
|
import '../../chunk-VHQZS77G.js';
|
|
3
3
|
import '../../chunk-MZKEDV5W.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -21,7 +21,9 @@ import { Drawer as Drawer$1 } from 'vaul';
|
|
|
21
21
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
22
22
|
import { Command as Command$1 } from 'cmdk';
|
|
23
23
|
import { Toaster as Toaster$1 } from 'sonner';
|
|
24
|
+
export { toast } from 'sonner';
|
|
24
25
|
export { IconProps, OrgAI, OrgActivity, OrgArrowLeft, OrgArrowRight, OrgAttachment, OrgBell, OrgBoard, OrgCalendar, OrgCelebrate, OrgChart, OrgChat, OrgCheck, OrgCheckCircle, OrgChevronDown, OrgChevronLeft, OrgChevronRight, OrgChevronUp, OrgClock, OrgClose, OrgComment, OrgCopy, OrgCreditCard, OrgDeveloper, OrgDiamond, OrgDoor, OrgDownload, OrgEdit, OrgError, OrgExecutive, OrgEye, OrgEyeOff, OrgFile, OrgFilter, OrgFlag, OrgFolder, OrgGauge, OrgGlobe, OrgGrid, OrgHeart, OrgHome, OrgInfo, OrgIntegration, OrgLink, OrgList, OrgLock, OrgLogo, OrgLogout, OrgMail, OrgMention, OrgMenu, OrgMoon, OrgPMO, OrgPause, OrgPlay, OrgPlus, OrgProjectManager, OrgReport, OrgRocket, OrgSearch, OrgSettings, OrgShield, OrgSort, OrgSprint, OrgStakeholder, OrgStar, OrgSun, OrgTag, OrgTarget, OrgTeam, OrgTrash, OrgTutorial, OrgUnlock, OrgUpload, OrgUser, OrgWarning, OrgWave, OrgWordmark, OrgWorkflow, OrgWorkspace, OrgZap } from './icons/index.js';
|
|
26
|
+
export { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
25
27
|
export { Theme, ThemeProvider, ThemeProviderProps, useTheme } from './providers/theme-provider.js';
|
|
26
28
|
export { I18nProvider, I18nProviderProps, Locale, TranslationKey, createTranslator, useI18n } from './i18n/index.js';
|
|
27
29
|
export { b as ChatConfig, c as ChatEvents, d as ChatMention, C as ChatMessage, e as ChatMessages, f as ChatPermissions, g as ChatReaction, h as ChatRoom, i as ChatRoomMember, j as ChatSidebar, k as ChatUser, l as CreateRoomDialog, m as MOCK_PROJECTS, n as MOCK_USERS, o as MemberRole, O as OrganifyChat, r as OrganifyChatProps, R as RoomManagementPanel, s as RoomType, t as RoomVisibility, T as TypingIndicatorMock, u as generateAutoReplies, v as getMockMentionOptions, w as getRoomPermissions, x as typingIndicator, y as useChat } from './chat-mock-data-DST5Tn_H.js';
|
|
@@ -1310,6 +1312,17 @@ declare namespace OrganifyProvider {
|
|
|
1310
1312
|
var displayName: string;
|
|
1311
1313
|
}
|
|
1312
1314
|
|
|
1315
|
+
/** Cache key for the current-user query. */
|
|
1316
|
+
declare const CURRENT_USER_KEY: readonly ["current-user"];
|
|
1317
|
+
interface UseCurrentUserReturn {
|
|
1318
|
+
user: OrganifyUser | null;
|
|
1319
|
+
authToken: string | null;
|
|
1320
|
+
loading: boolean;
|
|
1321
|
+
error: string | null;
|
|
1322
|
+
refetch: () => Promise<void>;
|
|
1323
|
+
}
|
|
1324
|
+
declare function useCurrentUser(): UseCurrentUserReturn;
|
|
1325
|
+
|
|
1313
1326
|
declare function CommentThread({ entityType, entityId, currentUser: currentUserProp, comments: externalComments, onFetch, onAdd, onEdit, onDelete, onReact, maxVisible, className, }: CommentThreadProps): react_jsx_runtime.JSX.Element;
|
|
1314
1327
|
declare namespace CommentThread {
|
|
1315
1328
|
var displayName: string;
|
|
@@ -1399,4 +1412,4 @@ interface InviteMemberDialogProps {
|
|
|
1399
1412
|
}
|
|
1400
1413
|
declare function InviteMemberDialog({ open, onOpenChange, workspaceId: propWorkspaceId, onInvited, }: InviteMemberDialogProps): react_jsx_runtime.JSX.Element;
|
|
1401
1414
|
|
|
1402
|
-
export { Alert, type AlertProps, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, BoardSkeleton, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatSkeleton, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, type Comment, type CommentAuthor, CommentItem, type CommentReaction, CommentThread, type CommentThreadProps, CreateEpicDialog, type CreateEpicDialogProps, CreateProjectDialog, type CreateProjectDialogProps, CreateSprintDialog, type CreateSprintDialogProps, CreateTaskDialog, type CreateTaskDialogProps, CreateWorkspaceDialog, type CreateWorkspaceDialogProps, DashboardSkeleton, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dock, DockButton, type DockEntry, type DockItem, type DockProps, DockSidebar, type DockSidebarProps, 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, DueDateBadge, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, GeometricIcon, type GeometricIconProps, GlassPanel, type GlassPanelProps, type GqlEndpoint, Input, type InputProps, InviteMemberDialog, type InviteMemberDialogProps, KanbanBoard, type KanbanBoardProps, Column as KanbanColumn, type KanbanColumnData, type KanbanTask, TaskCard as KanbanTaskCard, Label, Logo, type LogoProps, MemberListSkeleton, MetricCard, type MetricCardProps, MetricCardSkeleton, OrgLoader, OrgLoaderInline, type OrgLoaderProps, type OrganifyApiConfig, OrganifyContext, type OrganifyContextValue, type OrganifyProject, OrganifyProvider, type OrganifyProviderProps, type OrganifyUser, type OrganifyWorkspace, PlanBadge, type PlanBadgeProps, type PlanLimit, type PlanTier, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, type ProgressProps, ProjectListSkeleton, ResponsiveDialog, type ResponsiveDialogProps, type RestEndpoint, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingsSkeleton, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SidebarButton, SidebarEntry, type SidebarNavEntry, type SidebarNavItem, Skeleton, SkeletonCard, type SkeletonProps, SprintSkeleton, StatusPill, type StatusPillProps, StepCircle, StepConnector, type StepStatus, Stepper, type StepperProps, type StepperStep, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, type TaskAssignee, TaskCard$1 as TaskCard, type TaskCardData, type TaskCardProps$1 as TaskCardProps, TaskCardSkeleton, type TaskDetailData, TaskDetailDialog, type TaskDetailDialogProps, TaskDetailPanel, type TaskDetailPanelProps, TaskDetailSheet, type TaskDetailSheetProps, type TaskLabel, TaskListSkeleton, type TaskPriority, type TaskStatus, type TaskSubtask, Textarea, Toast, ToastProgress, type ToastProps, Toaster, type ToasterProps, Toggle, type ToggleProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserAvatar, type UserAvatarProps, WorkspaceSwitcher, type WorkspaceSwitcherProps, alertVariants, avatarVariants, badgeVariants, buttonVariants, cn, emptyMediaVariants, geometricIconVariants, glassPanelVariants, inputVariants, metricCardVariants, orgLoaderVariants, priorityConfig, statusPillVariants, useMediaQuery, useOrganify, useOrganifyApi, useOrganifyGql, useOrganifyNavigation, useOrganifyProject, useOrganifyRest, useOrganifyUser, useOrganifyWorkspace };
|
|
1415
|
+
export { Alert, type AlertProps, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, BoardSkeleton, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, CURRENT_USER_KEY, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatSkeleton, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, type Comment, type CommentAuthor, CommentItem, type CommentReaction, CommentThread, type CommentThreadProps, CreateEpicDialog, type CreateEpicDialogProps, CreateProjectDialog, type CreateProjectDialogProps, CreateSprintDialog, type CreateSprintDialogProps, CreateTaskDialog, type CreateTaskDialogProps, CreateWorkspaceDialog, type CreateWorkspaceDialogProps, DashboardSkeleton, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dock, DockButton, type DockEntry, type DockItem, type DockProps, DockSidebar, type DockSidebarProps, 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, DueDateBadge, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, GeometricIcon, type GeometricIconProps, GlassPanel, type GlassPanelProps, type GqlEndpoint, Input, type InputProps, InviteMemberDialog, type InviteMemberDialogProps, KanbanBoard, type KanbanBoardProps, Column as KanbanColumn, type KanbanColumnData, type KanbanTask, TaskCard as KanbanTaskCard, Label, Logo, type LogoProps, MemberListSkeleton, MetricCard, type MetricCardProps, MetricCardSkeleton, OrgLoader, OrgLoaderInline, type OrgLoaderProps, type OrganifyApiConfig, OrganifyContext, type OrganifyContextValue, type OrganifyProject, OrganifyProvider, type OrganifyProviderProps, type OrganifyUser, type OrganifyWorkspace, PlanBadge, type PlanBadgeProps, type PlanLimit, type PlanTier, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, type ProgressProps, ProjectListSkeleton, ResponsiveDialog, type ResponsiveDialogProps, type RestEndpoint, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingsSkeleton, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SidebarButton, SidebarEntry, type SidebarNavEntry, type SidebarNavItem, Skeleton, SkeletonCard, type SkeletonProps, SprintSkeleton, StatusPill, type StatusPillProps, StepCircle, StepConnector, type StepStatus, Stepper, type StepperProps, type StepperStep, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, type TaskAssignee, TaskCard$1 as TaskCard, type TaskCardData, type TaskCardProps$1 as TaskCardProps, TaskCardSkeleton, type TaskDetailData, TaskDetailDialog, type TaskDetailDialogProps, TaskDetailPanel, type TaskDetailPanelProps, TaskDetailSheet, type TaskDetailSheetProps, type TaskLabel, TaskListSkeleton, type TaskPriority, type TaskStatus, type TaskSubtask, Textarea, Toast, ToastProgress, type ToastProps, Toaster, type ToasterProps, Toggle, type ToggleProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseCurrentUserReturn, UserAvatar, type UserAvatarProps, WorkspaceSwitcher, type WorkspaceSwitcherProps, alertVariants, avatarVariants, badgeVariants, buttonVariants, cn, emptyMediaVariants, geometricIconVariants, glassPanelVariants, inputVariants, metricCardVariants, orgLoaderVariants, priorityConfig, statusPillVariants, useCurrentUser, useMediaQuery, useOrganify, useOrganifyApi, useOrganifyGql, useOrganifyNavigation, useOrganifyProject, useOrganifyRest, useOrganifyUser, useOrganifyWorkspace };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { I18nProvider, createTranslator, useI18n } from './chunk-FQA33MF4.js';
|
|
2
2
|
export { ThemeProvider, useTheme } from './chunk-RFOKENE3.js';
|
|
3
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, Separator, ResponsiveDialog, Label, Input, Textarea, Button, Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-
|
|
4
|
-
export { Alert, Button, ChatMessages, ChatSidebar, CreateRoomDialog, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Input, Label, MOCK_PROJECTS, MOCK_USERS, OrgLoader, OrgLoaderInline, OrganifyChat, ResponsiveDialog, RoomManagementPanel, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, TypingIndicatorMock, alertVariants, buttonVariants, generateAutoReplies, getMockMentionOptions, getRoomPermissions, inputVariants, orgLoaderVariants, typingIndicator, useChat } from './chunk-
|
|
3
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, Separator, ResponsiveDialog, Label, Input, Textarea, Button, Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-Z7OW3K7Y.js';
|
|
4
|
+
export { Alert, Button, ChatMessages, ChatSidebar, CreateRoomDialog, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Input, Label, MOCK_PROJECTS, MOCK_USERS, OrgLoader, OrgLoaderInline, OrganifyChat, ResponsiveDialog, RoomManagementPanel, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, TypingIndicatorMock, alertVariants, buttonVariants, generateAutoReplies, getMockMentionOptions, getRoomPermissions, inputVariants, orgLoaderVariants, typingIndicator, useChat } from './chunk-Z7OW3K7Y.js';
|
|
5
5
|
import { Popover, PopoverTrigger, PopoverContent } from './chunk-A2H2TBSV.js';
|
|
6
6
|
export { NotificationBell, NotificationItem, NotificationList, OrganifyNotifications, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PresenceAvatarStack, PresenceIndicator, useNotifications, usePresence } from './chunk-A2H2TBSV.js';
|
|
7
7
|
import { cn, Avatar, AvatarImage, AvatarFallback, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, Skeleton, useOrganify, useOrganifyGql, ScrollArea, useOrganifyUser, useOrganifyApi, Badge, useOrganifyWorkspace, useOrganifyNavigation, useOrganifyProject } from './chunk-VHQZS77G.js';
|
|
@@ -21,6 +21,9 @@ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
|
21
21
|
import { Command as Command$1 } from 'cmdk';
|
|
22
22
|
import { Slot } from '@radix-ui/react-slot';
|
|
23
23
|
import { Toaster as Toaster$1 } from 'sonner';
|
|
24
|
+
export { toast } from 'sonner';
|
|
25
|
+
import { useQueryClient, useQuery } from '@tanstack/react-query';
|
|
26
|
+
export { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
24
27
|
|
|
25
28
|
var Toggle = React4.forwardRef(({ className, label, description, ...props }, ref) => {
|
|
26
29
|
const id = React4.useId();
|
|
@@ -1070,7 +1073,7 @@ function WorkspaceSwitcher({ compact = false, onCreateWorkspace, className }) {
|
|
|
1070
1073
|
[workspaces, workspace, gql, onWorkspacesChange, onWorkspaceChange]
|
|
1071
1074
|
);
|
|
1072
1075
|
const displayName = workspace?.name ?? workspace?.slug ?? "\u2026";
|
|
1073
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), ref: dropdownRef, children: [
|
|
1076
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative min-w-0", className), ref: dropdownRef, children: [
|
|
1074
1077
|
/* @__PURE__ */ jsxs(
|
|
1075
1078
|
"button",
|
|
1076
1079
|
{
|
|
@@ -1184,7 +1187,7 @@ function SwitcherDropdown({
|
|
|
1184
1187
|
onEditClick,
|
|
1185
1188
|
onDeleteClick
|
|
1186
1189
|
}) {
|
|
1187
|
-
return /* @__PURE__ */ jsxs("div", { className: "absolute top-full left-0
|
|
1190
|
+
return /* @__PURE__ */ jsxs("div", { className: "absolute top-full left-0 mt-1 w-64 rounded-xl border border-white/20 bg-white/[0.03] backdrop-blur-[40px] shadow-[0_24px_80px_-15px_rgba(0,0,0,0.5)] z-50 overflow-hidden", children: [
|
|
1188
1191
|
/* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-xs font-medium uppercase tracking-wider text-theme-muted border-b border-white/10", children: "Workspaces" }),
|
|
1189
1192
|
/* @__PURE__ */ jsx(ScrollArea, { className: "max-h-64", children: /* @__PURE__ */ jsx("div", { className: "py-1", children: loading ? /* @__PURE__ */ jsx("div", { className: "space-y-1 px-3 py-2", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5 py-2", children: [
|
|
1190
1193
|
/* @__PURE__ */ jsx(Skeleton, { className: "w-7 h-7", variant: "rounded" }),
|
|
@@ -1294,7 +1297,7 @@ function SwitcherItem({
|
|
|
1294
1297
|
] })
|
|
1295
1298
|
] });
|
|
1296
1299
|
const cls = cn(
|
|
1297
|
-
"flex items-center gap-2.5 px-3 py-2 transition-colors hover:bg-theme-subtle",
|
|
1300
|
+
"flex items-center gap-2.5 px-3 py-2 w-full min-w-0 overflow-hidden transition-colors hover:bg-theme-subtle",
|
|
1298
1301
|
isActive && "bg-theme-subtle",
|
|
1299
1302
|
isOptimistic && "pointer-events-none"
|
|
1300
1303
|
);
|
|
@@ -1303,9 +1306,9 @@ function SwitcherItem({
|
|
|
1303
1306
|
onMouseLeave: () => setShowActions(false)
|
|
1304
1307
|
};
|
|
1305
1308
|
if (renderLink) {
|
|
1306
|
-
return /* @__PURE__ */ jsx("div", { ...wrapperProps, children: renderLink({ href: `/${ws.slug}`, children: content, className: cls, onClick: onClose }) });
|
|
1309
|
+
return /* @__PURE__ */ jsx("div", { className: "min-w-0 overflow-hidden", ...wrapperProps, children: renderLink({ href: `/${ws.slug}`, children: content, className: cls, onClick: onClose }) });
|
|
1307
1310
|
}
|
|
1308
|
-
return /* @__PURE__ */ jsx("div", { ...wrapperProps, children: /* @__PURE__ */ jsx("a", { href: `/${ws.slug}`, onClick: onClose, className: cls, children: content }) });
|
|
1311
|
+
return /* @__PURE__ */ jsx("div", { className: "min-w-0 overflow-hidden", ...wrapperProps, children: /* @__PURE__ */ jsx("a", { href: `/${ws.slug}`, onClick: onClose, className: cls, children: content }) });
|
|
1309
1312
|
}
|
|
1310
1313
|
WorkspaceSwitcher.displayName = "WorkspaceSwitcher";
|
|
1311
1314
|
function CreateWorkspaceInlineDialog({
|
|
@@ -7667,6 +7670,63 @@ function Toaster({ ...props }) {
|
|
|
7667
7670
|
}
|
|
7668
7671
|
);
|
|
7669
7672
|
}
|
|
7673
|
+
var CURRENT_USER_KEY = ["current-user"];
|
|
7674
|
+
function readCookieToken() {
|
|
7675
|
+
if (typeof document === "undefined") return null;
|
|
7676
|
+
const match3 = document.cookie.split(";").map((s) => s.trim()).find((s) => s.startsWith("auth_token="));
|
|
7677
|
+
if (!match3) return null;
|
|
7678
|
+
return decodeURIComponent(match3.split("=")[1]);
|
|
7679
|
+
}
|
|
7680
|
+
function readAuthToken() {
|
|
7681
|
+
return readCookieToken() ?? (typeof localStorage !== "undefined" ? localStorage.getItem("organify_access_token") : null);
|
|
7682
|
+
}
|
|
7683
|
+
async function fetchCurrentUser() {
|
|
7684
|
+
const res = await fetch("/api/auth/me", { credentials: "include" });
|
|
7685
|
+
if (!res.ok) {
|
|
7686
|
+
if (res.status === 401) {
|
|
7687
|
+
window.location.href = "/login";
|
|
7688
|
+
throw new Error("UNAUTHENTICATED");
|
|
7689
|
+
}
|
|
7690
|
+
throw new Error(`HTTP ${res.status}`);
|
|
7691
|
+
}
|
|
7692
|
+
const data = await res.json();
|
|
7693
|
+
return {
|
|
7694
|
+
id: String(data.id),
|
|
7695
|
+
name: data.name,
|
|
7696
|
+
email: data.email,
|
|
7697
|
+
avatarUrl: data.avatar ?? null,
|
|
7698
|
+
role: data.role
|
|
7699
|
+
};
|
|
7700
|
+
}
|
|
7701
|
+
function useCurrentUser() {
|
|
7702
|
+
const queryClient = useQueryClient();
|
|
7703
|
+
const { data: user, isLoading, error } = useQuery({
|
|
7704
|
+
queryKey: CURRENT_USER_KEY,
|
|
7705
|
+
queryFn: fetchCurrentUser,
|
|
7706
|
+
staleTime: 5 * 60 * 1e3,
|
|
7707
|
+
// 5 minutes — user data rarely changes
|
|
7708
|
+
gcTime: 10 * 60 * 1e3,
|
|
7709
|
+
// Keep in GC for 10 min
|
|
7710
|
+
retry: (failureCount, err) => {
|
|
7711
|
+
if (err instanceof Error && err.message === "UNAUTHENTICATED") return false;
|
|
7712
|
+
return failureCount < 2;
|
|
7713
|
+
},
|
|
7714
|
+
refetchOnWindowFocus: true,
|
|
7715
|
+
refetchOnMount: false
|
|
7716
|
+
// Use cache if not stale
|
|
7717
|
+
});
|
|
7718
|
+
const authToken = typeof window !== "undefined" ? readAuthToken() : null;
|
|
7719
|
+
const refetch = async () => {
|
|
7720
|
+
await queryClient.invalidateQueries({ queryKey: CURRENT_USER_KEY });
|
|
7721
|
+
};
|
|
7722
|
+
return {
|
|
7723
|
+
user: user ?? null,
|
|
7724
|
+
authToken,
|
|
7725
|
+
loading: isLoading,
|
|
7726
|
+
error: error instanceof Error ? error.message : null,
|
|
7727
|
+
refetch
|
|
7728
|
+
};
|
|
7729
|
+
}
|
|
7670
7730
|
var CREATE_PROJECT_MUTATION = `
|
|
7671
7731
|
mutation CreateProject($input: CreateProjectInput!) {
|
|
7672
7732
|
createProject(input: $input) {
|
|
@@ -7721,7 +7781,7 @@ function CreateProjectDialog({
|
|
|
7721
7781
|
onOpenChange(false);
|
|
7722
7782
|
onCreated?.(data.createProject);
|
|
7723
7783
|
if (!onCreated && navigate) {
|
|
7724
|
-
navigate(
|
|
7784
|
+
navigate(`/${workspace.slug}/projects/${data.createProject.slug}`);
|
|
7725
7785
|
}
|
|
7726
7786
|
} catch (err) {
|
|
7727
7787
|
setError(err.message || "Failed to create project");
|
|
@@ -8417,6 +8477,6 @@ function InviteMemberDialog({
|
|
|
8417
8477
|
);
|
|
8418
8478
|
}
|
|
8419
8479
|
|
|
8420
|
-
export { BoardSkeleton, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatSkeleton, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommentItem, CommentThread, CreateEpicDialog, CreateProjectDialog, CreateSprintDialog, CreateTaskDialog, CreateWorkspaceDialog, DashboardSkeleton, Dock, DockButton, DockSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DueDateBadge, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, GeometricIcon, GlassPanel, InviteMemberDialog, KanbanBoard, Column as KanbanColumn, TaskCard2 as KanbanTaskCard, Logo, MemberListSkeleton, MetricCard, MetricCardSkeleton, PlanBadge, Progress, ProjectListSkeleton, SettingsSkeleton, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SidebarButton, SidebarEntry, SprintSkeleton, StatusPill, StepCircle, StepConnector, Stepper, Switch, TaskCard, TaskCardSkeleton, TaskDetailDialog, TaskDetailPanel, TaskDetailSheet, TaskListSkeleton, Toast, ToastProgress, Toaster, Toggle, UserAvatar, WorkspaceSwitcher, emptyMediaVariants, geometricIconVariants, glassPanelVariants, metricCardVariants, priorityConfig, statusPillVariants, useMediaQuery };
|
|
8480
|
+
export { BoardSkeleton, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, CURRENT_USER_KEY, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatSkeleton, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommentItem, CommentThread, CreateEpicDialog, CreateProjectDialog, CreateSprintDialog, CreateTaskDialog, CreateWorkspaceDialog, DashboardSkeleton, Dock, DockButton, DockSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DueDateBadge, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, GeometricIcon, GlassPanel, InviteMemberDialog, KanbanBoard, Column as KanbanColumn, TaskCard2 as KanbanTaskCard, Logo, MemberListSkeleton, MetricCard, MetricCardSkeleton, PlanBadge, Progress, ProjectListSkeleton, SettingsSkeleton, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SidebarButton, SidebarEntry, SprintSkeleton, StatusPill, StepCircle, StepConnector, Stepper, Switch, TaskCard, TaskCardSkeleton, TaskDetailDialog, TaskDetailPanel, TaskDetailSheet, TaskListSkeleton, Toast, ToastProgress, Toaster, Toggle, UserAvatar, WorkspaceSwitcher, emptyMediaVariants, geometricIconVariants, glassPanelVariants, metricCardVariants, priorityConfig, statusPillVariants, useCurrentUser, useMediaQuery };
|
|
8421
8481
|
//# sourceMappingURL=index.js.map
|
|
8422
8482
|
//# sourceMappingURL=index.js.map
|