@moontra/moonui-pro 2.11.3 → 2.12.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/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { twMerge } from 'tailwind-merge';
3
3
  import * as t from 'react';
4
- import t__default, { useState, useRef, useCallback, forwardRef, createContext, useEffect, useContext, useMemo, useLayoutEffect, useDebugValue, Component } from 'react';
4
+ import t__default, { useState, useRef, useCallback, forwardRef, createContext, useEffect, useMemo, useContext, useLayoutEffect, useDebugValue, Component } from 'react';
5
5
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
6
- import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, Minus, Search, ChevronRight, Circle, ChevronUp, Lock, Sparkles, Plus, Upload, Play, Eye, CheckCircle2, Pause, RotateCcw, Download, Copy, Share, Trash2, CreditCard, Globe, XCircle, Clock, HelpCircle, ChevronLeft, Calendar as Calendar$1, Edit, MapPin, User, GripVertical, MessageCircle, Paperclip, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, Code as Code$1, Type, Heading1, Heading2, Heading3, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, CheckSquare, Quote, Palette, Highlighter, Link2, Image as Image$1, Table as Table$1, Settings, Undo, Redo, RefreshCw, Wand2, Maximize, FileText, Briefcase, MessageSquare, Heart, GraduationCap, Zap, Languages, Lightbulb, TrendingUp, TrendingDown, ZoomOut, ZoomIn, FileSpreadsheet, FileJson, Maximize2, Move, Menu, Bell, CheckCheck, CheckCircle, Settings2, LogOut, Edit3, LayoutGrid, Share2, Save, Video, Music, Archive, File, Filter, FileDown, ArrowUp, ArrowDown, ArrowUpDown, ChevronsLeft, ChevronsRight, Pin, Sun, Moon, Monitor, Star, ExternalLink, CalendarIcon, DollarSign, Users, Github, GitFork, Activity, Server, EyeOff, RotateCw, Timer, Cpu, MemoryStick, HardDrive, Network, BarChart3, Columns, Grip, Unlock, Minimize2, Map as Map$1, Target, MoreVertical, BellOff, ArrowDownRight, ArrowUpRight } from 'lucide-react';
6
+ import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, Minus, Search, ChevronRight, Circle, ChevronUp, Lock, Sparkles, Plus, Upload, Play, Eye, CheckCircle2, Pause, RotateCcw, Download, Copy, Share, Trash2, CreditCard, Globe, XCircle, Clock, HelpCircle, ChevronLeft, Calendar as Calendar$1, Edit, MapPin, User, Filter, Move, Archive, EyeOff, Settings, Timer, Palette, ArrowUpDown, FileText, Star, Square, CheckSquare, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, Code as Code$1, Type, Heading1, Heading2, Heading3, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, Quote, Highlighter, Link2, Image as Image$1, Table as Table$1, Undo, Redo, RefreshCw, Wand2, Maximize, Briefcase, MessageSquare, Heart, GraduationCap, Zap, Languages, Lightbulb, TrendingUp, TrendingDown, ZoomOut, ZoomIn, FileSpreadsheet, FileJson, Maximize2, Menu, Bell, CheckCheck, CheckCircle, Settings2, LogOut, Edit3, LayoutGrid, Share2, Save, Video, Music, File, FileDown, ArrowUp, ArrowDown, ChevronsLeft, ChevronsRight, Pin, Sun, Moon, Monitor, MoreVertical, MessageCircle, Paperclip, ExternalLink, CalendarIcon, DollarSign, Users, Github, GitFork, Activity, Server, RotateCw, Cpu, MemoryStick, HardDrive, Network, BarChart3, Columns, Grip, Unlock, Minimize2, Map as Map$1, Target, BellOff, ArrowDownRight, ArrowUpRight } from 'lucide-react';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import { cva } from 'class-variance-authority';
9
9
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
10
10
  import { format, addMonths, subMonths, startOfMonth, endOfMonth, eachDayOfInterval, getDay, startOfWeek, endOfWeek, isSameMonth, isToday, isSameDay, startOfDay, endOfDay, subDays, formatDistanceToNow } from 'date-fns';
11
- import { motion, AnimatePresence, useMotionValue, useSpring, useTransform, animate } from 'framer-motion';
11
+ import { motion, AnimatePresence, useMotionValue, useSpring, useTransform, animate, useDragControls } from 'framer-motion';
12
12
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
13
13
  import * as ReactDOM from 'react-dom';
14
14
  import ReactDOM__default from 'react-dom';
@@ -1995,9 +1995,19 @@ var MoonUIAvatarFallbackPro = t.forwardRef(({ className, ...props }, ref) => /*
1995
1995
  ));
1996
1996
  MoonUIAvatarFallbackPro.displayName = AvatarPrimitive.Fallback.displayName;
1997
1997
  var MoonUIAvatarGroupPro = t.forwardRef(
1998
- ({ className, limit, avatars, overlapOffset = -8, ...props }, ref) => {
1999
- const visibleAvatars = limit ? avatars.slice(0, limit) : avatars;
2000
- const remainingCount = limit ? Math.max(0, avatars.length - limit) : 0;
1998
+ ({ className, max: max2 = 3, size: size4 = "md", children, overlapOffset, ...props }, ref) => {
1999
+ const childrenArray = t.Children.toArray(children);
2000
+ const visibleChildren = max2 ? childrenArray.slice(0, max2) : childrenArray;
2001
+ const remainingCount = max2 ? Math.max(0, childrenArray.length - max2) : 0;
2002
+ const defaultOffsets = {
2003
+ xs: -4,
2004
+ sm: -6,
2005
+ md: -8,
2006
+ lg: -10,
2007
+ xl: -12,
2008
+ "2xl": -16
2009
+ };
2010
+ const finalOffset = overlapOffset ?? defaultOffsets[size4] ?? -8;
2001
2011
  return /* @__PURE__ */ jsx(
2002
2012
  "div",
2003
2013
  {
@@ -2005,24 +2015,24 @@ var MoonUIAvatarGroupPro = t.forwardRef(
2005
2015
  className: cn("flex items-center", className),
2006
2016
  ...props,
2007
2017
  children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
2008
- visibleAvatars.map((avatar, index2) => /* @__PURE__ */ jsx(
2018
+ visibleChildren.map((child, index2) => /* @__PURE__ */ jsx(
2009
2019
  "div",
2010
2020
  {
2011
- className: "relative",
2021
+ className: "relative ring-2 ring-background rounded-full",
2012
2022
  style: {
2013
- marginLeft: index2 === 0 ? 0 : `${overlapOffset}px`,
2014
- zIndex: visibleAvatars.length - index2
2023
+ marginLeft: index2 === 0 ? 0 : `${finalOffset}px`,
2024
+ zIndex: visibleChildren.length - index2
2015
2025
  },
2016
- children: avatar
2026
+ children: t.isValidElement(child) && child.type === MoonUIAvatarPro ? t.cloneElement(child, { size: size4 }) : child
2017
2027
  },
2018
2028
  index2
2019
2029
  )),
2020
2030
  remainingCount > 0 && /* @__PURE__ */ jsx(
2021
2031
  "div",
2022
2032
  {
2023
- className: "relative z-0",
2024
- style: { marginLeft: `${overlapOffset}px` },
2025
- children: /* @__PURE__ */ jsx(MoonUIAvatarPro, { variant: "border", children: /* @__PURE__ */ jsxs(MoonUIAvatarFallbackPro, { children: [
2033
+ className: "relative z-0 ring-2 ring-background rounded-full",
2034
+ style: { marginLeft: `${finalOffset}px` },
2035
+ children: /* @__PURE__ */ jsx(MoonUIAvatarPro, { size: size4, className: "bg-muted", children: /* @__PURE__ */ jsxs(MoonUIAvatarFallbackPro, { className: "text-xs font-medium", children: [
2026
2036
  "+",
2027
2037
  remainingCount
2028
2038
  ] }) })
@@ -2033,7 +2043,7 @@ var MoonUIAvatarGroupPro = t.forwardRef(
2033
2043
  );
2034
2044
  }
2035
2045
  );
2036
- MoonUIAvatarGroupPro.displayName = "AvatarGroup";
2046
+ MoonUIAvatarGroupPro.displayName = "MoonUIAvatarGroupPro";
2037
2047
  var moonUIBadgeVariantsPro = cva(
2038
2048
  [
2039
2049
  "inline-flex items-center gap-1.5",
@@ -4044,7 +4054,7 @@ var me = t.forwardRef((r2, o) => {
4044
4054
  var e;
4045
4055
  return Array.from(((e = I.current) == null ? void 0 : e.querySelectorAll(ce)) || []);
4046
4056
  }
4047
- function X20(e) {
4057
+ function X21(e) {
4048
4058
  let s = V()[e];
4049
4059
  s && E.setState("value", s.getAttribute(T));
4050
4060
  }
@@ -4059,10 +4069,10 @@ var me = t.forwardRef((r2, o) => {
4059
4069
  s = e > 0 ? we(s, N) : De(s, N), i = s == null ? void 0 : s.querySelector(ce);
4060
4070
  i ? E.setState("value", i.getAttribute(T)) : Q(e);
4061
4071
  }
4062
- let oe = () => X20(V().length - 1), ie3 = (e) => {
4072
+ let oe = () => X21(V().length - 1), ie3 = (e) => {
4063
4073
  e.preventDefault(), e.metaKey ? oe() : e.altKey ? re(1) : Q(1);
4064
4074
  }, se = (e) => {
4065
- e.preventDefault(), e.metaKey ? X20(0) : e.altKey ? re(-1) : Q(-1);
4075
+ e.preventDefault(), e.metaKey ? X21(0) : e.altKey ? re(-1) : Q(-1);
4066
4076
  };
4067
4077
  return t.createElement(Primitive2.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
4068
4078
  var s;
@@ -4089,7 +4099,7 @@ var me = t.forwardRef((r2, o) => {
4089
4099
  break;
4090
4100
  }
4091
4101
  case "Home": {
4092
- e.preventDefault(), X20(0);
4102
+ e.preventDefault(), X21(0);
4093
4103
  break;
4094
4104
  }
4095
4105
  case "End": {
@@ -6512,8 +6522,8 @@ var reducer = (state, action) => {
6512
6522
  if (toastId) {
6513
6523
  addToRemoveQueue(toastId);
6514
6524
  } else {
6515
- state.toasts.forEach((toast2) => {
6516
- addToRemoveQueue(toast2.id);
6525
+ state.toasts.forEach((toast3) => {
6526
+ addToRemoveQueue(toast3.id);
6517
6527
  });
6518
6528
  }
6519
6529
  return {
@@ -11111,24 +11121,284 @@ function Calendar3({
11111
11121
  )
11112
11122
  ] });
11113
11123
  }
11114
- var PRIORITY_DOTS = {
11115
- low: "bg-green-500",
11116
- medium: "bg-yellow-500",
11117
- high: "bg-orange-500",
11118
- urgent: "bg-red-500"
11124
+ var PRIORITY_CONFIG = {
11125
+ low: {
11126
+ color: "bg-green-100 text-green-800 border-green-200",
11127
+ dot: "bg-green-500",
11128
+ icon: ArrowDown
11129
+ },
11130
+ medium: {
11131
+ color: "bg-yellow-100 text-yellow-800 border-yellow-200",
11132
+ dot: "bg-yellow-500",
11133
+ icon: ArrowUp
11134
+ },
11135
+ high: {
11136
+ color: "bg-orange-100 text-orange-800 border-orange-200",
11137
+ dot: "bg-orange-500",
11138
+ icon: Zap
11139
+ },
11140
+ urgent: {
11141
+ color: "bg-red-100 text-red-800 border-red-200",
11142
+ dot: "bg-red-500",
11143
+ icon: AlertCircle
11144
+ }
11145
+ };
11146
+ var COLUMN_TEMPLATES = {
11147
+ todo: { title: "To Do", color: "#6B7280" },
11148
+ inProgress: { title: "In Progress", color: "#3B82F6" },
11149
+ done: { title: "Done", color: "#10B981" }
11150
+ };
11151
+ var formatDate = (date) => {
11152
+ return date.toLocaleDateString("en-US", {
11153
+ month: "short",
11154
+ day: "numeric",
11155
+ year: date.getFullYear() !== (/* @__PURE__ */ new Date()).getFullYear() ? "numeric" : void 0
11156
+ });
11157
+ };
11158
+ var isOverdue = (dueDate) => {
11159
+ return dueDate < /* @__PURE__ */ new Date();
11160
+ };
11161
+ var getInitials = (name) => {
11162
+ return name.split(" ").map((n) => n[0]).join("").toUpperCase();
11163
+ };
11164
+ var useAutoScroll = () => {
11165
+ const scrollRef = useRef(null);
11166
+ const scrollIntervalRef = useRef(null);
11167
+ const startAutoScroll = useCallback((direction) => {
11168
+ if (scrollIntervalRef.current)
11169
+ return;
11170
+ scrollIntervalRef.current = setInterval(() => {
11171
+ if (scrollRef.current) {
11172
+ const scrollAmount = direction === "left" ? -10 : 10;
11173
+ scrollRef.current.scrollLeft += scrollAmount;
11174
+ }
11175
+ }, 20);
11176
+ }, []);
11177
+ const stopAutoScroll = useCallback(() => {
11178
+ if (scrollIntervalRef.current) {
11179
+ clearInterval(scrollIntervalRef.current);
11180
+ scrollIntervalRef.current = null;
11181
+ }
11182
+ }, []);
11183
+ useEffect(() => {
11184
+ return () => stopAutoScroll();
11185
+ }, [stopAutoScroll]);
11186
+ return { scrollRef, startAutoScroll, stopAutoScroll };
11187
+ };
11188
+ var KanbanCardComponent = ({
11189
+ card,
11190
+ isDragging,
11191
+ onEdit,
11192
+ onDelete,
11193
+ onClick,
11194
+ showDetails,
11195
+ disabled
11196
+ }) => {
11197
+ const [isEditingTitle, setIsEditingTitle] = useState(false);
11198
+ const [title, setTitle] = useState(card.title);
11199
+ const dragControls = useDragControls();
11200
+ const completedChecklistItems = card.checklist?.items.filter((item) => item.completed).length || 0;
11201
+ const totalChecklistItems = card.checklist?.items.length || 0;
11202
+ const checklistProgress = totalChecklistItems > 0 ? completedChecklistItems / totalChecklistItems * 100 : 0;
11203
+ return /* @__PURE__ */ jsx(
11204
+ motion.div,
11205
+ {
11206
+ layout: true,
11207
+ initial: { opacity: 0, y: 20 },
11208
+ animate: { opacity: 1, y: 0 },
11209
+ exit: { opacity: 0, y: -20 },
11210
+ whileHover: { scale: 1.02 },
11211
+ whileDrag: { scale: 1.05, rotate: 3 },
11212
+ transition: { duration: 0.2 },
11213
+ className: cn(
11214
+ "relative group cursor-pointer select-none",
11215
+ isDragging && "z-50"
11216
+ ),
11217
+ children: /* @__PURE__ */ jsxs(
11218
+ MoonUICardPro,
11219
+ {
11220
+ className: cn(
11221
+ "border hover:shadow-md transition-all duration-200",
11222
+ isDragging && "shadow-2xl ring-2 ring-primary ring-offset-2",
11223
+ disabled && "cursor-not-allowed opacity-50"
11224
+ ),
11225
+ onClick,
11226
+ children: [
11227
+ /* @__PURE__ */ jsx(
11228
+ "div",
11229
+ {
11230
+ className: "absolute left-0 top-0 bottom-0 w-1 bg-gradient-to-b from-primary/20 to-primary/10 opacity-0 group-hover:opacity-100 transition-opacity cursor-move",
11231
+ onPointerDown: (e) => dragControls.start(e)
11232
+ }
11233
+ ),
11234
+ card.coverImage && /* @__PURE__ */ jsxs("div", { className: "relative h-32 -mx-px -mt-px rounded-t-lg overflow-hidden", children: [
11235
+ /* @__PURE__ */ jsx(
11236
+ "img",
11237
+ {
11238
+ src: card.coverImage,
11239
+ alt: "",
11240
+ className: "w-full h-full object-cover"
11241
+ }
11242
+ ),
11243
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 to-transparent" })
11244
+ ] }),
11245
+ /* @__PURE__ */ jsxs(MoonUICardContentPro, { className: "p-3", children: [
11246
+ card.labels && card.labels.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-2", children: card.labels.map((label) => /* @__PURE__ */ jsx(
11247
+ "div",
11248
+ {
11249
+ className: "h-2 w-12 rounded-full",
11250
+ style: { backgroundColor: label.color },
11251
+ title: label.name
11252
+ },
11253
+ label.id
11254
+ )) }),
11255
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2 mb-2", children: [
11256
+ /* @__PURE__ */ jsx("div", { className: "flex-1", children: isEditingTitle ? /* @__PURE__ */ jsx(
11257
+ MoonUIInputPro,
11258
+ {
11259
+ value: title,
11260
+ onChange: (e) => setTitle(e.target.value),
11261
+ onBlur: () => setIsEditingTitle(false),
11262
+ onKeyDown: (e) => {
11263
+ if (e.key === "Enter") {
11264
+ setIsEditingTitle(false);
11265
+ }
11266
+ if (e.key === "Escape") {
11267
+ setTitle(card.title);
11268
+ setIsEditingTitle(false);
11269
+ }
11270
+ },
11271
+ className: "h-6 px-1 py-0 text-sm font-medium",
11272
+ autoFocus: true,
11273
+ onClick: (e) => e.stopPropagation()
11274
+ }
11275
+ ) : /* @__PURE__ */ jsx("h4", { className: "font-medium text-sm line-clamp-2", children: card.title }) }),
11276
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", children: /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
11277
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(
11278
+ MoonUIButtonPro,
11279
+ {
11280
+ variant: "ghost",
11281
+ size: "sm",
11282
+ className: "h-6 w-6 p-0",
11283
+ onClick: (e) => e.stopPropagation(),
11284
+ children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-3 w-3" })
11285
+ }
11286
+ ) }),
11287
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", className: "w-48", children: [
11288
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: onEdit, children: [
11289
+ /* @__PURE__ */ jsx(Edit, { className: "mr-2 h-4 w-4" }),
11290
+ "Edit"
11291
+ ] }),
11292
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
11293
+ /* @__PURE__ */ jsx(Copy, { className: "mr-2 h-4 w-4" }),
11294
+ "Duplicate"
11295
+ ] }),
11296
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
11297
+ /* @__PURE__ */ jsx(Move, { className: "mr-2 h-4 w-4" }),
11298
+ "Move"
11299
+ ] }),
11300
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
11301
+ /* @__PURE__ */ jsx(Archive, { className: "mr-2 h-4 w-4" }),
11302
+ "Archive"
11303
+ ] }),
11304
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
11305
+ /* @__PURE__ */ jsxs(
11306
+ MoonUIDropdownMenuItemPro,
11307
+ {
11308
+ onClick: onDelete,
11309
+ className: "text-destructive",
11310
+ children: [
11311
+ /* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }),
11312
+ "Delete"
11313
+ ]
11314
+ }
11315
+ )
11316
+ ] })
11317
+ ] }) })
11318
+ ] }),
11319
+ card.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mb-3 line-clamp-2", children: card.description }),
11320
+ (card.progress !== void 0 || card.checklist) && /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
11321
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-xs text-muted-foreground mb-1", children: [
11322
+ /* @__PURE__ */ jsx("span", { children: "Progress" }),
11323
+ /* @__PURE__ */ jsxs("span", { children: [
11324
+ Math.round(card.progress || checklistProgress),
11325
+ "%"
11326
+ ] })
11327
+ ] }),
11328
+ /* @__PURE__ */ jsx(MoonUIProgressPro, { value: card.progress || checklistProgress, className: "h-1" })
11329
+ ] }),
11330
+ card.tags && card.tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-3", children: card.tags.map((tag, index2) => /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs px-1.5 py-0", children: tag }, index2)) }),
11331
+ showDetails && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs", children: [
11332
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11333
+ card.priority && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11334
+ /* @__PURE__ */ jsx("div", { className: cn("w-2 h-2 rounded-full", PRIORITY_CONFIG[card.priority].dot) }),
11335
+ /* @__PURE__ */ jsx("span", { className: "capitalize", children: card.priority })
11336
+ ] }),
11337
+ card.dueDate && /* @__PURE__ */ jsxs("div", { className: cn(
11338
+ "flex items-center gap-1",
11339
+ isOverdue(card.dueDate) && "text-destructive"
11340
+ ), children: [
11341
+ /* @__PURE__ */ jsx(Calendar$1, { className: "h-3 w-3" }),
11342
+ /* @__PURE__ */ jsx("span", { children: formatDate(card.dueDate) })
11343
+ ] }),
11344
+ card.checklist && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11345
+ /* @__PURE__ */ jsx(CheckSquare, { className: "h-3 w-3" }),
11346
+ /* @__PURE__ */ jsxs("span", { children: [
11347
+ completedChecklistItems,
11348
+ "/",
11349
+ totalChecklistItems
11350
+ ] })
11351
+ ] })
11352
+ ] }),
11353
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11354
+ card.comments && card.comments > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11355
+ /* @__PURE__ */ jsx(MessageCircle, { className: "h-3 w-3" }),
11356
+ /* @__PURE__ */ jsx("span", { children: card.comments })
11357
+ ] }),
11358
+ card.attachments && card.attachments.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11359
+ /* @__PURE__ */ jsx(Paperclip, { className: "h-3 w-3" }),
11360
+ /* @__PURE__ */ jsx("span", { children: card.attachments.length })
11361
+ ] }),
11362
+ card.assignees && card.assignees.length > 0 && /* @__PURE__ */ jsx(MoonUIAvatarGroupPro, { max: 3, size: "xs", children: card.assignees.map((assignee) => /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-5 w-5", children: [
11363
+ /* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: assignee.avatar }),
11364
+ /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(assignee.name) })
11365
+ ] }, assignee.id)) })
11366
+ ] })
11367
+ ] })
11368
+ ] })
11369
+ ]
11370
+ }
11371
+ )
11372
+ }
11373
+ );
11119
11374
  };
11120
11375
  function Kanban({
11121
- columns,
11376
+ columns: initialColumns,
11122
11377
  onCardMove,
11123
11378
  onCardClick,
11124
11379
  onCardEdit,
11125
11380
  onCardDelete,
11381
+ onCardUpdate,
11126
11382
  onAddCard,
11127
11383
  onAddColumn,
11384
+ onColumnUpdate,
11385
+ onColumnDelete,
11386
+ onBulkAction,
11387
+ onExport,
11128
11388
  className,
11129
11389
  showAddColumn = true,
11130
11390
  showCardDetails = true,
11131
- disabled = false
11391
+ showFilters = true,
11392
+ showSearch = true,
11393
+ enableKeyboardShortcuts = true,
11394
+ cardTemplates = [],
11395
+ columnTemplates = [],
11396
+ filters = [],
11397
+ defaultFilter,
11398
+ loading = false,
11399
+ disabled = false,
11400
+ labels = [],
11401
+ users = []
11132
11402
  }) {
11133
11403
  const { hasProAccess, isLoading } = useSubscription();
11134
11404
  if (!isLoading && !hasProAccess) {
@@ -11144,243 +11414,528 @@ function Kanban({
11144
11414
  ] })
11145
11415
  ] }) }) });
11146
11416
  }
11147
- const [draggedCard, setDraggedCard] = t__default.useState(null);
11148
- const [draggedOverColumn, setDraggedOverColumn] = t__default.useState(null);
11149
- const [draggedFromColumn, setDraggedFromColumn] = t__default.useState(null);
11150
- const handleDragStart = (e, cardId) => {
11151
- if (disabled)
11417
+ const [columns, setColumns] = useState(initialColumns);
11418
+ const [searchQuery, setSearchQuery] = useState("");
11419
+ const [activeFilter, setActiveFilter] = useState(defaultFilter);
11420
+ const [selectedCards, setSelectedCards] = useState([]);
11421
+ const [draggedCard, setDraggedCard] = useState(null);
11422
+ const [draggedOverColumn, setDraggedOverColumn] = useState(null);
11423
+ const [isCreatingColumn, setIsCreatingColumn] = useState(false);
11424
+ const [newColumnTitle, setNewColumnTitle] = useState("");
11425
+ const { scrollRef, startAutoScroll, stopAutoScroll } = useAutoScroll();
11426
+ const filteredColumns = useMemo(() => {
11427
+ if (!searchQuery && !activeFilter)
11428
+ return columns;
11429
+ return columns.map((column) => ({
11430
+ ...column,
11431
+ cards: column.cards.filter((card) => {
11432
+ if (searchQuery) {
11433
+ const query = searchQuery.toLowerCase();
11434
+ const matchesSearch = card.title.toLowerCase().includes(query) || card.description?.toLowerCase().includes(query) || card.tags?.some((tag) => tag.toLowerCase().includes(query)) || card.assignees?.some((a) => a.name.toLowerCase().includes(query));
11435
+ if (!matchesSearch)
11436
+ return false;
11437
+ }
11438
+ if (activeFilter) {
11439
+ const filter = filters.find((f) => f.id === activeFilter);
11440
+ if (filter) {
11441
+ if (filter.assignees?.length && !card.assignees?.some((a) => filter.assignees.includes(a.id))) {
11442
+ return false;
11443
+ }
11444
+ if (filter.priority?.length && !filter.priority.includes(card.priority || "")) {
11445
+ return false;
11446
+ }
11447
+ if (filter.labels?.length && !card.labels?.some((l) => filter.labels.includes(l.id))) {
11448
+ return false;
11449
+ }
11450
+ }
11451
+ }
11452
+ return true;
11453
+ })
11454
+ }));
11455
+ }, [columns, searchQuery, activeFilter, filters]);
11456
+ useEffect(() => {
11457
+ if (!enableKeyboardShortcuts)
11152
11458
  return;
11153
- const sourceColumn = columns.find(
11154
- (col) => col.cards.some((card) => card.id === cardId)
11155
- );
11156
- setDraggedCard(cardId);
11157
- setDraggedFromColumn(sourceColumn?.id || null);
11158
- e.dataTransfer.effectAllowed = "move";
11159
- e.dataTransfer.setData("text/plain", cardId);
11160
- e.currentTarget.classList.add("opacity-50");
11161
- };
11162
- const handleDragEnd = (e) => {
11459
+ const handleKeyDown3 = (e) => {
11460
+ if ((e.metaKey || e.ctrlKey) && e.key === "f") {
11461
+ e.preventDefault();
11462
+ document.getElementById("kanban-search")?.focus();
11463
+ }
11464
+ if ((e.metaKey || e.ctrlKey) && e.key === "n") {
11465
+ e.preventDefault();
11466
+ const firstColumn = columns[0];
11467
+ if (firstColumn && onAddCard) {
11468
+ onAddCard(firstColumn.id);
11469
+ }
11470
+ }
11471
+ if (e.key === "Escape") {
11472
+ setSelectedCards([]);
11473
+ }
11474
+ };
11475
+ window.addEventListener("keydown", handleKeyDown3);
11476
+ return () => window.removeEventListener("keydown", handleKeyDown3);
11477
+ }, [enableKeyboardShortcuts, columns, onAddCard]);
11478
+ const handleDragStart = (card, columnId) => {
11163
11479
  if (disabled)
11164
11480
  return;
11165
- setDraggedCard(null);
11166
- setDraggedOverColumn(null);
11167
- setDraggedFromColumn(null);
11168
- e.currentTarget.classList.remove("opacity-50");
11481
+ setDraggedCard(card.id);
11169
11482
  };
11170
11483
  const handleDragOver = (e, columnId) => {
11171
- if (disabled)
11172
- return;
11173
- e.preventDefault();
11174
- e.dataTransfer.dropEffect = "move";
11175
- setDraggedOverColumn(columnId);
11176
- };
11177
- const handleDragEnter = (e, columnId) => {
11178
11484
  if (disabled)
11179
11485
  return;
11180
11486
  e.preventDefault();
11181
11487
  setDraggedOverColumn(columnId);
11182
- };
11183
- const handleDragLeave = (e, columnId) => {
11184
- if (disabled)
11488
+ const container = scrollRef.current;
11489
+ if (!container)
11185
11490
  return;
11186
- e.preventDefault();
11187
- const rect = e.currentTarget.getBoundingClientRect();
11188
- const isLeavingColumn = e.clientX < rect.left || e.clientX > rect.right || e.clientY < rect.top || e.clientY > rect.bottom;
11189
- if (isLeavingColumn) {
11190
- setDraggedOverColumn(null);
11491
+ const rect = container.getBoundingClientRect();
11492
+ const x = e.clientX;
11493
+ if (x < rect.left + 100) {
11494
+ startAutoScroll("left");
11495
+ } else if (x > rect.right - 100) {
11496
+ startAutoScroll("right");
11497
+ } else {
11498
+ stopAutoScroll();
11191
11499
  }
11192
11500
  };
11193
- const handleDrop = (e, columnId) => {
11194
- if (disabled)
11195
- return;
11196
- e.preventDefault();
11197
- const cardId = e.dataTransfer.getData("text/plain") || draggedCard;
11198
- if (cardId && onCardMove && draggedFromColumn && draggedFromColumn !== columnId) {
11199
- const targetColumn = columns.find((col) => col.id === columnId);
11200
- const newIndex = targetColumn?.cards.length || 0;
11201
- onCardMove(cardId, draggedFromColumn, columnId, newIndex);
11202
- }
11501
+ const handleDragEnd = () => {
11203
11502
  setDraggedCard(null);
11204
11503
  setDraggedOverColumn(null);
11205
- setDraggedFromColumn(null);
11504
+ stopAutoScroll();
11206
11505
  };
11207
- const handleCardClick = (card) => {
11208
- if (disabled)
11506
+ const handleDrop = (e, targetColumnId, targetIndex) => {
11507
+ if (disabled || !draggedCard || !onCardMove)
11209
11508
  return;
11210
- onCardClick?.(card);
11211
- };
11212
- const handleCardEdit = (card, e) => {
11213
- if (disabled)
11214
- return;
11215
- e.stopPropagation();
11216
- onCardEdit?.(card);
11217
- };
11218
- const handleCardDelete = (card, e) => {
11219
- if (disabled)
11220
- return;
11221
- e.stopPropagation();
11222
- onCardDelete?.(card);
11223
- };
11224
- const formatDate = (date) => {
11225
- return date.toLocaleDateString("en-US", {
11226
- month: "short",
11227
- day: "numeric"
11228
- });
11509
+ e.preventDefault();
11510
+ let sourceColumnId = null;
11511
+ let sourceCard = null;
11512
+ for (const column of columns) {
11513
+ const card = column.cards.find((c2) => c2.id === draggedCard);
11514
+ if (card) {
11515
+ sourceColumnId = column.id;
11516
+ sourceCard = card;
11517
+ break;
11518
+ }
11519
+ }
11520
+ if (sourceColumnId && sourceCard) {
11521
+ onCardMove(draggedCard, sourceColumnId, targetColumnId, targetIndex);
11522
+ }
11523
+ handleDragEnd();
11229
11524
  };
11230
- const isOverdue = (dueDate) => {
11231
- return dueDate < /* @__PURE__ */ new Date();
11525
+ const handleBulkAction = (action) => {
11526
+ if (onBulkAction && selectedCards.length > 0) {
11527
+ onBulkAction(action, selectedCards);
11528
+ setSelectedCards([]);
11529
+ }
11232
11530
  };
11233
- const getInitials = (name) => {
11234
- return name.split(" ").map((n) => n[0]).join("").toUpperCase();
11531
+ const handleColumnAction = (column, action) => {
11532
+ switch (action) {
11533
+ case "rename":
11534
+ break;
11535
+ case "delete":
11536
+ onColumnDelete?.(column.id);
11537
+ break;
11538
+ case "collapse":
11539
+ onColumnUpdate?.({ ...column, collapsed: !column.collapsed });
11540
+ break;
11541
+ }
11235
11542
  };
11236
- return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsxs("div", { className: "flex gap-6 overflow-x-auto pb-4", children: [
11237
- columns.map((column) => {
11238
- const isOverLimit = column.limit && column.cards.length > column.limit;
11239
- const isDraggedOver = draggedOverColumn === column.id;
11240
- return /* @__PURE__ */ jsx(
11241
- "div",
11242
- {
11243
- className: cn(
11244
- "flex-shrink-0 w-80 transition-colors duration-200",
11245
- isDraggedOver && "bg-primary/5 rounded-lg border-2 border-primary/20"
11246
- ),
11247
- onDragOver: (e) => handleDragOver(e, column.id),
11248
- onDragEnter: (e) => handleDragEnter(e, column.id),
11249
- onDragLeave: (e) => handleDragLeave(e, column.id),
11250
- onDrop: (e) => handleDrop(e, column.id),
11251
- children: /* @__PURE__ */ jsxs(MoonUICardPro, { className: "h-full", children: [
11252
- /* @__PURE__ */ jsxs(MoonUICardHeaderPro, { className: "pb-3", children: [
11253
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
11254
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11255
- column.color && /* @__PURE__ */ jsx(
11256
- "div",
11257
- {
11258
- className: "w-3 h-3 rounded-full",
11259
- style: { backgroundColor: column.color }
11260
- }
11261
- ),
11262
- /* @__PURE__ */ jsx(MoonUICardTitlePro, { className: "text-sm font-medium", children: column.title }),
11263
- /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs", children: column.cards.length })
11264
- ] }),
11265
- /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) })
11543
+ if (loading) {
11544
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsx("div", { className: "flex gap-6 overflow-x-auto pb-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-80", children: /* @__PURE__ */ jsxs(MoonUICardPro, { children: [
11545
+ /* @__PURE__ */ jsx(MoonUICardHeaderPro, { children: /* @__PURE__ */ jsx(MoonUISkeletonPro, { className: "h-4 w-24" }) }),
11546
+ /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "space-y-3", children: [1, 2, 3].map((j) => /* @__PURE__ */ jsx(MoonUISkeletonPro, { className: "h-24 w-full" }, j)) })
11547
+ ] }) }, i)) }) });
11548
+ }
11549
+ return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
11550
+ (showSearch || showFilters) && /* @__PURE__ */ jsxs("div", { className: "mb-6 space-y-4", children: [
11551
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
11552
+ showSearch && /* @__PURE__ */ jsxs("div", { className: "relative flex-1 max-w-md", children: [
11553
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
11554
+ /* @__PURE__ */ jsx(
11555
+ MoonUIInputPro,
11556
+ {
11557
+ id: "kanban-search",
11558
+ placeholder: "Search cards...",
11559
+ value: searchQuery,
11560
+ onChange: (e) => setSearchQuery(e.target.value),
11561
+ className: "pl-9"
11562
+ }
11563
+ )
11564
+ ] }),
11565
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11566
+ showFilters && filters.length > 0 && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
11567
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", size: "sm", children: [
11568
+ /* @__PURE__ */ jsx(Filter, { className: "mr-2 h-4 w-4" }),
11569
+ "Filter",
11570
+ activeFilter && /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "ml-2", children: filters.find((f) => f.id === activeFilter)?.name })
11571
+ ] }) }),
11572
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", className: "w-48", children: [
11573
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuLabelPro, { children: "Quick Filters" }),
11574
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
11575
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => setActiveFilter(void 0), children: [
11576
+ /* @__PURE__ */ jsx(X, { className: "mr-2 h-4 w-4" }),
11577
+ "Clear filter"
11266
11578
  ] }),
11267
- column.limit && /* @__PURE__ */ jsx(MoonUICardDescriptionPro, { className: cn(
11268
- "text-xs",
11269
- isOverLimit && "text-destructive"
11270
- ), children: isOverLimit ? "Over limit" : `${column.cards.length}/${column.limit} cards` })
11271
- ] }),
11272
- /* @__PURE__ */ jsxs(MoonUICardContentPro, { className: "space-y-3", children: [
11273
- column.cards.map((card) => /* @__PURE__ */ jsxs(
11274
- "div",
11579
+ filters.map((filter) => /* @__PURE__ */ jsxs(
11580
+ MoonUIDropdownMenuItemPro,
11275
11581
  {
11276
- draggable: !disabled,
11277
- onDragStart: (e) => handleDragStart(e, card.id),
11278
- onDragEnd: handleDragEnd,
11279
- onClick: () => handleCardClick(card),
11280
- className: cn(
11281
- "p-3 bg-background border rounded-lg cursor-pointer hover:shadow-md transition-all duration-200",
11282
- "group relative select-none",
11283
- draggedCard === card.id && "opacity-50 scale-95",
11284
- disabled && "cursor-not-allowed"
11285
- ),
11582
+ onClick: () => setActiveFilter(filter.id),
11286
11583
  children: [
11287
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
11288
- /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
11289
- /* @__PURE__ */ jsx("h4", { className: "font-medium text-sm mb-1", children: card.title }),
11290
- card.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mb-2 line-clamp-2", children: card.description })
11291
- ] }),
11292
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", children: [
11293
- /* @__PURE__ */ jsx(
11294
- MoonUIButtonPro,
11295
- {
11296
- variant: "ghost",
11297
- size: "sm",
11298
- className: "h-6 w-6 p-0",
11299
- onClick: (e) => handleCardEdit(card, e),
11300
- children: /* @__PURE__ */ jsx(Edit, { className: "h-3 w-3" })
11301
- }
11302
- ),
11303
- /* @__PURE__ */ jsx(
11304
- MoonUIButtonPro,
11584
+ /* @__PURE__ */ jsx(
11585
+ Check,
11586
+ {
11587
+ className: cn(
11588
+ "mr-2 h-4 w-4",
11589
+ activeFilter === filter.id ? "opacity-100" : "opacity-0"
11590
+ )
11591
+ }
11592
+ ),
11593
+ filter.name
11594
+ ]
11595
+ },
11596
+ filter.id
11597
+ ))
11598
+ ] })
11599
+ ] }),
11600
+ selectedCards.length > 0 && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
11601
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", size: "sm", children: [
11602
+ /* @__PURE__ */ jsxs("span", { className: "mr-2", children: [
11603
+ selectedCards.length,
11604
+ " selected"
11605
+ ] }),
11606
+ /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
11607
+ ] }) }),
11608
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", children: [
11609
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleBulkAction("move"), children: [
11610
+ /* @__PURE__ */ jsx(Move, { className: "mr-2 h-4 w-4" }),
11611
+ "Move cards"
11612
+ ] }),
11613
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleBulkAction("archive"), children: [
11614
+ /* @__PURE__ */ jsx(Archive, { className: "mr-2 h-4 w-4" }),
11615
+ "Archive cards"
11616
+ ] }),
11617
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleBulkAction("delete"), children: [
11618
+ /* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }),
11619
+ "Delete cards"
11620
+ ] })
11621
+ ] })
11622
+ ] }),
11623
+ onExport && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
11624
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", size: "sm", children: [
11625
+ /* @__PURE__ */ jsx(Download, { className: "mr-2 h-4 w-4" }),
11626
+ "Export"
11627
+ ] }) }),
11628
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", children: [
11629
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => onExport("json"), children: "Export as JSON" }),
11630
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => onExport("csv"), children: "Export as CSV" })
11631
+ ] })
11632
+ ] })
11633
+ ] })
11634
+ ] }),
11635
+ activeFilter && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11636
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "Active filters:" }),
11637
+ /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "secondary", children: [
11638
+ filters.find((f) => f.id === activeFilter)?.name,
11639
+ /* @__PURE__ */ jsx(
11640
+ MoonUIButtonPro,
11641
+ {
11642
+ variant: "ghost",
11643
+ size: "sm",
11644
+ className: "ml-1 h-auto p-0",
11645
+ onClick: () => setActiveFilter(void 0),
11646
+ children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
11647
+ }
11648
+ )
11649
+ ] })
11650
+ ] })
11651
+ ] }),
11652
+ /* @__PURE__ */ jsxs(
11653
+ "div",
11654
+ {
11655
+ ref: scrollRef,
11656
+ className: "flex gap-6 overflow-x-auto pb-4",
11657
+ onDragOver: (e) => e.preventDefault(),
11658
+ children: [
11659
+ /* @__PURE__ */ jsx(AnimatePresence, { mode: "sync", children: filteredColumns.map((column) => {
11660
+ const isOverLimit = column.limit && column.cards.length >= column.limit;
11661
+ const isDraggedOver = draggedOverColumn === column.id;
11662
+ return /* @__PURE__ */ jsx(
11663
+ motion.div,
11664
+ {
11665
+ layout: true,
11666
+ initial: { opacity: 0, x: -20 },
11667
+ animate: { opacity: 1, x: 0 },
11668
+ exit: { opacity: 0, x: 20 },
11669
+ className: cn(
11670
+ "flex-shrink-0 w-80 transition-all duration-200",
11671
+ isDraggedOver && "scale-105"
11672
+ ),
11673
+ onDragOver: (e) => handleDragOver(e, column.id),
11674
+ onDragLeave: () => setDraggedOverColumn(null),
11675
+ onDrop: (e) => handleDrop(e, column.id, column.cards.length),
11676
+ children: /* @__PURE__ */ jsxs(MoonUICardPro, { className: cn(
11677
+ "h-full transition-all duration-200",
11678
+ isDraggedOver && "ring-2 ring-primary ring-offset-2 bg-primary/5",
11679
+ column.collapsed && "opacity-60"
11680
+ ), children: [
11681
+ /* @__PURE__ */ jsxs(MoonUICardHeaderPro, { className: "pb-3", children: [
11682
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
11683
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11684
+ column.color && /* @__PURE__ */ jsx(
11685
+ "div",
11305
11686
  {
11306
- variant: "ghost",
11307
- size: "sm",
11308
- className: "h-6 w-6 p-0",
11309
- onClick: (e) => handleCardDelete(card, e),
11310
- children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
11687
+ className: "w-3 h-3 rounded-full",
11688
+ style: { backgroundColor: column.color }
11311
11689
  }
11312
11690
  ),
11313
- /* @__PURE__ */ jsx("div", { className: "cursor-move", children: /* @__PURE__ */ jsx(GripVertical, { className: "h-3 w-3 text-muted-foreground" }) })
11314
- ] })
11315
- ] }),
11316
- card.tags && card.tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-2", children: card.tags.map((tag, index2) => /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "outline", className: "text-xs px-1 py-0", children: tag }, index2)) }),
11317
- showCardDetails && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
11318
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11319
- card.priority && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11320
- /* @__PURE__ */ jsx("div", { className: cn("w-2 h-2 rounded-full", PRIORITY_DOTS[card.priority]) }),
11321
- /* @__PURE__ */ jsx("span", { className: "capitalize", children: card.priority })
11691
+ /* @__PURE__ */ jsxs(MoonUICardTitlePro, { className: "text-sm font-medium flex items-center gap-2", children: [
11692
+ column.title,
11693
+ column.locked && /* @__PURE__ */ jsx(Lock, { className: "h-3 w-3" })
11322
11694
  ] }),
11323
- card.dueDate && /* @__PURE__ */ jsxs("div", { className: cn(
11324
- "flex items-center gap-1",
11325
- isOverdue(card.dueDate) && "text-destructive"
11326
- ), children: [
11327
- /* @__PURE__ */ jsx(Calendar$1, { className: "h-3 w-3" }),
11328
- /* @__PURE__ */ jsx("span", { children: formatDate(card.dueDate) })
11329
- ] })
11695
+ /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs", children: column.cards.length })
11330
11696
  ] }),
11331
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11332
- card.comments && card.comments > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11333
- /* @__PURE__ */ jsx(MessageCircle, { className: "h-3 w-3" }),
11334
- /* @__PURE__ */ jsx("span", { children: card.comments })
11335
- ] }),
11336
- card.attachments && card.attachments > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11337
- /* @__PURE__ */ jsx(Paperclip, { className: "h-3 w-3" }),
11338
- /* @__PURE__ */ jsx("span", { children: card.attachments })
11339
- ] }),
11340
- card.assignee && /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-5 w-5", children: [
11341
- /* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: card.assignee.avatar }),
11342
- /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(card.assignee.name) })
11697
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
11698
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "ghost", size: "sm", className: "h-6 w-6 p-0", children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }),
11699
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", children: [
11700
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "rename"), children: [
11701
+ /* @__PURE__ */ jsx(Edit, { className: "mr-2 h-4 w-4" }),
11702
+ "Rename"
11703
+ ] }),
11704
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "collapse"), children: column.collapsed ? /* @__PURE__ */ jsxs(Fragment, { children: [
11705
+ /* @__PURE__ */ jsx(Eye, { className: "mr-2 h-4 w-4" }),
11706
+ "Expand"
11707
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
11708
+ /* @__PURE__ */ jsx(EyeOff, { className: "mr-2 h-4 w-4" }),
11709
+ "Collapse"
11710
+ ] }) }),
11711
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
11712
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuSubPro, { children: [
11713
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuSubTriggerPro, { children: [
11714
+ /* @__PURE__ */ jsx(Settings, { className: "mr-2 h-4 w-4" }),
11715
+ "Settings"
11716
+ ] }),
11717
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuSubContentPro, { children: [
11718
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "setLimit"), children: [
11719
+ /* @__PURE__ */ jsx(Timer, { className: "mr-2 h-4 w-4" }),
11720
+ "Set WIP limit"
11721
+ ] }),
11722
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
11723
+ /* @__PURE__ */ jsx(Palette, { className: "mr-2 h-4 w-4" }),
11724
+ "Change color"
11725
+ ] }),
11726
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
11727
+ /* @__PURE__ */ jsx(ArrowUpDown, { className: "mr-2 h-4 w-4" }),
11728
+ "Sort cards"
11729
+ ] })
11730
+ ] })
11731
+ ] }),
11732
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
11733
+ /* @__PURE__ */ jsxs(
11734
+ MoonUIDropdownMenuItemPro,
11735
+ {
11736
+ onClick: () => handleColumnAction(column, "delete"),
11737
+ className: "text-destructive",
11738
+ children: [
11739
+ /* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }),
11740
+ "Delete column"
11741
+ ]
11742
+ }
11743
+ )
11343
11744
  ] })
11344
11745
  ] })
11746
+ ] }),
11747
+ column.limit && /* @__PURE__ */ jsx(MoonUICardDescriptionPro, { className: cn(
11748
+ "text-xs flex items-center gap-1 mt-1",
11749
+ isOverLimit && "text-destructive"
11750
+ ), children: isOverLimit ? /* @__PURE__ */ jsxs(Fragment, { children: [
11751
+ /* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3" }),
11752
+ "Over WIP limit (",
11753
+ column.cards.length,
11754
+ "/",
11755
+ column.limit,
11756
+ ")"
11757
+ ] }) : `WIP limit: ${column.cards.length}/${column.limit}` })
11758
+ ] }),
11759
+ !column.collapsed && /* @__PURE__ */ jsxs(MoonUICardContentPro, { className: "space-y-3", children: [
11760
+ /* @__PURE__ */ jsx(ScrollArea, { className: "h-[calc(100vh-300px)]", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: column.cards.sort((a, b) => a.position - b.position).map((card, index2) => /* @__PURE__ */ jsx(
11761
+ "div",
11762
+ {
11763
+ draggable: !disabled,
11764
+ onDragStart: () => handleDragStart(card, column.id),
11765
+ onDragEnd: handleDragEnd,
11766
+ onDrop: (e) => {
11767
+ e.preventDefault();
11768
+ e.stopPropagation();
11769
+ handleDrop(e, column.id, index2);
11770
+ },
11771
+ className: "mb-3",
11772
+ children: /* @__PURE__ */ jsx(
11773
+ KanbanCardComponent,
11774
+ {
11775
+ card,
11776
+ isDragging: draggedCard === card.id,
11777
+ onEdit: (e) => {
11778
+ e.stopPropagation();
11779
+ onCardEdit?.(card);
11780
+ },
11781
+ onDelete: (e) => {
11782
+ e.stopPropagation();
11783
+ onCardDelete?.(card);
11784
+ },
11785
+ onClick: () => onCardClick?.(card),
11786
+ showDetails: showCardDetails,
11787
+ disabled
11788
+ }
11789
+ )
11790
+ },
11791
+ card.id
11792
+ )) }) }),
11793
+ onAddCard && !column.locked && !isOverLimit && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
11794
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(
11795
+ MoonUIButtonPro,
11796
+ {
11797
+ variant: "ghost",
11798
+ size: "sm",
11799
+ className: "w-full justify-start text-muted-foreground hover:text-foreground",
11800
+ disabled,
11801
+ children: [
11802
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-2" }),
11803
+ "Add card"
11804
+ ]
11805
+ }
11806
+ ) }),
11807
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "start", className: "w-48", children: [
11808
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuLabelPro, { children: "Card Templates" }),
11809
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
11810
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAddCard(column.id), children: [
11811
+ /* @__PURE__ */ jsx(FileText, { className: "mr-2 h-4 w-4" }),
11812
+ "Blank card"
11813
+ ] }),
11814
+ cardTemplates.map((template, index2) => /* @__PURE__ */ jsxs(
11815
+ MoonUIDropdownMenuItemPro,
11816
+ {
11817
+ onClick: () => onAddCard(column.id, template),
11818
+ children: [
11819
+ /* @__PURE__ */ jsx(Star, { className: "mr-2 h-4 w-4" }),
11820
+ template.title || `Template ${index2 + 1}`
11821
+ ]
11822
+ },
11823
+ index2
11824
+ ))
11825
+ ] })
11345
11826
  ] })
11346
- ]
11347
- },
11348
- card.id
11349
- )),
11350
- onAddCard && /* @__PURE__ */ jsxs(
11351
- MoonUIButtonPro,
11352
- {
11353
- variant: "ghost",
11354
- size: "sm",
11355
- onClick: () => onAddCard(column.id),
11356
- className: "w-full justify-start text-muted-foreground hover:text-foreground",
11357
- disabled,
11358
- children: [
11359
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-2" }),
11360
- "Add card"
11361
- ]
11362
- }
11363
- )
11364
- ] })
11365
- ] })
11366
- },
11367
- column.id
11368
- );
11369
- }),
11370
- showAddColumn && onAddColumn && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-80", children: /* @__PURE__ */ jsxs(
11371
- MoonUIButtonPro,
11372
- {
11373
- variant: "outline",
11374
- onClick: onAddColumn,
11375
- className: "w-full h-full min-h-[200px] border-dashed justify-center items-center",
11376
- disabled,
11377
- children: [
11378
- /* @__PURE__ */ jsx(Plus, { className: "h-6 w-6 mr-2" }),
11379
- "Add column"
11827
+ ] })
11828
+ ] })
11829
+ },
11830
+ column.id
11831
+ );
11832
+ }) }),
11833
+ showAddColumn && onAddColumn && /* @__PURE__ */ jsx(
11834
+ motion.div,
11835
+ {
11836
+ initial: { opacity: 0 },
11837
+ animate: { opacity: 1 },
11838
+ className: "flex-shrink-0 w-80",
11839
+ children: isCreatingColumn ? /* @__PURE__ */ jsxs(MoonUICardPro, { children: [
11840
+ /* @__PURE__ */ jsx(MoonUICardHeaderPro, { children: /* @__PURE__ */ jsx(
11841
+ MoonUIInputPro,
11842
+ {
11843
+ placeholder: "Enter column title...",
11844
+ value: newColumnTitle,
11845
+ onChange: (e) => setNewColumnTitle(e.target.value),
11846
+ onKeyDown: (e) => {
11847
+ if (e.key === "Enter" && newColumnTitle) {
11848
+ onAddColumn({ title: newColumnTitle });
11849
+ setNewColumnTitle("");
11850
+ setIsCreatingColumn(false);
11851
+ }
11852
+ if (e.key === "Escape") {
11853
+ setNewColumnTitle("");
11854
+ setIsCreatingColumn(false);
11855
+ }
11856
+ },
11857
+ autoFocus: true
11858
+ }
11859
+ ) }),
11860
+ /* @__PURE__ */ jsx(MoonUICardContentPro, { children: /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
11861
+ /* @__PURE__ */ jsx(
11862
+ MoonUIButtonPro,
11863
+ {
11864
+ size: "sm",
11865
+ onClick: () => {
11866
+ if (newColumnTitle) {
11867
+ onAddColumn({ title: newColumnTitle });
11868
+ setNewColumnTitle("");
11869
+ setIsCreatingColumn(false);
11870
+ }
11871
+ },
11872
+ children: "Add column"
11873
+ }
11874
+ ),
11875
+ /* @__PURE__ */ jsx(
11876
+ MoonUIButtonPro,
11877
+ {
11878
+ size: "sm",
11879
+ variant: "ghost",
11880
+ onClick: () => {
11881
+ setNewColumnTitle("");
11882
+ setIsCreatingColumn(false);
11883
+ },
11884
+ children: "Cancel"
11885
+ }
11886
+ )
11887
+ ] }) })
11888
+ ] }) : /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
11889
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(
11890
+ MoonUIButtonPro,
11891
+ {
11892
+ variant: "outline",
11893
+ className: "w-full h-full min-h-[200px] border-dashed justify-center items-center",
11894
+ disabled,
11895
+ children: [
11896
+ /* @__PURE__ */ jsx(Plus, { className: "h-6 w-6 mr-2" }),
11897
+ "Add column"
11898
+ ]
11899
+ }
11900
+ ) }),
11901
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "start", className: "w-48", children: [
11902
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuLabelPro, { children: "Column Templates" }),
11903
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
11904
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => setIsCreatingColumn(true), children: [
11905
+ /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }),
11906
+ "Blank column"
11907
+ ] }),
11908
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAddColumn(COLUMN_TEMPLATES.todo), children: [
11909
+ /* @__PURE__ */ jsx(Square, { className: "mr-2 h-4 w-4" }),
11910
+ "To Do"
11911
+ ] }),
11912
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAddColumn(COLUMN_TEMPLATES.inProgress), children: [
11913
+ /* @__PURE__ */ jsx(Clock, { className: "mr-2 h-4 w-4" }),
11914
+ "In Progress"
11915
+ ] }),
11916
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAddColumn(COLUMN_TEMPLATES.done), children: [
11917
+ /* @__PURE__ */ jsx(CheckSquare, { className: "mr-2 h-4 w-4" }),
11918
+ "Done"
11919
+ ] }),
11920
+ columnTemplates.map((template, index2) => /* @__PURE__ */ jsxs(
11921
+ MoonUIDropdownMenuItemPro,
11922
+ {
11923
+ onClick: () => onAddColumn(template),
11924
+ children: [
11925
+ /* @__PURE__ */ jsx(Star, { className: "mr-2 h-4 w-4" }),
11926
+ template.title || `Template ${index2 + 1}`
11927
+ ]
11928
+ },
11929
+ index2
11930
+ ))
11931
+ ] })
11932
+ ] })
11933
+ }
11934
+ )
11380
11935
  ]
11381
11936
  }
11382
- ) })
11383
- ] }) });
11937
+ )
11938
+ ] });
11384
11939
  }
11385
11940
 
11386
11941
  // ../../node_modules/orderedmap/dist/index.js
@@ -11565,7 +12120,7 @@ function findDiffEnd(a, b, posA, posB) {
11565
12120
  posB -= size4;
11566
12121
  }
11567
12122
  }
11568
- var Fragment4 = class {
12123
+ var Fragment5 = class {
11569
12124
  /**
11570
12125
  @internal
11571
12126
  */
@@ -11633,7 +12188,7 @@ var Fragment4 = class {
11633
12188
  }
11634
12189
  for (; i < other.content.length; i++)
11635
12190
  content.push(other.content[i]);
11636
- return new Fragment4(content, this.size + other.size);
12191
+ return new Fragment5(content, this.size + other.size);
11637
12192
  }
11638
12193
  /**
11639
12194
  Cut out the sub-fragment between the two given positions.
@@ -11657,17 +12212,17 @@ var Fragment4 = class {
11657
12212
  }
11658
12213
  pos = end;
11659
12214
  }
11660
- return new Fragment4(result, size4);
12215
+ return new Fragment5(result, size4);
11661
12216
  }
11662
12217
  /**
11663
12218
  @internal
11664
12219
  */
11665
12220
  cutByIndex(from2, to) {
11666
12221
  if (from2 == to)
11667
- return Fragment4.empty;
12222
+ return Fragment5.empty;
11668
12223
  if (from2 == 0 && to == this.content.length)
11669
12224
  return this;
11670
- return new Fragment4(this.content.slice(from2, to));
12225
+ return new Fragment5(this.content.slice(from2, to));
11671
12226
  }
11672
12227
  /**
11673
12228
  Create a new fragment in which the node at the given index is
@@ -11680,21 +12235,21 @@ var Fragment4 = class {
11680
12235
  let copy2 = this.content.slice();
11681
12236
  let size4 = this.size + node.nodeSize - current.nodeSize;
11682
12237
  copy2[index2] = node;
11683
- return new Fragment4(copy2, size4);
12238
+ return new Fragment5(copy2, size4);
11684
12239
  }
11685
12240
  /**
11686
12241
  Create a new fragment by prepending the given node to this
11687
12242
  fragment.
11688
12243
  */
11689
12244
  addToStart(node) {
11690
- return new Fragment4([node].concat(this.content), this.size + node.nodeSize);
12245
+ return new Fragment5([node].concat(this.content), this.size + node.nodeSize);
11691
12246
  }
11692
12247
  /**
11693
12248
  Create a new fragment by appending the given node to this
11694
12249
  fragment.
11695
12250
  */
11696
12251
  addToEnd(node) {
11697
- return new Fragment4(this.content.concat(node), this.size + node.nodeSize);
12252
+ return new Fragment5(this.content.concat(node), this.size + node.nodeSize);
11698
12253
  }
11699
12254
  /**
11700
12255
  Compare this fragment to another one.
@@ -11813,10 +12368,10 @@ var Fragment4 = class {
11813
12368
  */
11814
12369
  static fromJSON(schema, value) {
11815
12370
  if (!value)
11816
- return Fragment4.empty;
12371
+ return Fragment5.empty;
11817
12372
  if (!Array.isArray(value))
11818
12373
  throw new RangeError("Invalid input for Fragment.fromJSON");
11819
- return new Fragment4(value.map(schema.nodeFromJSON));
12374
+ return new Fragment5(value.map(schema.nodeFromJSON));
11820
12375
  }
11821
12376
  /**
11822
12377
  Build a fragment from an array of nodes. Ensures that adjacent
@@ -11824,7 +12379,7 @@ var Fragment4 = class {
11824
12379
  */
11825
12380
  static fromArray(array) {
11826
12381
  if (!array.length)
11827
- return Fragment4.empty;
12382
+ return Fragment5.empty;
11828
12383
  let joined, size4 = 0;
11829
12384
  for (let i = 0; i < array.length; i++) {
11830
12385
  let node = array[i];
@@ -11837,7 +12392,7 @@ var Fragment4 = class {
11837
12392
  joined.push(node);
11838
12393
  }
11839
12394
  }
11840
- return new Fragment4(joined || array, size4);
12395
+ return new Fragment5(joined || array, size4);
11841
12396
  }
11842
12397
  /**
11843
12398
  Create a fragment from something that can be interpreted as a
@@ -11847,17 +12402,17 @@ var Fragment4 = class {
11847
12402
  */
11848
12403
  static from(nodes) {
11849
12404
  if (!nodes)
11850
- return Fragment4.empty;
11851
- if (nodes instanceof Fragment4)
12405
+ return Fragment5.empty;
12406
+ if (nodes instanceof Fragment5)
11852
12407
  return nodes;
11853
12408
  if (Array.isArray(nodes))
11854
12409
  return this.fromArray(nodes);
11855
12410
  if (nodes.attrs)
11856
- return new Fragment4([nodes], nodes.nodeSize);
12411
+ return new Fragment5([nodes], nodes.nodeSize);
11857
12412
  throw new RangeError("Can not convert " + nodes + " to a Fragment" + (nodes.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
11858
12413
  }
11859
12414
  };
11860
- Fragment4.empty = new Fragment4([], 0);
12415
+ Fragment5.empty = new Fragment5([], 0);
11861
12416
  var found = { index: 0, offset: 0 };
11862
12417
  function retIndex(index2, offset4) {
11863
12418
  found.index = index2;
@@ -12082,7 +12637,7 @@ var Slice = class {
12082
12637
  let openStart = json2.openStart || 0, openEnd = json2.openEnd || 0;
12083
12638
  if (typeof openStart != "number" || typeof openEnd != "number")
12084
12639
  throw new RangeError("Invalid input for Slice.fromJSON");
12085
- return new Slice(Fragment4.fromJSON(schema, json2.content), openStart, openEnd);
12640
+ return new Slice(Fragment5.fromJSON(schema, json2.content), openStart, openEnd);
12086
12641
  }
12087
12642
  /**
12088
12643
  Create a slice from a fragment by taking the maximum possible
@@ -12097,7 +12652,7 @@ var Slice = class {
12097
12652
  return new Slice(fragment, openStart, openEnd);
12098
12653
  }
12099
12654
  };
12100
- Slice.empty = new Slice(Fragment4.empty, 0, 0);
12655
+ Slice.empty = new Slice(Fragment5.empty, 0, 0);
12101
12656
  function removeRange(content, from2, to) {
12102
12657
  let { index: index2, offset: offset4 } = content.findIndex(from2), child = content.maybeChild(index2);
12103
12658
  let { index: indexTo, offset: offsetTo } = content.findIndex(to);
@@ -12195,7 +12750,7 @@ function replaceThreeWay($from, $start, $end, $to, depth) {
12195
12750
  addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);
12196
12751
  }
12197
12752
  addRange($to, null, depth, content);
12198
- return new Fragment4(content);
12753
+ return new Fragment5(content);
12199
12754
  }
12200
12755
  function replaceTwoWay($from, $to, depth) {
12201
12756
  let content = [];
@@ -12205,13 +12760,13 @@ function replaceTwoWay($from, $to, depth) {
12205
12760
  addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);
12206
12761
  }
12207
12762
  addRange($to, null, depth, content);
12208
- return new Fragment4(content);
12763
+ return new Fragment5(content);
12209
12764
  }
12210
12765
  function prepareSliceForReplace(slice2, $along) {
12211
12766
  let extra = $along.depth - slice2.openStart, parent = $along.node(extra);
12212
12767
  let node = parent.copy(slice2.content);
12213
12768
  for (let i = extra - 1; i >= 0; i--)
12214
- node = $along.node(i).copy(Fragment4.from(node));
12769
+ node = $along.node(i).copy(Fragment5.from(node));
12215
12770
  return {
12216
12771
  start: node.resolveNoCache(slice2.openStart + extra),
12217
12772
  end: node.resolveNoCache(node.content.size - slice2.openEnd - extra)
@@ -12550,7 +13105,7 @@ var Node2 = class {
12550
13105
  this.type = type;
12551
13106
  this.attrs = attrs;
12552
13107
  this.marks = marks;
12553
- this.content = content || Fragment4.empty;
13108
+ this.content = content || Fragment5.empty;
12554
13109
  }
12555
13110
  /**
12556
13111
  The array of this node's child nodes.
@@ -12855,7 +13410,7 @@ var Node2 = class {
12855
13410
  can optionally pass `start` and `end` indices into the
12856
13411
  replacement fragment.
12857
13412
  */
12858
- canReplace(from2, to, replacement = Fragment4.empty, start = 0, end = replacement.childCount) {
13413
+ canReplace(from2, to, replacement = Fragment5.empty, start = 0, end = replacement.childCount) {
12859
13414
  let one = this.contentMatchAt(from2).matchFragment(replacement, start, end);
12860
13415
  let two = one && one.matchFragment(this.content, to);
12861
13416
  if (!two || !two.validEnd)
@@ -12937,7 +13492,7 @@ var Node2 = class {
12937
13492
  throw new RangeError("Invalid text node in JSON");
12938
13493
  return schema.text(json2.text, marks);
12939
13494
  }
12940
- let content = Fragment4.fromJSON(schema, json2.content);
13495
+ let content = Fragment5.fromJSON(schema, json2.content);
12941
13496
  let node = schema.nodeType(json2.type).create(json2.attrs, content, marks);
12942
13497
  node.type.checkAttrs(node.attrs);
12943
13498
  return node;
@@ -13079,7 +13634,7 @@ var ContentMatch = class {
13079
13634
  function search(match, types) {
13080
13635
  let finished = match.matchFragment(after, startIndex);
13081
13636
  if (finished && (!toEnd || finished.validEnd))
13082
- return Fragment4.from(types.map((tp) => tp.createAndFill()));
13637
+ return Fragment5.from(types.map((tp) => tp.createAndFill()));
13083
13638
  for (let i = 0; i < match.next.length; i++) {
13084
13639
  let { type, next } = match.next[i];
13085
13640
  if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {
@@ -13531,7 +14086,7 @@ var NodeType = class {
13531
14086
  create(attrs = null, content, marks) {
13532
14087
  if (this.isText)
13533
14088
  throw new Error("NodeType.create can't construct text nodes");
13534
- return new Node2(this, this.computeAttrs(attrs), Fragment4.from(content), Mark.setFrom(marks));
14089
+ return new Node2(this, this.computeAttrs(attrs), Fragment5.from(content), Mark.setFrom(marks));
13535
14090
  }
13536
14091
  /**
13537
14092
  Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
@@ -13539,7 +14094,7 @@ var NodeType = class {
13539
14094
  if it doesn't match.
13540
14095
  */
13541
14096
  createChecked(attrs = null, content, marks) {
13542
- content = Fragment4.from(content);
14097
+ content = Fragment5.from(content);
13543
14098
  this.checkContent(content);
13544
14099
  return new Node2(this, this.computeAttrs(attrs), content, Mark.setFrom(marks));
13545
14100
  }
@@ -13553,7 +14108,7 @@ var NodeType = class {
13553
14108
  */
13554
14109
  createAndFill(attrs = null, content, marks) {
13555
14110
  attrs = this.computeAttrs(attrs);
13556
- content = Fragment4.from(content);
14111
+ content = Fragment5.from(content);
13557
14112
  if (content.size) {
13558
14113
  let before = this.contentMatch.fillBefore(content);
13559
14114
  if (!before)
@@ -13561,7 +14116,7 @@ var NodeType = class {
13561
14116
  content = before.append(content);
13562
14117
  }
13563
14118
  let matched = this.contentMatch.matchFragment(content);
13564
- let after = matched && matched.fillBefore(Fragment4.empty, true);
14119
+ let after = matched && matched.fillBefore(Fragment5.empty, true);
13565
14120
  if (!after)
13566
14121
  return null;
13567
14122
  return new Node2(this, attrs, content.append(after), Mark.setFrom(marks));
@@ -14025,7 +14580,7 @@ var NodeContext = class {
14025
14580
  if (!this.match) {
14026
14581
  if (!this.type)
14027
14582
  return [];
14028
- let fill = this.type.contentMatch.fillBefore(Fragment4.from(node));
14583
+ let fill = this.type.contentMatch.fillBefore(Fragment5.from(node));
14029
14584
  if (fill) {
14030
14585
  this.match = this.type.contentMatch.matchFragment(fill);
14031
14586
  } else {
@@ -14051,9 +14606,9 @@ var NodeContext = class {
14051
14606
  this.content[this.content.length - 1] = text.withText(text.text.slice(0, text.text.length - m2[0].length));
14052
14607
  }
14053
14608
  }
14054
- let content = Fragment4.from(this.content);
14609
+ let content = Fragment5.from(this.content);
14055
14610
  if (!openEnd && this.match)
14056
- content = content.append(this.match.fillBefore(Fragment4.empty, true));
14611
+ content = content.append(this.match.fillBefore(Fragment5.empty, true));
14057
14612
  return this.type ? this.type.create(this.attrs, content, this.marks) : content;
14058
14613
  }
14059
14614
  inlineContext(node) {
@@ -15070,7 +15625,7 @@ function mapFragment(fragment, f, parent) {
15070
15625
  child = f(child, parent, i);
15071
15626
  mapped.push(child);
15072
15627
  }
15073
- return Fragment4.fromArray(mapped);
15628
+ return Fragment5.fromArray(mapped);
15074
15629
  }
15075
15630
  var AddMarkStep = class extends Step {
15076
15631
  /**
@@ -15187,7 +15742,7 @@ var AddNodeMarkStep = class extends Step {
15187
15742
  if (!node)
15188
15743
  return StepResult.fail("No node at mark step's position");
15189
15744
  let updated = node.type.create(node.attrs, null, this.mark.addToSet(node.marks));
15190
- return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment4.from(updated), 0, node.isLeaf ? 0 : 1));
15745
+ return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment5.from(updated), 0, node.isLeaf ? 0 : 1));
15191
15746
  }
15192
15747
  invert(doc3) {
15193
15748
  let node = doc3.nodeAt(this.pos);
@@ -15233,7 +15788,7 @@ var RemoveNodeMarkStep = class extends Step {
15233
15788
  if (!node)
15234
15789
  return StepResult.fail("No node at mark step's position");
15235
15790
  let updated = node.type.create(node.attrs, null, this.mark.removeFromSet(node.marks));
15236
- return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment4.from(updated), 0, node.isLeaf ? 0 : 1));
15791
+ return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment5.from(updated), 0, node.isLeaf ? 0 : 1));
15237
15792
  }
15238
15793
  invert(doc3) {
15239
15794
  let node = doc3.nodeAt(this.pos);
@@ -15498,7 +16053,7 @@ function clearIncompatible(tr2, pos, parentType, match = parentType.contentMatch
15498
16053
  let m2, newline = /\r?\n|\r/g, slice2;
15499
16054
  while (m2 = newline.exec(child.text)) {
15500
16055
  if (!slice2)
15501
- slice2 = new Slice(Fragment4.from(parentType.schema.text(" ", parentType.allowedMarks(child.marks))), 0, 0);
16056
+ slice2 = new Slice(Fragment5.from(parentType.schema.text(" ", parentType.allowedMarks(child.marks))), 0, 0);
15502
16057
  replSteps.push(new ReplaceStep(cur + m2.index, cur + m2.index + m2[0].length, slice2));
15503
16058
  }
15504
16059
  }
@@ -15506,7 +16061,7 @@ function clearIncompatible(tr2, pos, parentType, match = parentType.contentMatch
15506
16061
  cur = end;
15507
16062
  }
15508
16063
  if (!match.validEnd) {
15509
- let fill = match.fillBefore(Fragment4.empty, true);
16064
+ let fill = match.fillBefore(Fragment5.empty, true);
15510
16065
  tr2.replace(cur, cur, new Slice(fill, 0, 0));
15511
16066
  }
15512
16067
  for (let i = replSteps.length - 1; i >= 0; i--)
@@ -15532,20 +16087,20 @@ function lift(tr2, range, target) {
15532
16087
  let { $from, $to, depth } = range;
15533
16088
  let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);
15534
16089
  let start = gapStart, end = gapEnd;
15535
- let before = Fragment4.empty, openStart = 0;
16090
+ let before = Fragment5.empty, openStart = 0;
15536
16091
  for (let d = depth, splitting = false; d > target; d--)
15537
16092
  if (splitting || $from.index(d) > 0) {
15538
16093
  splitting = true;
15539
- before = Fragment4.from($from.node(d).copy(before));
16094
+ before = Fragment5.from($from.node(d).copy(before));
15540
16095
  openStart++;
15541
16096
  } else {
15542
16097
  start--;
15543
16098
  }
15544
- let after = Fragment4.empty, openEnd = 0;
16099
+ let after = Fragment5.empty, openEnd = 0;
15545
16100
  for (let d = depth, splitting = false; d > target; d--)
15546
16101
  if (splitting || $to.after(d + 1) < $to.end(d)) {
15547
16102
  splitting = true;
15548
- after = Fragment4.from($to.node(d).copy(after));
16103
+ after = Fragment5.from($to.node(d).copy(after));
15549
16104
  openEnd++;
15550
16105
  } else {
15551
16106
  end++;
@@ -15585,14 +16140,14 @@ function findWrappingInside(range, type) {
15585
16140
  return inside;
15586
16141
  }
15587
16142
  function wrap(tr2, range, wrappers) {
15588
- let content = Fragment4.empty;
16143
+ let content = Fragment5.empty;
15589
16144
  for (let i = wrappers.length - 1; i >= 0; i--) {
15590
16145
  if (content.size) {
15591
16146
  let match = wrappers[i].type.contentMatch.matchFragment(content);
15592
16147
  if (!match || !match.validEnd)
15593
16148
  throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
15594
16149
  }
15595
- content = Fragment4.from(wrappers[i].type.create(wrappers[i].attrs, content));
16150
+ content = Fragment5.from(wrappers[i].type.create(wrappers[i].attrs, content));
15596
16151
  }
15597
16152
  let start = range.start, end = range.end;
15598
16153
  tr2.step(new ReplaceAroundStep(start, end, start, end, new Slice(content, 0, 0), wrappers.length, true));
@@ -15617,7 +16172,7 @@ function setBlockType(tr2, from2, to, type, attrs) {
15617
16172
  clearIncompatible(tr2, tr2.mapping.slice(mapFrom).map(pos, 1), type, void 0, convertNewlines === null);
15618
16173
  let mapping = tr2.mapping.slice(mapFrom);
15619
16174
  let startM = mapping.map(pos, 1), endM = mapping.map(pos + node.nodeSize, 1);
15620
- tr2.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment4.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));
16175
+ tr2.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment5.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));
15621
16176
  if (convertNewlines === true)
15622
16177
  replaceNewlines(tr2, node, pos, mapFrom);
15623
16178
  return false;
@@ -15658,7 +16213,7 @@ function setNodeMarkup(tr2, pos, type, attrs, marks) {
15658
16213
  return tr2.replaceWith(pos, pos + node.nodeSize, newNode);
15659
16214
  if (!type.validContent(node.content))
15660
16215
  throw new RangeError("Invalid content for node type " + type.name);
15661
- tr2.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment4.from(newNode), 0, 0), 1, true));
16216
+ tr2.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment5.from(newNode), 0, 0), 1, true));
15662
16217
  }
15663
16218
  function canSplit(doc3, pos, depth = 1, typesAfter) {
15664
16219
  let $pos = doc3.resolve(pos), base2 = $pos.depth - depth;
@@ -15682,11 +16237,11 @@ function canSplit(doc3, pos, depth = 1, typesAfter) {
15682
16237
  return $pos.node(base2).canReplaceWith(index2, index2, baseType ? baseType.type : $pos.node(base2 + 1).type);
15683
16238
  }
15684
16239
  function split(tr2, pos, depth = 1, typesAfter) {
15685
- let $pos = tr2.doc.resolve(pos), before = Fragment4.empty, after = Fragment4.empty;
16240
+ let $pos = tr2.doc.resolve(pos), before = Fragment5.empty, after = Fragment5.empty;
15686
16241
  for (let d = $pos.depth, e = $pos.depth - depth, i = depth - 1; d > e; d--, i--) {
15687
- before = Fragment4.from($pos.node(d).copy(before));
16242
+ before = Fragment5.from($pos.node(d).copy(before));
15688
16243
  let typeAfter = typesAfter && typesAfter[i];
15689
- after = Fragment4.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
16244
+ after = Fragment5.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
15690
16245
  }
15691
16246
  tr2.step(new ReplaceStep(pos, pos, new Slice(before.append(after), depth, depth), true));
15692
16247
  }
@@ -15825,7 +16380,7 @@ var Fitter = class {
15825
16380
  this.$to = $to;
15826
16381
  this.unplaced = unplaced;
15827
16382
  this.frontier = [];
15828
- this.placed = Fragment4.empty;
16383
+ this.placed = Fragment5.empty;
15829
16384
  for (let i = 0; i <= $from.depth; i++) {
15830
16385
  let node = $from.node(i);
15831
16386
  this.frontier.push({
@@ -15834,7 +16389,7 @@ var Fitter = class {
15834
16389
  });
15835
16390
  }
15836
16391
  for (let i = $from.depth; i > 0; i--)
15837
- this.placed = Fragment4.from($from.node(i).copy(this.placed));
16392
+ this.placed = Fragment5.from($from.node(i).copy(this.placed));
15838
16393
  }
15839
16394
  get depth() {
15840
16395
  return this.frontier.length - 1;
@@ -15891,7 +16446,7 @@ var Fitter = class {
15891
16446
  let first2 = fragment.firstChild;
15892
16447
  for (let frontierDepth = this.depth; frontierDepth >= 0; frontierDepth--) {
15893
16448
  let { type, match } = this.frontier[frontierDepth], wrap2, inject = null;
15894
- if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(Fragment4.from(first2), false)) : parent && type.compatibleContent(parent.type)))
16449
+ if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(Fragment5.from(first2), false)) : parent && type.compatibleContent(parent.type)))
15895
16450
  return { sliceDepth, frontierDepth, parent, inject };
15896
16451
  else if (pass == 2 && first2 && (wrap2 = match.findWrapping(first2.type)))
15897
16452
  return { sliceDepth, frontierDepth, parent, wrap: wrap2 };
@@ -15951,7 +16506,7 @@ var Fitter = class {
15951
16506
  let toEnd = taken == fragment.childCount;
15952
16507
  if (!toEnd)
15953
16508
  openEndCount = -1;
15954
- this.placed = addToFragment(this.placed, frontierDepth, Fragment4.from(add));
16509
+ this.placed = addToFragment(this.placed, frontierDepth, Fragment5.from(add));
15955
16510
  this.frontier[frontierDepth].match = match;
15956
16511
  if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1)
15957
16512
  this.closeFrontierNode();
@@ -16008,12 +16563,12 @@ var Fitter = class {
16008
16563
  openFrontierNode(type, attrs = null, content) {
16009
16564
  let top = this.frontier[this.depth];
16010
16565
  top.match = top.match.matchType(type);
16011
- this.placed = addToFragment(this.placed, this.depth, Fragment4.from(type.create(attrs, content)));
16566
+ this.placed = addToFragment(this.placed, this.depth, Fragment5.from(type.create(attrs, content)));
16012
16567
  this.frontier.push({ type, match: type.contentMatch });
16013
16568
  }
16014
16569
  closeFrontierNode() {
16015
16570
  let open = this.frontier.pop();
16016
- let add = open.match.fillBefore(Fragment4.empty, true);
16571
+ let add = open.match.fillBefore(Fragment5.empty, true);
16017
16572
  if (add.childCount)
16018
16573
  this.placed = addToFragment(this.placed, this.frontier.length, add);
16019
16574
  }
@@ -16042,7 +16597,7 @@ function closeNodeStart(node, openStart, openEnd) {
16042
16597
  if (openStart > 0) {
16043
16598
  frag = node.type.contentMatch.fillBefore(frag).append(frag);
16044
16599
  if (openEnd <= 0)
16045
- frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment4.empty, true));
16600
+ frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment5.empty, true));
16046
16601
  }
16047
16602
  return node.copy(frag);
16048
16603
  }
@@ -16134,7 +16689,7 @@ function closeFragment(fragment, depth, oldOpen, newOpen, parent) {
16134
16689
  if (depth > newOpen) {
16135
16690
  let match = parent.contentMatchAt(0);
16136
16691
  let start = match.fillBefore(fragment).append(fragment);
16137
- fragment = start.append(match.matchFragment(start).fillBefore(Fragment4.empty, true));
16692
+ fragment = start.append(match.matchFragment(start).fillBefore(Fragment5.empty, true));
16138
16693
  }
16139
16694
  return fragment;
16140
16695
  }
@@ -16144,7 +16699,7 @@ function replaceRangeWith(tr2, from2, to, node) {
16144
16699
  if (point != null)
16145
16700
  from2 = to = point;
16146
16701
  }
16147
- tr2.replaceRange(from2, to, new Slice(Fragment4.from(node), 0, 0));
16702
+ tr2.replaceRange(from2, to, new Slice(Fragment5.from(node), 0, 0));
16148
16703
  }
16149
16704
  function deleteRange(tr2, from2, to) {
16150
16705
  let $from = tr2.doc.resolve(from2), $to = tr2.doc.resolve(to);
@@ -16192,7 +16747,7 @@ var AttrStep = class extends Step {
16192
16747
  attrs[name] = node.attrs[name];
16193
16748
  attrs[this.attr] = this.value;
16194
16749
  let updated = node.type.create(attrs, null, node.marks);
16195
- return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment4.from(updated), 0, node.isLeaf ? 0 : 1));
16750
+ return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment5.from(updated), 0, node.isLeaf ? 0 : 1));
16196
16751
  }
16197
16752
  getMap() {
16198
16753
  return StepMap.empty;
@@ -16327,7 +16882,7 @@ var Transform = class {
16327
16882
  fragment, node, or array of nodes.
16328
16883
  */
16329
16884
  replaceWith(from2, to, content) {
16330
- return this.replace(from2, to, new Slice(Fragment4.from(content), 0, 0));
16885
+ return this.replace(from2, to, new Slice(Fragment5.from(content), 0, 0));
16331
16886
  }
16332
16887
  /**
16333
16888
  Delete the content between the given positions.
@@ -16829,7 +17384,7 @@ var NodeSelection = class extends Selection {
16829
17384
  return new NodeSelection($pos);
16830
17385
  }
16831
17386
  content() {
16832
- return new Slice(Fragment4.from(this.node), 0, 0);
17387
+ return new Slice(Fragment5.from(this.node), 0, 0);
16833
17388
  }
16834
17389
  eq(other) {
16835
17390
  return other instanceof NodeSelection && other.anchor == this.anchor;
@@ -18651,7 +19206,7 @@ var NodeViewDesc = class extends ViewDesc {
18651
19206
  }
18652
19207
  }
18653
19208
  if (!rule.contentElement)
18654
- rule.getContent = () => Fragment4.empty;
19209
+ rule.getContent = () => Fragment5.empty;
18655
19210
  }
18656
19211
  return rule;
18657
19212
  }
@@ -19970,7 +20525,7 @@ function parseFromClipboard(view, text, html, plainText, $context) {
19970
20525
  text = f(text, inCode || plainText, view);
19971
20526
  });
19972
20527
  if (inCode)
19973
- return text ? new Slice(Fragment4.from(view.state.schema.text(text.replace(/\r\n?/g, "\n"))), 0, 0) : Slice.empty;
20528
+ return text ? new Slice(Fragment5.from(view.state.schema.text(text.replace(/\r\n?/g, "\n"))), 0, 0) : Slice.empty;
19974
20529
  let parsed = view.someProp("clipboardTextParser", (f) => f(text, $context, plainText, view));
19975
20530
  if (parsed) {
19976
20531
  slice2 = parsed;
@@ -20059,13 +20614,13 @@ function normalizeSiblings(fragment, $context) {
20059
20614
  }
20060
20615
  });
20061
20616
  if (result)
20062
- return Fragment4.from(result);
20617
+ return Fragment5.from(result);
20063
20618
  }
20064
20619
  return fragment;
20065
20620
  }
20066
20621
  function withWrappers(node, wrap2, from2 = 0) {
20067
20622
  for (let i = wrap2.length - 1; i >= from2; i--)
20068
- node = wrap2[i].create(null, Fragment4.from(node));
20623
+ node = wrap2[i].create(null, Fragment5.from(node));
20069
20624
  return node;
20070
20625
  }
20071
20626
  function addToSibling(wrap2, lastWrap, node, sibling, depth) {
@@ -20075,14 +20630,14 @@ function addToSibling(wrap2, lastWrap, node, sibling, depth) {
20075
20630
  return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner));
20076
20631
  let match = sibling.contentMatchAt(sibling.childCount);
20077
20632
  if (match.matchType(depth == wrap2.length - 1 ? node.type : wrap2[depth + 1]))
20078
- return sibling.copy(sibling.content.append(Fragment4.from(withWrappers(node, wrap2, depth + 1))));
20633
+ return sibling.copy(sibling.content.append(Fragment5.from(withWrappers(node, wrap2, depth + 1))));
20079
20634
  }
20080
20635
  }
20081
20636
  function closeRight(node, depth) {
20082
20637
  if (depth == 0)
20083
20638
  return node;
20084
20639
  let fragment = node.content.replaceChild(node.childCount - 1, closeRight(node.lastChild, depth - 1));
20085
- let fill = node.contentMatchAt(node.childCount).fillBefore(Fragment4.empty, true);
20640
+ let fill = node.contentMatchAt(node.childCount).fillBefore(Fragment5.empty, true);
20086
20641
  return node.copy(fragment.append(fill));
20087
20642
  }
20088
20643
  function closeRange(fragment, side, from2, to, depth, openEnd) {
@@ -20092,7 +20647,7 @@ function closeRange(fragment, side, from2, to, depth, openEnd) {
20092
20647
  if (depth < to - 1)
20093
20648
  inner = closeRange(inner, side, from2, to, depth + 1, openEnd);
20094
20649
  if (depth >= from2)
20095
- inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(Fragment4.empty, true));
20650
+ inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(Fragment5.empty, true));
20096
20651
  return fragment.replaceChild(side < 0 ? 0 : fragment.childCount - 1, node.copy(inner));
20097
20652
  }
20098
20653
  function closeSlice(slice2, openStart, openEnd) {
@@ -20162,7 +20717,7 @@ function addContext(slice2, context) {
20162
20717
  let type = schema.nodes[array[i]];
20163
20718
  if (!type || type.hasRequiredAttrs())
20164
20719
  break;
20165
- content = Fragment4.from(type.create(array[i + 1], content));
20720
+ content = Fragment5.from(type.create(array[i + 1], content));
20166
20721
  openStart++;
20167
20722
  openEnd++;
20168
20723
  }
@@ -22023,7 +22578,7 @@ function isMarkChange(cur, prev) {
22023
22578
  let updated = [];
22024
22579
  for (let i = 0; i < prev.childCount; i++)
22025
22580
  updated.push(update(prev.child(i)));
22026
- if (Fragment4.from(updated).eq(cur))
22581
+ if (Fragment5.from(updated).eq(cur))
22027
22582
  return { mark, type };
22028
22583
  }
22029
22584
  function looksLikeBackspace(old, start, end, $newStart, $newEnd) {
@@ -23133,10 +23688,10 @@ function deleteBarrier(state, $cut, dispatch2, dir) {
23133
23688
  let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);
23134
23689
  if (canDelAfter && (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) && match.matchType(conn[0] || after.type).validEnd) {
23135
23690
  if (dispatch2) {
23136
- let end = $cut.pos + after.nodeSize, wrap2 = Fragment4.empty;
23691
+ let end = $cut.pos + after.nodeSize, wrap2 = Fragment5.empty;
23137
23692
  for (let i = conn.length - 1; i >= 0; i--)
23138
- wrap2 = Fragment4.from(conn[i].create(null, wrap2));
23139
- wrap2 = Fragment4.from(before.copy(wrap2));
23693
+ wrap2 = Fragment5.from(conn[i].create(null, wrap2));
23694
+ wrap2 = Fragment5.from(before.copy(wrap2));
23140
23695
  let tr2 = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap2, 1, 0), conn.length, true));
23141
23696
  let $joinAt = tr2.doc.resolve(end + 2 * conn.length);
23142
23697
  if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type && canJoin(tr2.doc, $joinAt.pos))
@@ -23165,9 +23720,9 @@ function deleteBarrier(state, $cut, dispatch2, dir) {
23165
23720
  afterDepth++;
23166
23721
  if (at.canReplace(at.childCount, at.childCount, afterText.content)) {
23167
23722
  if (dispatch2) {
23168
- let end = Fragment4.empty;
23723
+ let end = Fragment5.empty;
23169
23724
  for (let i = wrap2.length - 1; i >= 0; i--)
23170
- end = Fragment4.from(wrap2[i].copy(end));
23725
+ end = Fragment5.from(wrap2[i].copy(end));
23171
23726
  let tr2 = state.tr.step(new ReplaceAroundStep($cut.pos - wrap2.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end, wrap2.length, 0), 0, true));
23172
23727
  dispatch2(tr2.scrollIntoView());
23173
23728
  }
@@ -23272,9 +23827,9 @@ function wrapRangeInList(tr2, range, listType, attrs = null) {
23272
23827
  return true;
23273
23828
  }
23274
23829
  function doWrapInList(tr2, range, wrappers, joinBefore, listType) {
23275
- let content = Fragment4.empty;
23830
+ let content = Fragment5.empty;
23276
23831
  for (let i = wrappers.length - 1; i >= 0; i--)
23277
- content = Fragment4.from(wrappers[i].type.create(wrappers[i].attrs, content));
23832
+ content = Fragment5.from(wrappers[i].type.create(wrappers[i].attrs, content));
23278
23833
  tr2.step(new ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new Slice(content, 0, 0), wrappers.length, true));
23279
23834
  let found2 = 0;
23280
23835
  for (let i = 0; i < wrappers.length; i++)
@@ -23308,7 +23863,7 @@ function liftListItem(itemType) {
23308
23863
  function liftToOuterList(state, dispatch2, itemType, range) {
23309
23864
  let tr2 = state.tr, end = range.end, endOfList = range.$to.end(range.depth);
23310
23865
  if (end < endOfList) {
23311
- tr2.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment4.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
23866
+ tr2.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment5.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
23312
23867
  range = new NodeRange(tr2.doc.resolve(range.$from.pos), tr2.doc.resolve(endOfList), range.depth);
23313
23868
  }
23314
23869
  const target = liftTarget(range);
@@ -23332,10 +23887,10 @@ function liftOutOfList(state, dispatch2, range) {
23332
23887
  return false;
23333
23888
  let atStart = range.startIndex == 0, atEnd = range.endIndex == list.childCount;
23334
23889
  let parent = $start.node(-1), indexBefore = $start.index(-1);
23335
- if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment4.empty : Fragment4.from(list))))
23890
+ if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment5.empty : Fragment5.from(list))))
23336
23891
  return false;
23337
23892
  let start = $start.pos, end = start + item.nodeSize;
23338
- tr2.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment4.empty : Fragment4.from(list.copy(Fragment4.empty))).append(atEnd ? Fragment4.empty : Fragment4.from(list.copy(Fragment4.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
23893
+ tr2.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment5.empty : Fragment5.from(list.copy(Fragment5.empty))).append(atEnd ? Fragment5.empty : Fragment5.from(list.copy(Fragment5.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
23339
23894
  dispatch2(tr2.scrollIntoView());
23340
23895
  return true;
23341
23896
  }
@@ -23353,8 +23908,8 @@ function sinkListItem(itemType) {
23353
23908
  return false;
23354
23909
  if (dispatch2) {
23355
23910
  let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
23356
- let inner = Fragment4.from(nestedBefore ? itemType.create() : null);
23357
- let slice2 = new Slice(Fragment4.from(itemType.create(null, Fragment4.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
23911
+ let inner = Fragment5.from(nestedBefore ? itemType.create() : null);
23912
+ let slice2 = new Slice(Fragment5.from(itemType.create(null, Fragment5.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
23358
23913
  let before = range.start, after = range.end;
23359
23914
  dispatch2(state.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice2, 1, true)).scrollIntoView());
23360
23915
  }
@@ -23572,7 +24127,7 @@ function elementFromString(value) {
23572
24127
  return removeWhitespaces(html);
23573
24128
  }
23574
24129
  function createNodeFromContent(content, schema, options) {
23575
- if (content instanceof Node2 || content instanceof Fragment4) {
24130
+ if (content instanceof Node2 || content instanceof Fragment5) {
23576
24131
  return content;
23577
24132
  }
23578
24133
  options = {
@@ -23586,7 +24141,7 @@ function createNodeFromContent(content, schema, options) {
23586
24141
  try {
23587
24142
  const isArrayContent = Array.isArray(content) && content.length > 0;
23588
24143
  if (isArrayContent) {
23589
- return Fragment4.fromArray(content.map((item) => schema.nodeFromJSON(item)));
24144
+ return Fragment5.fromArray(content.map((item) => schema.nodeFromJSON(item)));
23590
24145
  }
23591
24146
  const node = schema.nodeFromJSON(content);
23592
24147
  if (options.errorOnInvalidContent) {
@@ -24720,7 +25275,7 @@ function inputRulesPlugin(props) {
24720
25275
  if (typeof text === "string") {
24721
25276
  text = text;
24722
25277
  } else {
24723
- text = getHTMLFromFragment(Fragment4.from(text), state.schema);
25278
+ text = getHTMLFromFragment(Fragment5.from(text), state.schema);
24724
25279
  }
24725
25280
  const { from: from2 } = simulatedInputMeta;
24726
25281
  const to = from2 + text.length;
@@ -25098,7 +25653,7 @@ function pasteRulesPlugin(props) {
25098
25653
  if (typeof text === "string") {
25099
25654
  text = text;
25100
25655
  } else {
25101
- text = getHTMLFromFragment(Fragment4.from(text), state.schema);
25656
+ text = getHTMLFromFragment(Fragment5.from(text), state.schema);
25102
25657
  }
25103
25658
  const { from: from22 } = simulatedPasteMeta;
25104
25659
  const to2 = from22 + text.length;
@@ -25756,7 +26311,7 @@ var insertContentAt = (position, value, options) => ({ tr: tr2, dispatch: dispat
25756
26311
  if (isOnlyTextContent) {
25757
26312
  if (Array.isArray(value)) {
25758
26313
  newContent = value.map((v) => v.text || "").join("");
25759
- } else if (value instanceof Fragment4) {
26314
+ } else if (value instanceof Fragment5) {
25760
26315
  let text = "";
25761
26316
  value.forEach((node) => {
25762
26317
  if (node.text) {
@@ -26223,10 +26778,10 @@ var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr: tr2, state, dispa
26223
26778
  return false;
26224
26779
  }
26225
26780
  if (dispatch2) {
26226
- let wrap2 = Fragment4.empty;
26781
+ let wrap2 = Fragment5.empty;
26227
26782
  const depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
26228
26783
  for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d -= 1) {
26229
- wrap2 = Fragment4.from($from.node(d).copy(wrap2));
26784
+ wrap2 = Fragment5.from($from.node(d).copy(wrap2));
26230
26785
  }
26231
26786
  const depthAfter = (
26232
26787
  // eslint-disable-next-line no-nested-ternary
@@ -26237,7 +26792,7 @@ var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr: tr2, state, dispa
26237
26792
  ...overrideAttrs
26238
26793
  };
26239
26794
  const nextType2 = ((_a = type.contentMatch.defaultType) == null ? void 0 : _a.createAndFill(newNextTypeAttributes2)) || void 0;
26240
- wrap2 = wrap2.append(Fragment4.from(type.createAndFill(null, nextType2) || void 0));
26795
+ wrap2 = wrap2.append(Fragment5.from(type.createAndFill(null, nextType2) || void 0));
26241
26796
  const start = $from.before($from.depth - (depthBefore - 1));
26242
26797
  tr2.replace(start, $from.after(-depthAfter), new Slice(wrap2, 4 - depthBefore, 0));
26243
26798
  let sel = -1;
@@ -28366,11 +28921,11 @@ var ReactNodeViewContext = createContext({
28366
28921
  var useReactNodeView = () => useContext(ReactNodeViewContext);
28367
28922
  t__default.forwardRef((props, ref) => {
28368
28923
  const { onDragStart } = useReactNodeView();
28369
- const Tag = props.as || "div";
28924
+ const Tag2 = props.as || "div";
28370
28925
  return (
28371
28926
  // @ts-ignore
28372
28927
  /* @__PURE__ */ jsx(
28373
- Tag,
28928
+ Tag2,
28374
28929
  {
28375
28930
  ...props,
28376
28931
  ref,
@@ -31683,9 +32238,9 @@ function beforeinput(view, event) {
31683
32238
  let insert = $from.parent.contentMatchAt($from.index()).findWrapping(view.state.schema.nodes.text);
31684
32239
  if (!insert)
31685
32240
  return false;
31686
- let frag = Fragment4.empty;
32241
+ let frag = Fragment5.empty;
31687
32242
  for (let i = insert.length - 1; i >= 0; i--)
31688
- frag = Fragment4.from(insert[i].createAndFill(null, frag));
32243
+ frag = Fragment5.from(insert[i].createAndFill(null, frag));
31689
32244
  let tr2 = view.state.tr.replace($from.pos, $from.pos, new Slice(frag, 0, 0));
31690
32245
  tr2.setSelection(TextSelection.near(tr2.doc.resolve($from.pos + 1)));
31691
32246
  view.dispatch(tr2);
@@ -32810,7 +33365,7 @@ var index_default7 = Highlight;
32810
33365
 
32811
33366
  // ../../node_modules/@tiptap/extension-image/dist/index.js
32812
33367
  var inputRegex6 = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;
32813
- var Image3 = Node3.create({
33368
+ var Image4 = Node3.create({
32814
33369
  name: "image",
32815
33370
  addOptions() {
32816
33371
  return {
@@ -32878,7 +33433,7 @@ var Image3 = Node3.create({
32878
33433
  ];
32879
33434
  }
32880
33435
  });
32881
- var index_default8 = Image3;
33436
+ var index_default8 = Image4;
32882
33437
 
32883
33438
  // ../../node_modules/prosemirror-tables/dist/index.js
32884
33439
  var readFromCache;
@@ -33365,10 +33920,10 @@ var CellSelection = class _CellSelection extends Selection {
33365
33920
  }
33366
33921
  rowContent.push(cell);
33367
33922
  }
33368
- rows.push(table.child(row).copy(Fragment4.from(rowContent)));
33923
+ rows.push(table.child(row).copy(Fragment5.from(rowContent)));
33369
33924
  }
33370
33925
  const fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
33371
- return new Slice(Fragment4.from(fragment), 1, 1);
33926
+ return new Slice(Fragment5.from(fragment), 1, 1);
33372
33927
  }
33373
33928
  replace(tr2, content = Slice.empty) {
33374
33929
  const mapFrom = tr2.steps.length, ranges = this.ranges;
@@ -33388,7 +33943,7 @@ var CellSelection = class _CellSelection extends Selection {
33388
33943
  tr2.setSelection(sel);
33389
33944
  }
33390
33945
  replaceWith(tr2, node) {
33391
- this.replace(tr2, new Slice(Fragment4.from(node), 0, 0));
33946
+ this.replace(tr2, new Slice(Fragment5.from(node), 0, 0));
33392
33947
  }
33393
33948
  forEachCell(f) {
33394
33949
  const table = this.$anchorCell.node(-1);
@@ -33936,7 +34491,7 @@ function mergeCells(state, dispatch2) {
33936
34491
  if (dispatch2) {
33937
34492
  const tr2 = state.tr;
33938
34493
  const seen = {};
33939
- let content = Fragment4.empty;
34494
+ let content = Fragment5.empty;
33940
34495
  let mergedPos;
33941
34496
  let mergedCell;
33942
34497
  for (let row = rect.top; row < rect.bottom; row++) {
@@ -34317,14 +34872,14 @@ function ensureRectangular(schema, rows) {
34317
34872
  width = Math.max(width, widths[r2]);
34318
34873
  for (let r2 = 0; r2 < widths.length; r2++) {
34319
34874
  if (r2 >= rows.length)
34320
- rows.push(Fragment4.empty);
34875
+ rows.push(Fragment5.empty);
34321
34876
  if (widths[r2] < width) {
34322
34877
  const empty2 = tableNodeTypes(schema).cell.createAndFill();
34323
34878
  const cells = [];
34324
34879
  for (let i = widths[r2]; i < width; i++) {
34325
34880
  cells.push(empty2);
34326
34881
  }
34327
- rows[r2] = rows[r2].append(Fragment4.from(cells));
34882
+ rows[r2] = rows[r2].append(Fragment5.from(cells));
34328
34883
  }
34329
34884
  }
34330
34885
  return { height: rows.length, width, rows };
@@ -34356,7 +34911,7 @@ function clipCells({ width, height, rows }, newWidth, newHeight) {
34356
34911
  for (let j = 1; j < cell.attrs.rowspan; j++)
34357
34912
  added[row + j] = (added[row + j] || 0) + cell.attrs.colspan;
34358
34913
  }
34359
- newRows.push(Fragment4.from(cells));
34914
+ newRows.push(Fragment5.from(cells));
34360
34915
  }
34361
34916
  rows = newRows;
34362
34917
  width = newWidth;
@@ -34377,7 +34932,7 @@ function clipCells({ width, height, rows }, newWidth, newHeight) {
34377
34932
  );
34378
34933
  cells.push(cell);
34379
34934
  }
34380
- newRows.push(Fragment4.from(cells));
34935
+ newRows.push(Fragment5.from(cells));
34381
34936
  }
34382
34937
  rows = newRows;
34383
34938
  height = newHeight;
@@ -34412,7 +34967,7 @@ function growTable(tr2, map2, table, start, width, height, mapFrom) {
34412
34967
  header ? emptyHead || (emptyHead = types.header_cell.createAndFill()) : empty2 || (empty2 = types.cell.createAndFill())
34413
34968
  );
34414
34969
  }
34415
- const emptyRow = types.row.create(null, Fragment4.from(cells)), rows = [];
34970
+ const emptyRow = types.row.create(null, Fragment5.from(cells)), rows = [];
34416
34971
  for (let i = map2.height; i < height; i++)
34417
34972
  rows.push(emptyRow);
34418
34973
  tr2.insert(tr2.mapping.slice(mapFrom).map(start + table.nodeSize - 2), rows);
@@ -34621,7 +35176,7 @@ function handlePaste(view, _, slice2) {
34621
35176
  width: 1,
34622
35177
  height: 1,
34623
35178
  rows: [
34624
- Fragment4.from(
35179
+ Fragment5.from(
34625
35180
  fitSlice(tableNodeTypes(view.state.schema).cell, slice2)
34626
35181
  )
34627
35182
  ]
@@ -52783,7 +53338,7 @@ function Timeline({
52783
53338
  interactive = true
52784
53339
  }) {
52785
53340
  const sortedEvents = [...events].sort((a, b) => b.date.getTime() - a.date.getTime());
52786
- const formatDate = (date) => {
53341
+ const formatDate2 = (date) => {
52787
53342
  return date.toLocaleDateString("en-US", {
52788
53343
  year: "numeric",
52789
53344
  month: "long",
@@ -52812,16 +53367,16 @@ function Timeline({
52812
53367
  const days = Math.floor(diffInSeconds / 86400);
52813
53368
  return `${days} day${days > 1 ? "s" : ""} ago`;
52814
53369
  } else {
52815
- return formatDate(date);
53370
+ return formatDate2(date);
52816
53371
  }
52817
53372
  };
52818
- const getInitials = (name) => {
53373
+ const getInitials2 = (name) => {
52819
53374
  return name.split(" ").map((n) => n[0]).join("").toUpperCase();
52820
53375
  };
52821
53376
  const groupEventsByDate = (events2) => {
52822
53377
  const groups = {};
52823
53378
  events2.forEach((event) => {
52824
- const dateKey = formatDate(event.date);
53379
+ const dateKey = formatDate2(event.date);
52825
53380
  if (!groups[dateKey]) {
52826
53381
  groups[dateKey] = [];
52827
53382
  }
@@ -52875,7 +53430,7 @@ function Timeline({
52875
53430
  showUserInfo && event.user && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
52876
53431
  /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-6 w-6", children: [
52877
53432
  /* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: event.user.avatar }),
52878
- /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(event.user.name) })
53433
+ /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials2(event.user.name) })
52879
53434
  ] }),
52880
53435
  /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: event.user.name })
52881
53436
  ] }),
@@ -56678,7 +57233,7 @@ var GitHubStarsInternal = ({
56678
57233
  }
56679
57234
  return num.toString();
56680
57235
  };
56681
- const formatDate = (dateString) => {
57236
+ const formatDate2 = (dateString) => {
56682
57237
  const date = new Date(dateString);
56683
57238
  return date.toLocaleDateString("en-US", {
56684
57239
  year: "numeric",
@@ -56828,7 +57383,7 @@ var GitHubStarsInternal = ({
56828
57383
  ] }),
56829
57384
  /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground", children: [
56830
57385
  "Updated ",
56831
- formatDate(repo.updated_at)
57386
+ formatDate2(repo.updated_at)
56832
57387
  ] })
56833
57388
  ] }) })
56834
57389
  }
@@ -58712,6 +59267,24 @@ var PerformanceMonitor = ({ className, ...props }) => {
58712
59267
  }
58713
59268
  return /* @__PURE__ */ jsx(PerformanceMonitorInternal, { className, ...props });
58714
59269
  };
59270
+
59271
+ // src/use-toast.ts
59272
+ function toast2(options) {
59273
+ console.log("Toast:", options);
59274
+ if (typeof window !== "undefined") {
59275
+ const message = options.description ? `${options.title}
59276
+
59277
+ ${options.description}` : options.title;
59278
+ if (options.variant === "destructive") {
59279
+ console.error(message);
59280
+ } else {
59281
+ console.log(message);
59282
+ }
59283
+ }
59284
+ }
59285
+ var useToast = () => {
59286
+ return { toast: toast2 };
59287
+ };
58715
59288
  var fileUploadVariants = cva(
58716
59289
  "relative overflow-hidden transition-all duration-200",
58717
59290
  {
@@ -59685,6 +60258,7 @@ var FileUploadItem = ({
59685
60258
  onPauseResume,
59686
60259
  onPreview
59687
60260
  }) => {
60261
+ const { toast: toast3 } = useToast();
59688
60262
  const canPauseResume = resumable && ["uploading", "paused"].includes(file.status);
59689
60263
  const canPreview = showPreview && file.preview && ["image", "video", "audio"].includes(file.preview.type);
59690
60264
  return /* @__PURE__ */ jsxs(
@@ -59702,18 +60276,27 @@ var FileUploadItem = ({
59702
60276
  variant === "grid" && "p-4"
59703
60277
  ),
59704
60278
  children: [
59705
- allowBulkOperations && /* @__PURE__ */ jsx("div", { className: "absolute top-3 left-3 z-10", children: /* @__PURE__ */ jsx(
60279
+ allowBulkOperations && variant === "grid" && /* @__PURE__ */ jsx("div", { className: "absolute top-3 left-3 z-10", children: /* @__PURE__ */ jsx(
59706
60280
  "input",
59707
60281
  {
59708
60282
  type: "checkbox",
59709
60283
  checked: selected,
59710
60284
  onChange: (e) => onSelect?.(e.target.checked),
59711
- className: "rounded border-muted-foreground/25"
60285
+ className: "rounded border-muted-foreground/25 h-4 w-4"
59712
60286
  }
59713
60287
  ) }),
60288
+ allowBulkOperations && variant !== "grid" && /* @__PURE__ */ jsx(
60289
+ "input",
60290
+ {
60291
+ type: "checkbox",
60292
+ checked: selected,
60293
+ onChange: (e) => onSelect?.(e.target.checked),
60294
+ className: "rounded border-muted-foreground/25 h-4 w-4 mt-1 mr-3 float-left"
60295
+ }
60296
+ ),
59714
60297
  showPreview && file.preview && /* @__PURE__ */ jsxs("div", { className: cn(
59715
60298
  "relative overflow-hidden rounded bg-muted/20",
59716
- variant === "grid" ? "aspect-video mb-3" : "w-12 h-12 float-left mr-3"
60299
+ variant === "grid" ? "aspect-video mb-3" : variant === "compact" ? "w-10 h-10 float-left mr-2" : "w-12 h-12 float-left mr-3"
59717
60300
  ), children: [
59718
60301
  file.preview.type === "image" && file.preview.thumbnail && /* @__PURE__ */ jsx(
59719
60302
  "img",
@@ -59748,10 +60331,10 @@ var FileUploadItem = ({
59748
60331
  ] }),
59749
60332
  /* @__PURE__ */ jsxs("div", { className: cn(
59750
60333
  "flex-1 min-w-0",
59751
- variant === "grid" && "text-center"
60334
+ variant === "grid" ? "text-center w-full" : "overflow-hidden"
59752
60335
  ), children: [
59753
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
59754
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
60336
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
60337
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
59755
60338
  /* @__PURE__ */ jsx("h5", { className: cn(
59756
60339
  "font-medium truncate",
59757
60340
  variant === "compact" ? "text-sm" : "text-base"
@@ -59780,13 +60363,17 @@ var FileUploadItem = ({
59780
60363
  MoonUIBadgePro,
59781
60364
  {
59782
60365
  variant: file.status === "success" ? "success" : file.status === "error" ? "destructive" : file.status === "paused" ? "secondary" : "secondary",
59783
- className: "flex-shrink-0",
60366
+ size: variant === "compact" ? "sm" : "md",
60367
+ className: cn(
60368
+ "flex-shrink-0 whitespace-nowrap min-w-fit",
60369
+ file.status === "success" && "bg-green-500 hover:bg-green-600 text-white border-transparent"
60370
+ ),
59784
60371
  children: [
59785
- file.status === "uploading" && /* @__PURE__ */ jsx(Loader2, { className: "h-3 w-3 mr-1 animate-spin" }),
59786
- file.status === "success" && /* @__PURE__ */ jsx(CheckCircle2, { className: "h-3 w-3 mr-1" }),
59787
- file.status === "error" && /* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3 mr-1" }),
59788
- file.status === "paused" && /* @__PURE__ */ jsx(Pause, { className: "h-3 w-3 mr-1" }),
59789
- file.status === "pending" ? "Pending" : file.status === "uploading" ? "Uploading" : file.status === "paused" ? "Paused" : file.status === "success" ? "Completed" : file.status === "error" ? "Error" : "Cancelled"
60372
+ file.status === "uploading" && /* @__PURE__ */ jsx(Loader2, { className: cn("h-3 w-3 animate-spin flex-shrink-0", variant !== "compact" && "mr-1") }),
60373
+ file.status === "success" && /* @__PURE__ */ jsx(CheckCircle2, { className: cn("h-3 w-3 flex-shrink-0", variant !== "compact" && "mr-1") }),
60374
+ file.status === "error" && /* @__PURE__ */ jsx(AlertCircle, { className: cn("h-3 w-3 flex-shrink-0", variant !== "compact" && "mr-1") }),
60375
+ file.status === "paused" && /* @__PURE__ */ jsx(Pause, { className: cn("h-3 w-3 flex-shrink-0", variant !== "compact" && "mr-1") }),
60376
+ variant !== "compact" && (file.status === "pending" ? "Pending" : file.status === "uploading" ? "Uploading" : file.status === "paused" ? "Paused" : file.status === "success" ? "Done" : file.status === "error" ? "Error" : "Cancelled")
59790
60377
  ]
59791
60378
  }
59792
60379
  )
@@ -59810,7 +60397,7 @@ var FileUploadItem = ({
59810
60397
  ] }),
59811
60398
  file.status === "error" && file.error && /* @__PURE__ */ jsx("p", { className: "mt-2 text-xs text-destructive", children: file.error }),
59812
60399
  /* @__PURE__ */ jsxs("div", { className: cn(
59813
- "flex items-center gap-1 mt-3",
60400
+ "flex items-center gap-1 mt-3 clear-both",
59814
60401
  variant === "grid" && "justify-center"
59815
60402
  ), children: [
59816
60403
  canPauseResume && /* @__PURE__ */ jsx(
@@ -59839,6 +60426,12 @@ var FileUploadItem = ({
59839
60426
  variant: "ghost",
59840
60427
  size: "sm",
59841
60428
  className: "h-7 px-2",
60429
+ onClick: () => {
60430
+ const link = document.createElement("a");
60431
+ link.href = file.preview?.url || URL.createObjectURL(file.file);
60432
+ link.download = file.file.name;
60433
+ link.click();
60434
+ },
59842
60435
  children: /* @__PURE__ */ jsx(Download, { className: "h-3 w-3" })
59843
60436
  }
59844
60437
  ),
@@ -59849,11 +60442,38 @@ var FileUploadItem = ({
59849
60442
  /* @__PURE__ */ jsx(Eye, { className: "mr-2 h-4 w-4" }),
59850
60443
  "Preview"
59851
60444
  ] }),
59852
- /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
60445
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: async () => {
60446
+ try {
60447
+ const url = file.result?.url || file.preview?.url || URL.createObjectURL(file.file);
60448
+ await navigator.clipboard.writeText(url);
60449
+ toast3({
60450
+ title: "Link copied",
60451
+ description: "File link has been copied to clipboard"
60452
+ });
60453
+ } catch (err) {
60454
+ console.error("Failed to copy link:", err);
60455
+ toast3({
60456
+ title: "Failed to copy",
60457
+ description: "Could not copy link to clipboard",
60458
+ variant: "destructive"
60459
+ });
60460
+ }
60461
+ }, children: [
59853
60462
  /* @__PURE__ */ jsx(Copy, { className: "mr-2 h-4 w-4" }),
59854
60463
  "Copy Link"
59855
60464
  ] }),
59856
- /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
60465
+ navigator.share && /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: async () => {
60466
+ try {
60467
+ await navigator.share({
60468
+ title: file.file.name,
60469
+ text: `Check out this file: ${file.file.name}`,
60470
+ url: file.result?.url || file.preview?.url || window.location.href,
60471
+ files: [file.file]
60472
+ });
60473
+ } catch (err) {
60474
+ console.log("Share cancelled or failed:", err);
60475
+ }
60476
+ }, children: [
59857
60477
  /* @__PURE__ */ jsx(Share, { className: "mr-2 h-4 w-4" }),
59858
60478
  "Share"
59859
60479
  ] }),