@moontra/moonui-pro 2.12.0 → 2.13.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.d.ts +2 -1
- package/dist/index.mjs +1475 -155
- package/package.json +1 -1
- package/src/components/index.ts +2 -1
- package/src/components/kanban/add-card-modal.tsx +502 -0
- package/src/components/kanban/card-detail-modal.tsx +769 -0
- package/src/components/kanban/index.ts +13 -0
- package/src/components/kanban/{index.tsx → kanban.tsx} +393 -133
- package/src/components/kanban/types.ts +111 -0
- package/src/hooks/use-toast.ts +15 -0
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
3
3
|
import * as t from 'react';
|
|
4
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, 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,
|
|
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, Activity, Send, MessageCircle, Tag, MoreVertical, Paperclip, ExternalLink, CalendarIcon, DollarSign, Users, Github, GitFork, Server, RotateCw, Cpu, MemoryStick, HardDrive, Network, BarChart3, Columns, Flag, 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';
|
|
@@ -4054,7 +4054,7 @@ var me = t.forwardRef((r2, o) => {
|
|
|
4054
4054
|
var e;
|
|
4055
4055
|
return Array.from(((e = I.current) == null ? void 0 : e.querySelectorAll(ce)) || []);
|
|
4056
4056
|
}
|
|
4057
|
-
function
|
|
4057
|
+
function X22(e) {
|
|
4058
4058
|
let s = V()[e];
|
|
4059
4059
|
s && E.setState("value", s.getAttribute(T));
|
|
4060
4060
|
}
|
|
@@ -4069,10 +4069,10 @@ var me = t.forwardRef((r2, o) => {
|
|
|
4069
4069
|
s = e > 0 ? we(s, N) : De(s, N), i = s == null ? void 0 : s.querySelector(ce);
|
|
4070
4070
|
i ? E.setState("value", i.getAttribute(T)) : Q(e);
|
|
4071
4071
|
}
|
|
4072
|
-
let oe = () =>
|
|
4072
|
+
let oe = () => X22(V().length - 1), ie3 = (e) => {
|
|
4073
4073
|
e.preventDefault(), e.metaKey ? oe() : e.altKey ? re(1) : Q(1);
|
|
4074
4074
|
}, se = (e) => {
|
|
4075
|
-
e.preventDefault(), e.metaKey ?
|
|
4075
|
+
e.preventDefault(), e.metaKey ? X22(0) : e.altKey ? re(-1) : Q(-1);
|
|
4076
4076
|
};
|
|
4077
4077
|
return t.createElement(Primitive2.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
|
|
4078
4078
|
var s;
|
|
@@ -4099,7 +4099,7 @@ var me = t.forwardRef((r2, o) => {
|
|
|
4099
4099
|
break;
|
|
4100
4100
|
}
|
|
4101
4101
|
case "Home": {
|
|
4102
|
-
e.preventDefault(),
|
|
4102
|
+
e.preventDefault(), X22(0);
|
|
4103
4103
|
break;
|
|
4104
4104
|
}
|
|
4105
4105
|
case "End": {
|
|
@@ -11121,6 +11121,1002 @@ function Calendar3({
|
|
|
11121
11121
|
)
|
|
11122
11122
|
] });
|
|
11123
11123
|
}
|
|
11124
|
+
var PRIORITY_OPTIONS = [
|
|
11125
|
+
{ value: "low", label: "Low", icon: Flag, color: "text-green-600" },
|
|
11126
|
+
{ value: "medium", label: "Medium", icon: Flag, color: "text-yellow-600" },
|
|
11127
|
+
{ value: "high", label: "High", icon: Flag, color: "text-orange-600" },
|
|
11128
|
+
{ value: "urgent", label: "Urgent", icon: AlertCircle, color: "text-red-600" }
|
|
11129
|
+
];
|
|
11130
|
+
var formatFileSize = (bytes) => {
|
|
11131
|
+
if (bytes === 0)
|
|
11132
|
+
return "0 Bytes";
|
|
11133
|
+
const k3 = 1024;
|
|
11134
|
+
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
11135
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k3));
|
|
11136
|
+
return parseFloat((bytes / Math.pow(k3, i)).toFixed(2)) + " " + sizes[i];
|
|
11137
|
+
};
|
|
11138
|
+
var getInitials = (name) => {
|
|
11139
|
+
return name.split(" ").map((n) => n[0]).join("").toUpperCase();
|
|
11140
|
+
};
|
|
11141
|
+
function CardDetailModal({
|
|
11142
|
+
card: initialCard,
|
|
11143
|
+
isOpen,
|
|
11144
|
+
onClose,
|
|
11145
|
+
onUpdate,
|
|
11146
|
+
onDelete,
|
|
11147
|
+
availableAssignees = [],
|
|
11148
|
+
availableLabels = [],
|
|
11149
|
+
currentColumn,
|
|
11150
|
+
availableColumns = []
|
|
11151
|
+
}) {
|
|
11152
|
+
const [card, setCard] = useState(initialCard);
|
|
11153
|
+
const [isEditingTitle, setIsEditingTitle] = useState(false);
|
|
11154
|
+
const [isEditingDescription, setIsEditingDescription] = useState(false);
|
|
11155
|
+
const [newComment, setNewComment] = useState("");
|
|
11156
|
+
const [newChecklistItem, setNewChecklistItem] = useState("");
|
|
11157
|
+
const [selectedTab, setSelectedTab] = useState("overview");
|
|
11158
|
+
useEffect(() => {
|
|
11159
|
+
setCard(initialCard);
|
|
11160
|
+
}, [initialCard]);
|
|
11161
|
+
const updateCard = (updates) => {
|
|
11162
|
+
const updatedCard = { ...card, ...updates };
|
|
11163
|
+
setCard(updatedCard);
|
|
11164
|
+
onUpdate(updatedCard);
|
|
11165
|
+
};
|
|
11166
|
+
const addComment = () => {
|
|
11167
|
+
if (!newComment.trim())
|
|
11168
|
+
return;
|
|
11169
|
+
const newActivity = {
|
|
11170
|
+
id: Date.now().toString(),
|
|
11171
|
+
user: {
|
|
11172
|
+
id: "current-user",
|
|
11173
|
+
name: "Current User",
|
|
11174
|
+
email: "user@example.com"
|
|
11175
|
+
},
|
|
11176
|
+
action: "commented",
|
|
11177
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
11178
|
+
details: newComment
|
|
11179
|
+
};
|
|
11180
|
+
updateCard({
|
|
11181
|
+
activities: [newActivity, ...card.activities || []],
|
|
11182
|
+
comments: (card.comments || 0) + 1
|
|
11183
|
+
});
|
|
11184
|
+
setNewComment("");
|
|
11185
|
+
};
|
|
11186
|
+
const addChecklistItem = () => {
|
|
11187
|
+
if (!newChecklistItem.trim())
|
|
11188
|
+
return;
|
|
11189
|
+
const checklist = card.checklist || {
|
|
11190
|
+
id: Date.now().toString(),
|
|
11191
|
+
title: "Checklist",
|
|
11192
|
+
items: []
|
|
11193
|
+
};
|
|
11194
|
+
checklist.items.push({
|
|
11195
|
+
id: Date.now().toString(),
|
|
11196
|
+
text: newChecklistItem,
|
|
11197
|
+
completed: false
|
|
11198
|
+
});
|
|
11199
|
+
updateCard({ checklist });
|
|
11200
|
+
setNewChecklistItem("");
|
|
11201
|
+
};
|
|
11202
|
+
const toggleChecklistItem = (itemId) => {
|
|
11203
|
+
if (!card.checklist)
|
|
11204
|
+
return;
|
|
11205
|
+
const updatedChecklist = {
|
|
11206
|
+
...card.checklist,
|
|
11207
|
+
items: card.checklist.items.map(
|
|
11208
|
+
(item) => item.id === itemId ? { ...item, completed: !item.completed } : item
|
|
11209
|
+
)
|
|
11210
|
+
};
|
|
11211
|
+
updateCard({ checklist: updatedChecklist });
|
|
11212
|
+
};
|
|
11213
|
+
const deleteChecklistItem = (itemId) => {
|
|
11214
|
+
if (!card.checklist)
|
|
11215
|
+
return;
|
|
11216
|
+
const updatedChecklist = {
|
|
11217
|
+
...card.checklist,
|
|
11218
|
+
items: card.checklist.items.filter((item) => item.id !== itemId)
|
|
11219
|
+
};
|
|
11220
|
+
updateCard({ checklist: updatedChecklist });
|
|
11221
|
+
};
|
|
11222
|
+
const completedChecklistItems = card.checklist?.items.filter((item) => item.completed).length || 0;
|
|
11223
|
+
const totalChecklistItems = card.checklist?.items.length || 0;
|
|
11224
|
+
const checklistProgress = totalChecklistItems > 0 ? completedChecklistItems / totalChecklistItems * 100 : 0;
|
|
11225
|
+
const handleFileUpload = (e) => {
|
|
11226
|
+
const files = e.target.files;
|
|
11227
|
+
if (!files)
|
|
11228
|
+
return;
|
|
11229
|
+
const newAttachments = Array.from(files).map((file) => ({
|
|
11230
|
+
id: Date.now().toString() + Math.random(),
|
|
11231
|
+
name: file.name,
|
|
11232
|
+
type: file.type,
|
|
11233
|
+
url: URL.createObjectURL(file),
|
|
11234
|
+
size: file.size
|
|
11235
|
+
}));
|
|
11236
|
+
updateCard({
|
|
11237
|
+
attachments: [...card.attachments || [], ...newAttachments]
|
|
11238
|
+
});
|
|
11239
|
+
};
|
|
11240
|
+
const removeAttachment = (attachmentId) => {
|
|
11241
|
+
updateCard({
|
|
11242
|
+
attachments: card.attachments?.filter((a) => a.id !== attachmentId)
|
|
11243
|
+
});
|
|
11244
|
+
};
|
|
11245
|
+
return /* @__PURE__ */ jsx(MoonUIDialogPro, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxs(MoonUIDialogContentPro, { className: "max-w-4xl max-h-[90vh] overflow-hidden p-0", children: [
|
|
11246
|
+
/* @__PURE__ */ jsx("div", { className: "p-6 pb-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
11247
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
11248
|
+
isEditingTitle ? /* @__PURE__ */ jsx(
|
|
11249
|
+
MoonUIInputPro,
|
|
11250
|
+
{
|
|
11251
|
+
value: card.title,
|
|
11252
|
+
onChange: (e) => updateCard({ title: e.target.value }),
|
|
11253
|
+
onBlur: () => setIsEditingTitle(false),
|
|
11254
|
+
onKeyDown: (e) => {
|
|
11255
|
+
if (e.key === "Enter")
|
|
11256
|
+
setIsEditingTitle(false);
|
|
11257
|
+
if (e.key === "Escape") {
|
|
11258
|
+
setCard(initialCard);
|
|
11259
|
+
setIsEditingTitle(false);
|
|
11260
|
+
}
|
|
11261
|
+
},
|
|
11262
|
+
className: "text-xl font-semibold",
|
|
11263
|
+
autoFocus: true
|
|
11264
|
+
}
|
|
11265
|
+
) : /* @__PURE__ */ jsx(
|
|
11266
|
+
"h2",
|
|
11267
|
+
{
|
|
11268
|
+
className: "text-xl font-semibold cursor-pointer hover:bg-muted rounded px-2 -mx-2 py-1",
|
|
11269
|
+
onClick: () => setIsEditingTitle(true),
|
|
11270
|
+
children: card.title
|
|
11271
|
+
}
|
|
11272
|
+
),
|
|
11273
|
+
currentColumn && /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground mt-1", children: [
|
|
11274
|
+
"in ",
|
|
11275
|
+
currentColumn
|
|
11276
|
+
] })
|
|
11277
|
+
] }),
|
|
11278
|
+
/* @__PURE__ */ jsx(
|
|
11279
|
+
MoonUIButtonPro,
|
|
11280
|
+
{
|
|
11281
|
+
variant: "ghost",
|
|
11282
|
+
size: "icon",
|
|
11283
|
+
onClick: onClose,
|
|
11284
|
+
className: "h-8 w-8",
|
|
11285
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
11286
|
+
}
|
|
11287
|
+
)
|
|
11288
|
+
] }) }),
|
|
11289
|
+
/* @__PURE__ */ jsxs(MoonUITabsPro, { value: selectedTab, onValueChange: setSelectedTab, className: "flex-1", children: [
|
|
11290
|
+
/* @__PURE__ */ jsx("div", { className: "px-6 pt-4", children: /* @__PURE__ */ jsxs(MoonUITabsListPro, { children: [
|
|
11291
|
+
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "overview", children: "Overview" }),
|
|
11292
|
+
/* @__PURE__ */ jsxs(MoonUITabsTriggerPro, { value: "activity", children: [
|
|
11293
|
+
"Activity",
|
|
11294
|
+
card.activities && card.activities.length > 0 && /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "ml-2", children: card.activities.length })
|
|
11295
|
+
] }),
|
|
11296
|
+
/* @__PURE__ */ jsxs(MoonUITabsTriggerPro, { value: "comments", children: [
|
|
11297
|
+
"Comments",
|
|
11298
|
+
card.comments && card.comments > 0 && /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "ml-2", children: card.comments })
|
|
11299
|
+
] })
|
|
11300
|
+
] }) }),
|
|
11301
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "flex-1 max-h-[calc(90vh-200px)]", children: /* @__PURE__ */ jsxs("div", { className: "p-6", children: [
|
|
11302
|
+
/* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "overview", className: "mt-0", children: /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
11303
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11304
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-base font-semibold mb-2 block", children: "Description" }),
|
|
11305
|
+
isEditingDescription ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
11306
|
+
/* @__PURE__ */ jsx(
|
|
11307
|
+
MoonUITextareaPro,
|
|
11308
|
+
{
|
|
11309
|
+
value: card.description || "",
|
|
11310
|
+
onChange: (e) => updateCard({ description: e.target.value }),
|
|
11311
|
+
placeholder: "Add a description...",
|
|
11312
|
+
className: "min-h-[100px]",
|
|
11313
|
+
autoFocus: true
|
|
11314
|
+
}
|
|
11315
|
+
),
|
|
11316
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
11317
|
+
/* @__PURE__ */ jsx(
|
|
11318
|
+
MoonUIButtonPro,
|
|
11319
|
+
{
|
|
11320
|
+
size: "sm",
|
|
11321
|
+
onClick: () => setIsEditingDescription(false),
|
|
11322
|
+
children: "Save"
|
|
11323
|
+
}
|
|
11324
|
+
),
|
|
11325
|
+
/* @__PURE__ */ jsx(
|
|
11326
|
+
MoonUIButtonPro,
|
|
11327
|
+
{
|
|
11328
|
+
size: "sm",
|
|
11329
|
+
variant: "ghost",
|
|
11330
|
+
onClick: () => {
|
|
11331
|
+
setCard(initialCard);
|
|
11332
|
+
setIsEditingDescription(false);
|
|
11333
|
+
},
|
|
11334
|
+
children: "Cancel"
|
|
11335
|
+
}
|
|
11336
|
+
)
|
|
11337
|
+
] })
|
|
11338
|
+
] }) : /* @__PURE__ */ jsx(
|
|
11339
|
+
"div",
|
|
11340
|
+
{
|
|
11341
|
+
className: "min-h-[50px] p-3 rounded-md border cursor-pointer hover:bg-muted/50",
|
|
11342
|
+
onClick: () => setIsEditingDescription(true),
|
|
11343
|
+
children: card.description || /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Add a description..." })
|
|
11344
|
+
}
|
|
11345
|
+
)
|
|
11346
|
+
] }),
|
|
11347
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
11348
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11349
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-sm font-medium mb-2 block", children: "Assignees" }),
|
|
11350
|
+
/* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
|
|
11351
|
+
/* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", className: "w-full justify-start", children: card.assignees && card.assignees.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11352
|
+
/* @__PURE__ */ jsx(MoonUIAvatarGroupPro, { max: 3, size: "xs", children: card.assignees.map((assignee) => /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-5 w-5", children: [
|
|
11353
|
+
/* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: assignee.avatar }),
|
|
11354
|
+
/* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(assignee.name) })
|
|
11355
|
+
] }, assignee.id)) }),
|
|
11356
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: card.assignees.map((a) => a.name).join(", ") })
|
|
11357
|
+
] }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Add assignee" }) }) }),
|
|
11358
|
+
/* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "p-0", align: "start", children: /* @__PURE__ */ jsxs(MoonUICommandPro, { children: [
|
|
11359
|
+
/* @__PURE__ */ jsx(MoonUICommandInputPro, { placeholder: "Search assignees..." }),
|
|
11360
|
+
/* @__PURE__ */ jsx(MoonUICommandEmptyPro, { children: "No assignees found." }),
|
|
11361
|
+
/* @__PURE__ */ jsx(MoonUICommandGroupPro, { children: availableAssignees.map((assignee) => {
|
|
11362
|
+
const isSelected = card.assignees?.some((a) => a.id === assignee.id);
|
|
11363
|
+
return /* @__PURE__ */ jsxs(
|
|
11364
|
+
MoonUICommandItemPro,
|
|
11365
|
+
{
|
|
11366
|
+
onSelect: () => {
|
|
11367
|
+
if (isSelected) {
|
|
11368
|
+
updateCard({
|
|
11369
|
+
assignees: card.assignees?.filter((a) => a.id !== assignee.id)
|
|
11370
|
+
});
|
|
11371
|
+
} else {
|
|
11372
|
+
updateCard({
|
|
11373
|
+
assignees: [...card.assignees || [], assignee]
|
|
11374
|
+
});
|
|
11375
|
+
}
|
|
11376
|
+
},
|
|
11377
|
+
children: [
|
|
11378
|
+
/* @__PURE__ */ jsx(
|
|
11379
|
+
Check,
|
|
11380
|
+
{
|
|
11381
|
+
className: cn(
|
|
11382
|
+
"mr-2 h-4 w-4",
|
|
11383
|
+
isSelected ? "opacity-100" : "opacity-0"
|
|
11384
|
+
)
|
|
11385
|
+
}
|
|
11386
|
+
),
|
|
11387
|
+
/* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-6 w-6 mr-2", children: [
|
|
11388
|
+
/* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: assignee.avatar }),
|
|
11389
|
+
/* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(assignee.name) })
|
|
11390
|
+
] }),
|
|
11391
|
+
/* @__PURE__ */ jsx("span", { children: assignee.name })
|
|
11392
|
+
]
|
|
11393
|
+
},
|
|
11394
|
+
assignee.id
|
|
11395
|
+
);
|
|
11396
|
+
}) })
|
|
11397
|
+
] }) })
|
|
11398
|
+
] })
|
|
11399
|
+
] }),
|
|
11400
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11401
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-sm font-medium mb-2 block", children: "Priority" }),
|
|
11402
|
+
/* @__PURE__ */ jsxs(MoonUISelectPro, { value: card.priority || "medium", onValueChange: (value) => updateCard({ priority: value }), children: [
|
|
11403
|
+
/* @__PURE__ */ jsx(MoonUISelectTriggerPro, { children: /* @__PURE__ */ jsx(MoonUISelectValuePro, {}) }),
|
|
11404
|
+
/* @__PURE__ */ jsx(MoonUISelectContentPro, { children: PRIORITY_OPTIONS.map((option) => /* @__PURE__ */ jsx(MoonUISelectItemPro, { value: option.value, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11405
|
+
/* @__PURE__ */ jsx(option.icon, { className: cn("h-4 w-4", option.color) }),
|
|
11406
|
+
/* @__PURE__ */ jsx("span", { children: option.label })
|
|
11407
|
+
] }) }, option.value)) })
|
|
11408
|
+
] })
|
|
11409
|
+
] }),
|
|
11410
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11411
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-sm font-medium mb-2 block", children: "Due Date" }),
|
|
11412
|
+
/* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
|
|
11413
|
+
/* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", className: "w-full justify-start", children: card.dueDate ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11414
|
+
/* @__PURE__ */ jsx(Calendar$1, { className: "mr-2 h-4 w-4" }),
|
|
11415
|
+
format(card.dueDate, "PPP")
|
|
11416
|
+
] }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Set due date" }) }) }),
|
|
11417
|
+
/* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsx(
|
|
11418
|
+
Calendar,
|
|
11419
|
+
{
|
|
11420
|
+
mode: "single",
|
|
11421
|
+
selected: card.dueDate,
|
|
11422
|
+
onSelect: (date) => {
|
|
11423
|
+
if (date instanceof Date) {
|
|
11424
|
+
updateCard({ dueDate: date });
|
|
11425
|
+
} else {
|
|
11426
|
+
updateCard({ dueDate: void 0 });
|
|
11427
|
+
}
|
|
11428
|
+
},
|
|
11429
|
+
initialFocus: true
|
|
11430
|
+
}
|
|
11431
|
+
) })
|
|
11432
|
+
] })
|
|
11433
|
+
] }),
|
|
11434
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11435
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-sm font-medium mb-2 block", children: "Labels" }),
|
|
11436
|
+
/* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
|
|
11437
|
+
/* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", className: "w-full justify-start", children: card.labels && card.labels.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: card.labels.map((label) => /* @__PURE__ */ jsx(
|
|
11438
|
+
"div",
|
|
11439
|
+
{
|
|
11440
|
+
className: "px-2 py-0.5 rounded text-xs text-white",
|
|
11441
|
+
style: { backgroundColor: label.color },
|
|
11442
|
+
children: label.name
|
|
11443
|
+
},
|
|
11444
|
+
label.id
|
|
11445
|
+
)) }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Add labels" }) }) }),
|
|
11446
|
+
/* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "p-3", align: "start", children: /* @__PURE__ */ jsx("div", { className: "space-y-2", children: availableLabels.map((label) => {
|
|
11447
|
+
const isSelected = card.labels?.some((l) => l.id === label.id);
|
|
11448
|
+
return /* @__PURE__ */ jsxs(
|
|
11449
|
+
"div",
|
|
11450
|
+
{
|
|
11451
|
+
className: cn(
|
|
11452
|
+
"flex items-center gap-2 p-2 rounded cursor-pointer hover:bg-muted",
|
|
11453
|
+
isSelected && "bg-muted"
|
|
11454
|
+
),
|
|
11455
|
+
onClick: () => {
|
|
11456
|
+
if (isSelected) {
|
|
11457
|
+
updateCard({
|
|
11458
|
+
labels: card.labels?.filter((l) => l.id !== label.id)
|
|
11459
|
+
});
|
|
11460
|
+
} else {
|
|
11461
|
+
updateCard({
|
|
11462
|
+
labels: [...card.labels || [], label]
|
|
11463
|
+
});
|
|
11464
|
+
}
|
|
11465
|
+
},
|
|
11466
|
+
children: [
|
|
11467
|
+
/* @__PURE__ */ jsx(
|
|
11468
|
+
"div",
|
|
11469
|
+
{
|
|
11470
|
+
className: "w-6 h-6 rounded",
|
|
11471
|
+
style: { backgroundColor: label.color }
|
|
11472
|
+
}
|
|
11473
|
+
),
|
|
11474
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: label.name }),
|
|
11475
|
+
isSelected && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-auto" })
|
|
11476
|
+
]
|
|
11477
|
+
},
|
|
11478
|
+
label.id
|
|
11479
|
+
);
|
|
11480
|
+
}) }) })
|
|
11481
|
+
] })
|
|
11482
|
+
] })
|
|
11483
|
+
] }),
|
|
11484
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11485
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [
|
|
11486
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-base font-semibold", children: "Checklist" }),
|
|
11487
|
+
totalChecklistItems > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11488
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
|
|
11489
|
+
completedChecklistItems,
|
|
11490
|
+
"/",
|
|
11491
|
+
totalChecklistItems
|
|
11492
|
+
] }),
|
|
11493
|
+
/* @__PURE__ */ jsx(MoonUIProgressPro, { value: checklistProgress, className: "w-20 h-2" })
|
|
11494
|
+
] })
|
|
11495
|
+
] }),
|
|
11496
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
11497
|
+
card.checklist?.items.map((item) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 group", children: [
|
|
11498
|
+
/* @__PURE__ */ jsx(
|
|
11499
|
+
MoonUICheckboxPro,
|
|
11500
|
+
{
|
|
11501
|
+
checked: item.completed,
|
|
11502
|
+
onCheckedChange: () => toggleChecklistItem(item.id)
|
|
11503
|
+
}
|
|
11504
|
+
),
|
|
11505
|
+
/* @__PURE__ */ jsx("span", { className: cn(
|
|
11506
|
+
"flex-1",
|
|
11507
|
+
item.completed && "line-through text-muted-foreground"
|
|
11508
|
+
), children: item.text }),
|
|
11509
|
+
/* @__PURE__ */ jsx(
|
|
11510
|
+
MoonUIButtonPro,
|
|
11511
|
+
{
|
|
11512
|
+
variant: "ghost",
|
|
11513
|
+
size: "icon",
|
|
11514
|
+
className: "h-6 w-6 opacity-0 group-hover:opacity-100",
|
|
11515
|
+
onClick: () => deleteChecklistItem(item.id),
|
|
11516
|
+
children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
|
|
11517
|
+
}
|
|
11518
|
+
)
|
|
11519
|
+
] }, item.id)),
|
|
11520
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11521
|
+
/* @__PURE__ */ jsx(MoonUICheckboxPro, { disabled: true, className: "invisible" }),
|
|
11522
|
+
/* @__PURE__ */ jsx(
|
|
11523
|
+
MoonUIInputPro,
|
|
11524
|
+
{
|
|
11525
|
+
placeholder: "Add an item...",
|
|
11526
|
+
value: newChecklistItem,
|
|
11527
|
+
onChange: (e) => setNewChecklistItem(e.target.value),
|
|
11528
|
+
onKeyDown: (e) => {
|
|
11529
|
+
if (e.key === "Enter") {
|
|
11530
|
+
e.preventDefault();
|
|
11531
|
+
addChecklistItem();
|
|
11532
|
+
}
|
|
11533
|
+
}
|
|
11534
|
+
}
|
|
11535
|
+
),
|
|
11536
|
+
/* @__PURE__ */ jsx(
|
|
11537
|
+
MoonUIButtonPro,
|
|
11538
|
+
{
|
|
11539
|
+
size: "sm",
|
|
11540
|
+
onClick: addChecklistItem,
|
|
11541
|
+
disabled: !newChecklistItem.trim(),
|
|
11542
|
+
children: "Add"
|
|
11543
|
+
}
|
|
11544
|
+
)
|
|
11545
|
+
] })
|
|
11546
|
+
] })
|
|
11547
|
+
] }),
|
|
11548
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11549
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-base font-semibold mb-3 block", children: "Attachments" }),
|
|
11550
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
11551
|
+
card.attachments?.map((attachment) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 p-3 border rounded-lg group", children: [
|
|
11552
|
+
/* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: attachment.type.startsWith("image/") ? /* @__PURE__ */ jsx(Image$1, { className: "h-8 w-8 text-muted-foreground" }) : /* @__PURE__ */ jsx(FileText, { className: "h-8 w-8 text-muted-foreground" }) }),
|
|
11553
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
11554
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: attachment.name }),
|
|
11555
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: formatFileSize(attachment.size) })
|
|
11556
|
+
] }),
|
|
11557
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100", children: [
|
|
11558
|
+
/* @__PURE__ */ jsx(
|
|
11559
|
+
MoonUIButtonPro,
|
|
11560
|
+
{
|
|
11561
|
+
variant: "ghost",
|
|
11562
|
+
size: "icon",
|
|
11563
|
+
className: "h-8 w-8",
|
|
11564
|
+
onClick: () => window.open(attachment.url, "_blank"),
|
|
11565
|
+
children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" })
|
|
11566
|
+
}
|
|
11567
|
+
),
|
|
11568
|
+
/* @__PURE__ */ jsx(
|
|
11569
|
+
MoonUIButtonPro,
|
|
11570
|
+
{
|
|
11571
|
+
variant: "ghost",
|
|
11572
|
+
size: "icon",
|
|
11573
|
+
className: "h-8 w-8",
|
|
11574
|
+
onClick: () => removeAttachment(attachment.id),
|
|
11575
|
+
children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" })
|
|
11576
|
+
}
|
|
11577
|
+
)
|
|
11578
|
+
] })
|
|
11579
|
+
] }, attachment.id)),
|
|
11580
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11581
|
+
/* @__PURE__ */ jsx(
|
|
11582
|
+
"input",
|
|
11583
|
+
{
|
|
11584
|
+
type: "file",
|
|
11585
|
+
id: "file-upload",
|
|
11586
|
+
className: "hidden",
|
|
11587
|
+
multiple: true,
|
|
11588
|
+
onChange: handleFileUpload
|
|
11589
|
+
}
|
|
11590
|
+
),
|
|
11591
|
+
/* @__PURE__ */ jsxs(
|
|
11592
|
+
MoonUIButtonPro,
|
|
11593
|
+
{
|
|
11594
|
+
variant: "outline",
|
|
11595
|
+
className: "w-full",
|
|
11596
|
+
onClick: () => document.getElementById("file-upload")?.click(),
|
|
11597
|
+
children: [
|
|
11598
|
+
/* @__PURE__ */ jsx(Upload, { className: "mr-2 h-4 w-4" }),
|
|
11599
|
+
"Add attachment"
|
|
11600
|
+
]
|
|
11601
|
+
}
|
|
11602
|
+
)
|
|
11603
|
+
] })
|
|
11604
|
+
] })
|
|
11605
|
+
] })
|
|
11606
|
+
] }) }),
|
|
11607
|
+
/* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "activity", className: "mt-0", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
11608
|
+
card.activities?.map((activity) => /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
11609
|
+
/* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-8 w-8", children: [
|
|
11610
|
+
/* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: activity.user.avatar }),
|
|
11611
|
+
/* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(activity.user.name) })
|
|
11612
|
+
] }),
|
|
11613
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
11614
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
11615
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: activity.user.name }),
|
|
11616
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: activity.action }),
|
|
11617
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: format(activity.timestamp, "PPp") })
|
|
11618
|
+
] }),
|
|
11619
|
+
activity.details && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: activity.details })
|
|
11620
|
+
] })
|
|
11621
|
+
] }, activity.id)),
|
|
11622
|
+
(!card.activities || card.activities.length === 0) && /* @__PURE__ */ jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
|
|
11623
|
+
/* @__PURE__ */ jsx(Activity, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
|
|
11624
|
+
/* @__PURE__ */ jsx("p", { children: "No activity yet" })
|
|
11625
|
+
] })
|
|
11626
|
+
] }) }),
|
|
11627
|
+
/* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "comments", className: "mt-0", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
11628
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
11629
|
+
/* @__PURE__ */ jsx(MoonUIAvatarPro, { className: "h-8 w-8", children: /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { children: "U" }) }),
|
|
11630
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
11631
|
+
/* @__PURE__ */ jsx(
|
|
11632
|
+
MoonUITextareaPro,
|
|
11633
|
+
{
|
|
11634
|
+
placeholder: "Add a comment...",
|
|
11635
|
+
value: newComment,
|
|
11636
|
+
onChange: (e) => setNewComment(e.target.value),
|
|
11637
|
+
className: "min-h-[80px]"
|
|
11638
|
+
}
|
|
11639
|
+
),
|
|
11640
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs(
|
|
11641
|
+
MoonUIButtonPro,
|
|
11642
|
+
{
|
|
11643
|
+
size: "sm",
|
|
11644
|
+
onClick: addComment,
|
|
11645
|
+
disabled: !newComment.trim(),
|
|
11646
|
+
children: [
|
|
11647
|
+
/* @__PURE__ */ jsx(Send, { className: "mr-2 h-4 w-4" }),
|
|
11648
|
+
"Comment"
|
|
11649
|
+
]
|
|
11650
|
+
}
|
|
11651
|
+
) })
|
|
11652
|
+
] })
|
|
11653
|
+
] }),
|
|
11654
|
+
/* @__PURE__ */ jsx(MoonUISeparatorPro, {}),
|
|
11655
|
+
card.activities?.filter((a) => a.action === "commented").map((comment) => /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
11656
|
+
/* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-8 w-8", children: [
|
|
11657
|
+
/* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: comment.user.avatar }),
|
|
11658
|
+
/* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(comment.user.name) })
|
|
11659
|
+
] }),
|
|
11660
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
11661
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
11662
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: comment.user.name }),
|
|
11663
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: format(comment.timestamp, "PPp") })
|
|
11664
|
+
] }),
|
|
11665
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: comment.details })
|
|
11666
|
+
] })
|
|
11667
|
+
] }, comment.id)),
|
|
11668
|
+
!card.activities?.some((a) => a.action === "commented") && /* @__PURE__ */ jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
|
|
11669
|
+
/* @__PURE__ */ jsx(MessageCircle, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
|
|
11670
|
+
/* @__PURE__ */ jsx("p", { children: "No comments yet" }),
|
|
11671
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: "Be the first to comment" })
|
|
11672
|
+
] })
|
|
11673
|
+
] }) })
|
|
11674
|
+
] }) })
|
|
11675
|
+
] }),
|
|
11676
|
+
/* @__PURE__ */ jsxs("div", { className: "border-t p-4 flex items-center justify-between", children: [
|
|
11677
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
11678
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", size: "sm", children: [
|
|
11679
|
+
/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4 mr-2" }),
|
|
11680
|
+
"Actions"
|
|
11681
|
+
] }) }),
|
|
11682
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "start", children: [
|
|
11683
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
|
|
11684
|
+
/* @__PURE__ */ jsx(Copy, { className: "mr-2 h-4 w-4" }),
|
|
11685
|
+
"Duplicate card"
|
|
11686
|
+
] }),
|
|
11687
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
|
|
11688
|
+
/* @__PURE__ */ jsx(Archive, { className: "mr-2 h-4 w-4" }),
|
|
11689
|
+
"Archive card"
|
|
11690
|
+
] }),
|
|
11691
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
|
|
11692
|
+
/* @__PURE__ */ jsx(Link2, { className: "mr-2 h-4 w-4" }),
|
|
11693
|
+
"Copy link"
|
|
11694
|
+
] }),
|
|
11695
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
|
|
11696
|
+
/* @__PURE__ */ jsxs(
|
|
11697
|
+
MoonUIDropdownMenuItemPro,
|
|
11698
|
+
{
|
|
11699
|
+
onClick: () => {
|
|
11700
|
+
onDelete(card);
|
|
11701
|
+
onClose();
|
|
11702
|
+
},
|
|
11703
|
+
className: "text-destructive",
|
|
11704
|
+
children: [
|
|
11705
|
+
/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }),
|
|
11706
|
+
"Delete card"
|
|
11707
|
+
]
|
|
11708
|
+
}
|
|
11709
|
+
)
|
|
11710
|
+
] })
|
|
11711
|
+
] }) }),
|
|
11712
|
+
/* @__PURE__ */ jsx(MoonUIButtonPro, { onClick: onClose, children: "Close" })
|
|
11713
|
+
] })
|
|
11714
|
+
] }) });
|
|
11715
|
+
}
|
|
11716
|
+
var PRIORITY_OPTIONS2 = [
|
|
11717
|
+
{ value: "low", label: "Low Priority", icon: Flag, color: "text-green-600" },
|
|
11718
|
+
{ value: "medium", label: "Medium Priority", icon: Flag, color: "text-yellow-600" },
|
|
11719
|
+
{ value: "high", label: "High Priority", icon: Flag, color: "text-orange-600" },
|
|
11720
|
+
{ value: "urgent", label: "Urgent", icon: Zap, color: "text-red-600" }
|
|
11721
|
+
];
|
|
11722
|
+
var CARD_TEMPLATES = [
|
|
11723
|
+
{
|
|
11724
|
+
name: "Bug Report",
|
|
11725
|
+
icon: Flag,
|
|
11726
|
+
template: {
|
|
11727
|
+
title: "Bug: ",
|
|
11728
|
+
description: "**Steps to Reproduce:**\n1. \n2. \n3. \n\n**Expected Behavior:**\n\n**Actual Behavior:**",
|
|
11729
|
+
priority: "high",
|
|
11730
|
+
tags: ["bug"]
|
|
11731
|
+
}
|
|
11732
|
+
},
|
|
11733
|
+
{
|
|
11734
|
+
name: "Feature Request",
|
|
11735
|
+
icon: Star,
|
|
11736
|
+
template: {
|
|
11737
|
+
title: "Feature: ",
|
|
11738
|
+
description: "**User Story:**\nAs a [user type], I want [feature] so that [benefit].\n\n**Acceptance Criteria:**\n- [ ] ",
|
|
11739
|
+
priority: "medium",
|
|
11740
|
+
tags: ["feature"]
|
|
11741
|
+
}
|
|
11742
|
+
},
|
|
11743
|
+
{
|
|
11744
|
+
name: "Task",
|
|
11745
|
+
icon: CheckSquare,
|
|
11746
|
+
template: {
|
|
11747
|
+
title: "Task: ",
|
|
11748
|
+
description: "**Objective:**\n\n**Tasks:**\n- [ ] ",
|
|
11749
|
+
priority: "medium",
|
|
11750
|
+
tags: ["task"]
|
|
11751
|
+
}
|
|
11752
|
+
},
|
|
11753
|
+
{
|
|
11754
|
+
name: "User Story",
|
|
11755
|
+
icon: User,
|
|
11756
|
+
template: {
|
|
11757
|
+
title: "As a ",
|
|
11758
|
+
description: "**Story:**\nAs a [user type]\nI want [functionality]\nSo that [benefit]\n\n**Acceptance Criteria:**\n- [ ] ",
|
|
11759
|
+
priority: "medium",
|
|
11760
|
+
tags: ["story"]
|
|
11761
|
+
}
|
|
11762
|
+
}
|
|
11763
|
+
];
|
|
11764
|
+
var getInitials2 = (name) => {
|
|
11765
|
+
return name.split(" ").map((n) => n[0]).join("").toUpperCase();
|
|
11766
|
+
};
|
|
11767
|
+
function AddCardModal({
|
|
11768
|
+
isOpen,
|
|
11769
|
+
onClose,
|
|
11770
|
+
onAdd,
|
|
11771
|
+
columnId,
|
|
11772
|
+
columnTitle,
|
|
11773
|
+
availableAssignees = [],
|
|
11774
|
+
availableLabels = [],
|
|
11775
|
+
templates = []
|
|
11776
|
+
}) {
|
|
11777
|
+
const [selectedTab, setSelectedTab] = useState("blank");
|
|
11778
|
+
const [title, setTitle] = useState("");
|
|
11779
|
+
const [description, setDescription] = useState("");
|
|
11780
|
+
const [priority, setPriority] = useState("medium");
|
|
11781
|
+
const [assignees, setAssignees] = useState([]);
|
|
11782
|
+
const [labels, setLabels] = useState([]);
|
|
11783
|
+
const [dueDate, setDueDate] = useState();
|
|
11784
|
+
const [tags, setTags] = useState([]);
|
|
11785
|
+
const [tagInput, setTagInput] = useState("");
|
|
11786
|
+
const handleTemplateSelect = (template) => {
|
|
11787
|
+
setTitle(template.title || "");
|
|
11788
|
+
setDescription(template.description || "");
|
|
11789
|
+
setPriority(template.priority || "medium");
|
|
11790
|
+
setTags(template.tags || []);
|
|
11791
|
+
if (template.assignees)
|
|
11792
|
+
setAssignees(template.assignees);
|
|
11793
|
+
if (template.labels)
|
|
11794
|
+
setLabels(template.labels);
|
|
11795
|
+
if (template.dueDate)
|
|
11796
|
+
setDueDate(template.dueDate);
|
|
11797
|
+
};
|
|
11798
|
+
const handleSubmit = () => {
|
|
11799
|
+
if (!title.trim())
|
|
11800
|
+
return;
|
|
11801
|
+
const newCard = {
|
|
11802
|
+
title: title.trim(),
|
|
11803
|
+
description: description.trim() || void 0,
|
|
11804
|
+
priority,
|
|
11805
|
+
assignees: assignees.length > 0 ? assignees : void 0,
|
|
11806
|
+
labels: labels.length > 0 ? labels : void 0,
|
|
11807
|
+
dueDate,
|
|
11808
|
+
tags: tags.length > 0 ? tags : void 0,
|
|
11809
|
+
position: Date.now()
|
|
11810
|
+
};
|
|
11811
|
+
onAdd(newCard);
|
|
11812
|
+
resetForm();
|
|
11813
|
+
onClose();
|
|
11814
|
+
};
|
|
11815
|
+
const resetForm = () => {
|
|
11816
|
+
setTitle("");
|
|
11817
|
+
setDescription("");
|
|
11818
|
+
setPriority("medium");
|
|
11819
|
+
setAssignees([]);
|
|
11820
|
+
setLabels([]);
|
|
11821
|
+
setDueDate(void 0);
|
|
11822
|
+
setTags([]);
|
|
11823
|
+
setTagInput("");
|
|
11824
|
+
setSelectedTab("blank");
|
|
11825
|
+
};
|
|
11826
|
+
const handleAddTag = () => {
|
|
11827
|
+
if (tagInput.trim() && !tags.includes(tagInput.trim())) {
|
|
11828
|
+
setTags([...tags, tagInput.trim()]);
|
|
11829
|
+
setTagInput("");
|
|
11830
|
+
}
|
|
11831
|
+
};
|
|
11832
|
+
[...CARD_TEMPLATES.map((t2) => ({ ...t2.template, name: t2.name, icon: t2.icon })), ...templates];
|
|
11833
|
+
return /* @__PURE__ */ jsx(MoonUIDialogPro, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxs(MoonUIDialogContentPro, { className: "max-w-2xl", children: [
|
|
11834
|
+
/* @__PURE__ */ jsx(MoonUIDialogHeaderPro, { children: /* @__PURE__ */ jsxs(MoonUIDialogTitlePro, { children: [
|
|
11835
|
+
"Add Card to ",
|
|
11836
|
+
columnTitle
|
|
11837
|
+
] }) }),
|
|
11838
|
+
/* @__PURE__ */ jsxs(MoonUITabsPro, { value: selectedTab, onValueChange: setSelectedTab, children: [
|
|
11839
|
+
/* @__PURE__ */ jsxs(MoonUITabsListPro, { className: "grid w-full grid-cols-2", children: [
|
|
11840
|
+
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "blank", children: "Blank Card" }),
|
|
11841
|
+
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "template", children: "From Template" })
|
|
11842
|
+
] }),
|
|
11843
|
+
/* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "blank", className: "space-y-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
11844
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11845
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { htmlFor: "title", children: "Title *" }),
|
|
11846
|
+
/* @__PURE__ */ jsx(
|
|
11847
|
+
MoonUIInputPro,
|
|
11848
|
+
{
|
|
11849
|
+
id: "title",
|
|
11850
|
+
placeholder: "Enter card title...",
|
|
11851
|
+
value: title,
|
|
11852
|
+
onChange: (e) => setTitle(e.target.value),
|
|
11853
|
+
autoFocus: true
|
|
11854
|
+
}
|
|
11855
|
+
)
|
|
11856
|
+
] }),
|
|
11857
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11858
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { htmlFor: "description", children: "Description" }),
|
|
11859
|
+
/* @__PURE__ */ jsx(
|
|
11860
|
+
MoonUITextareaPro,
|
|
11861
|
+
{
|
|
11862
|
+
id: "description",
|
|
11863
|
+
placeholder: "Add a more detailed description...",
|
|
11864
|
+
value: description,
|
|
11865
|
+
onChange: (e) => setDescription(e.target.value),
|
|
11866
|
+
className: "min-h-[100px]"
|
|
11867
|
+
}
|
|
11868
|
+
)
|
|
11869
|
+
] }),
|
|
11870
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
11871
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11872
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { children: "Priority" }),
|
|
11873
|
+
/* @__PURE__ */ jsxs(MoonUISelectPro, { value: priority, onValueChange: (value) => setPriority(value), children: [
|
|
11874
|
+
/* @__PURE__ */ jsx(MoonUISelectTriggerPro, { children: /* @__PURE__ */ jsx(MoonUISelectValuePro, {}) }),
|
|
11875
|
+
/* @__PURE__ */ jsx(MoonUISelectContentPro, { children: PRIORITY_OPTIONS2.map((option) => /* @__PURE__ */ jsx(MoonUISelectItemPro, { value: option.value, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11876
|
+
/* @__PURE__ */ jsx(option.icon, { className: cn("h-4 w-4", option.color) }),
|
|
11877
|
+
/* @__PURE__ */ jsx("span", { children: option.label })
|
|
11878
|
+
] }) }, option.value)) })
|
|
11879
|
+
] })
|
|
11880
|
+
] }),
|
|
11881
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11882
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { children: "Due Date" }),
|
|
11883
|
+
/* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
|
|
11884
|
+
/* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", className: "w-full justify-start", children: dueDate ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11885
|
+
/* @__PURE__ */ jsx(Calendar$1, { className: "mr-2 h-4 w-4" }),
|
|
11886
|
+
format(dueDate, "PPP")
|
|
11887
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11888
|
+
/* @__PURE__ */ jsx(Calendar$1, { className: "mr-2 h-4 w-4" }),
|
|
11889
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Pick a date" })
|
|
11890
|
+
] }) }) }),
|
|
11891
|
+
/* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsx(
|
|
11892
|
+
Calendar,
|
|
11893
|
+
{
|
|
11894
|
+
mode: "single",
|
|
11895
|
+
selected: dueDate,
|
|
11896
|
+
onSelect: (date) => {
|
|
11897
|
+
if (date instanceof Date) {
|
|
11898
|
+
setDueDate(date);
|
|
11899
|
+
} else {
|
|
11900
|
+
setDueDate(void 0);
|
|
11901
|
+
}
|
|
11902
|
+
},
|
|
11903
|
+
initialFocus: true
|
|
11904
|
+
}
|
|
11905
|
+
) })
|
|
11906
|
+
] })
|
|
11907
|
+
] })
|
|
11908
|
+
] }),
|
|
11909
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
11910
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11911
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { children: "Assignees" }),
|
|
11912
|
+
/* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
|
|
11913
|
+
/* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", className: "w-full justify-start", children: assignees.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11914
|
+
/* @__PURE__ */ jsx(MoonUIAvatarGroupPro, { max: 2, size: "xs", children: assignees.map((assignee) => /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-5 w-5", children: [
|
|
11915
|
+
/* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: assignee.avatar }),
|
|
11916
|
+
/* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials2(assignee.name) })
|
|
11917
|
+
] }, assignee.id)) }),
|
|
11918
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm truncate", children: assignees.map((a) => a.name).join(", ") })
|
|
11919
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11920
|
+
/* @__PURE__ */ jsx(User, { className: "mr-2 h-4 w-4" }),
|
|
11921
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Select assignees" })
|
|
11922
|
+
] }) }) }),
|
|
11923
|
+
/* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "p-0", align: "start", children: /* @__PURE__ */ jsxs(MoonUICommandPro, { children: [
|
|
11924
|
+
/* @__PURE__ */ jsx(MoonUICommandInputPro, { placeholder: "Search people..." }),
|
|
11925
|
+
/* @__PURE__ */ jsx(MoonUICommandEmptyPro, { children: "No assignees found." }),
|
|
11926
|
+
/* @__PURE__ */ jsx(MoonUICommandGroupPro, { children: availableAssignees.map((assignee) => {
|
|
11927
|
+
const isSelected = assignees.some((a) => a.id === assignee.id);
|
|
11928
|
+
return /* @__PURE__ */ jsxs(
|
|
11929
|
+
MoonUICommandItemPro,
|
|
11930
|
+
{
|
|
11931
|
+
onSelect: () => {
|
|
11932
|
+
if (isSelected) {
|
|
11933
|
+
setAssignees(assignees.filter((a) => a.id !== assignee.id));
|
|
11934
|
+
} else {
|
|
11935
|
+
setAssignees([...assignees, assignee]);
|
|
11936
|
+
}
|
|
11937
|
+
},
|
|
11938
|
+
children: [
|
|
11939
|
+
/* @__PURE__ */ jsx(
|
|
11940
|
+
Check,
|
|
11941
|
+
{
|
|
11942
|
+
className: cn(
|
|
11943
|
+
"mr-2 h-4 w-4",
|
|
11944
|
+
isSelected ? "opacity-100" : "opacity-0"
|
|
11945
|
+
)
|
|
11946
|
+
}
|
|
11947
|
+
),
|
|
11948
|
+
/* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-6 w-6 mr-2", children: [
|
|
11949
|
+
/* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: assignee.avatar }),
|
|
11950
|
+
/* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials2(assignee.name) })
|
|
11951
|
+
] }),
|
|
11952
|
+
/* @__PURE__ */ jsx("span", { children: assignee.name })
|
|
11953
|
+
]
|
|
11954
|
+
},
|
|
11955
|
+
assignee.id
|
|
11956
|
+
);
|
|
11957
|
+
}) })
|
|
11958
|
+
] }) })
|
|
11959
|
+
] })
|
|
11960
|
+
] }),
|
|
11961
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11962
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { children: "Labels" }),
|
|
11963
|
+
/* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
|
|
11964
|
+
/* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", className: "w-full justify-start", children: labels.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 truncate", children: [
|
|
11965
|
+
labels.slice(0, 2).map((label) => /* @__PURE__ */ jsx(
|
|
11966
|
+
"div",
|
|
11967
|
+
{
|
|
11968
|
+
className: "px-2 py-0.5 rounded text-xs text-white",
|
|
11969
|
+
style: { backgroundColor: label.color },
|
|
11970
|
+
children: label.name
|
|
11971
|
+
},
|
|
11972
|
+
label.id
|
|
11973
|
+
)),
|
|
11974
|
+
labels.length > 2 && /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
|
|
11975
|
+
"+",
|
|
11976
|
+
labels.length - 2,
|
|
11977
|
+
" more"
|
|
11978
|
+
] })
|
|
11979
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11980
|
+
/* @__PURE__ */ jsx(Tag, { className: "mr-2 h-4 w-4" }),
|
|
11981
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Select labels" })
|
|
11982
|
+
] }) }) }),
|
|
11983
|
+
/* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "p-3", align: "start", children: /* @__PURE__ */ jsx("div", { className: "space-y-2", children: availableLabels.map((label) => {
|
|
11984
|
+
const isSelected = labels.some((l) => l.id === label.id);
|
|
11985
|
+
return /* @__PURE__ */ jsxs(
|
|
11986
|
+
"div",
|
|
11987
|
+
{
|
|
11988
|
+
className: cn(
|
|
11989
|
+
"flex items-center gap-2 p-2 rounded cursor-pointer hover:bg-muted",
|
|
11990
|
+
isSelected && "bg-muted"
|
|
11991
|
+
),
|
|
11992
|
+
onClick: () => {
|
|
11993
|
+
if (isSelected) {
|
|
11994
|
+
setLabels(labels.filter((l) => l.id !== label.id));
|
|
11995
|
+
} else {
|
|
11996
|
+
setLabels([...labels, label]);
|
|
11997
|
+
}
|
|
11998
|
+
},
|
|
11999
|
+
children: [
|
|
12000
|
+
/* @__PURE__ */ jsx(
|
|
12001
|
+
"div",
|
|
12002
|
+
{
|
|
12003
|
+
className: "w-6 h-6 rounded",
|
|
12004
|
+
style: { backgroundColor: label.color }
|
|
12005
|
+
}
|
|
12006
|
+
),
|
|
12007
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: label.name }),
|
|
12008
|
+
isSelected && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-auto" })
|
|
12009
|
+
]
|
|
12010
|
+
},
|
|
12011
|
+
label.id
|
|
12012
|
+
);
|
|
12013
|
+
}) }) })
|
|
12014
|
+
] })
|
|
12015
|
+
] })
|
|
12016
|
+
] }),
|
|
12017
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
12018
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { children: "Tags" }),
|
|
12019
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
12020
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
12021
|
+
/* @__PURE__ */ jsx(
|
|
12022
|
+
MoonUIInputPro,
|
|
12023
|
+
{
|
|
12024
|
+
placeholder: "Add a tag...",
|
|
12025
|
+
value: tagInput,
|
|
12026
|
+
onChange: (e) => setTagInput(e.target.value),
|
|
12027
|
+
onKeyDown: (e) => {
|
|
12028
|
+
if (e.key === "Enter") {
|
|
12029
|
+
e.preventDefault();
|
|
12030
|
+
handleAddTag();
|
|
12031
|
+
}
|
|
12032
|
+
}
|
|
12033
|
+
}
|
|
12034
|
+
),
|
|
12035
|
+
/* @__PURE__ */ jsx(
|
|
12036
|
+
MoonUIButtonPro,
|
|
12037
|
+
{
|
|
12038
|
+
type: "button",
|
|
12039
|
+
variant: "outline",
|
|
12040
|
+
onClick: handleAddTag,
|
|
12041
|
+
disabled: !tagInput.trim(),
|
|
12042
|
+
children: "Add"
|
|
12043
|
+
}
|
|
12044
|
+
)
|
|
12045
|
+
] }),
|
|
12046
|
+
tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: tags.map((tag) => /* @__PURE__ */ jsxs(
|
|
12047
|
+
MoonUIBadgePro,
|
|
12048
|
+
{
|
|
12049
|
+
variant: "secondary",
|
|
12050
|
+
className: "cursor-pointer",
|
|
12051
|
+
onClick: () => setTags(tags.filter((t2) => t2 !== tag)),
|
|
12052
|
+
children: [
|
|
12053
|
+
tag,
|
|
12054
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1 hover:text-destructive", children: "\xD7" })
|
|
12055
|
+
]
|
|
12056
|
+
},
|
|
12057
|
+
tag
|
|
12058
|
+
)) })
|
|
12059
|
+
] })
|
|
12060
|
+
] })
|
|
12061
|
+
] }) }),
|
|
12062
|
+
/* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "template", className: "space-y-4", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
12063
|
+
CARD_TEMPLATES.map((template) => /* @__PURE__ */ jsxs(
|
|
12064
|
+
"div",
|
|
12065
|
+
{
|
|
12066
|
+
className: "p-4 border rounded-lg cursor-pointer hover:bg-muted/50 transition-colors",
|
|
12067
|
+
onClick: () => {
|
|
12068
|
+
handleTemplateSelect(template.template);
|
|
12069
|
+
setSelectedTab("blank");
|
|
12070
|
+
},
|
|
12071
|
+
children: [
|
|
12072
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
12073
|
+
/* @__PURE__ */ jsx(template.icon, { className: "h-5 w-5 text-muted-foreground" }),
|
|
12074
|
+
/* @__PURE__ */ jsx("h4", { className: "font-medium", children: template.name })
|
|
12075
|
+
] }),
|
|
12076
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
12077
|
+
template.name === "Bug Report" && "Track and fix bugs with detailed information",
|
|
12078
|
+
template.name === "Feature Request" && "Plan new features with user stories",
|
|
12079
|
+
template.name === "Task" && "Create actionable tasks with clear objectives",
|
|
12080
|
+
template.name === "User Story" && "Define user needs and acceptance criteria"
|
|
12081
|
+
] })
|
|
12082
|
+
]
|
|
12083
|
+
},
|
|
12084
|
+
template.name
|
|
12085
|
+
)),
|
|
12086
|
+
templates.map((template, index2) => /* @__PURE__ */ jsxs(
|
|
12087
|
+
"div",
|
|
12088
|
+
{
|
|
12089
|
+
className: "p-4 border rounded-lg cursor-pointer hover:bg-muted/50 transition-colors",
|
|
12090
|
+
onClick: () => {
|
|
12091
|
+
handleTemplateSelect(template);
|
|
12092
|
+
setSelectedTab("blank");
|
|
12093
|
+
},
|
|
12094
|
+
children: [
|
|
12095
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
12096
|
+
/* @__PURE__ */ jsx(Star, { className: "h-5 w-5 text-muted-foreground" }),
|
|
12097
|
+
/* @__PURE__ */ jsx("h4", { className: "font-medium", children: template.title || `Template ${index2 + 1}` })
|
|
12098
|
+
] }),
|
|
12099
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground line-clamp-2", children: template.description || "Custom template" })
|
|
12100
|
+
]
|
|
12101
|
+
},
|
|
12102
|
+
`custom-${index2}`
|
|
12103
|
+
))
|
|
12104
|
+
] }) })
|
|
12105
|
+
] }),
|
|
12106
|
+
/* @__PURE__ */ jsxs(MoonUIDialogFooterPro, { children: [
|
|
12107
|
+
/* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", onClick: onClose, children: "Cancel" }),
|
|
12108
|
+
/* @__PURE__ */ jsx(MoonUIButtonPro, { onClick: handleSubmit, disabled: !title.trim(), children: "Add Card" })
|
|
12109
|
+
] })
|
|
12110
|
+
] }) });
|
|
12111
|
+
}
|
|
12112
|
+
|
|
12113
|
+
// src/hooks/use-toast.ts
|
|
12114
|
+
function useToast() {
|
|
12115
|
+
const toast3 = (options) => {
|
|
12116
|
+
console.log(`[Toast] ${options.title}${options.description ? ": " + options.description : ""}`);
|
|
12117
|
+
};
|
|
12118
|
+
return { toast: toast3 };
|
|
12119
|
+
}
|
|
11124
12120
|
var PRIORITY_CONFIG = {
|
|
11125
12121
|
low: {
|
|
11126
12122
|
color: "bg-green-100 text-green-800 border-green-200",
|
|
@@ -11158,7 +12154,7 @@ var formatDate = (date) => {
|
|
|
11158
12154
|
var isOverdue = (dueDate) => {
|
|
11159
12155
|
return dueDate < /* @__PURE__ */ new Date();
|
|
11160
12156
|
};
|
|
11161
|
-
var
|
|
12157
|
+
var getInitials3 = (name) => {
|
|
11162
12158
|
return name.split(" ").map((n) => n[0]).join("").toUpperCase();
|
|
11163
12159
|
};
|
|
11164
12160
|
var useAutoScroll = () => {
|
|
@@ -11361,7 +12357,7 @@ var KanbanCardComponent = ({
|
|
|
11361
12357
|
] }),
|
|
11362
12358
|
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
12359
|
/* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: assignee.avatar }),
|
|
11364
|
-
/* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children:
|
|
12360
|
+
/* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials3(assignee.name) })
|
|
11365
12361
|
] }, assignee.id)) })
|
|
11366
12362
|
] })
|
|
11367
12363
|
] })
|
|
@@ -11422,7 +12418,18 @@ function Kanban({
|
|
|
11422
12418
|
const [draggedOverColumn, setDraggedOverColumn] = useState(null);
|
|
11423
12419
|
const [isCreatingColumn, setIsCreatingColumn] = useState(false);
|
|
11424
12420
|
const [newColumnTitle, setNewColumnTitle] = useState("");
|
|
12421
|
+
const [selectedCard, setSelectedCard] = useState(null);
|
|
12422
|
+
const [addCardColumnId, setAddCardColumnId] = useState(null);
|
|
12423
|
+
const [editingColumnId, setEditingColumnId] = useState(null);
|
|
12424
|
+
const [editingColumnTitle, setEditingColumnTitle] = useState("");
|
|
12425
|
+
const [wipLimitModalOpen, setWipLimitModalOpen] = useState(false);
|
|
12426
|
+
const [wipLimitColumnId, setWipLimitColumnId] = useState(null);
|
|
12427
|
+
const [wipLimit, setWipLimit] = useState();
|
|
12428
|
+
const [colorPickerOpen, setColorPickerOpen] = useState(false);
|
|
12429
|
+
const [colorPickerColumnId, setColorPickerColumnId] = useState(null);
|
|
12430
|
+
const [selectedColor, setSelectedColor] = useState("#6B7280");
|
|
11425
12431
|
const { scrollRef, startAutoScroll, stopAutoScroll } = useAutoScroll();
|
|
12432
|
+
const { toast: toast3 } = useToast();
|
|
11426
12433
|
const filteredColumns = useMemo(() => {
|
|
11427
12434
|
if (!searchQuery && !activeFilter)
|
|
11428
12435
|
return columns;
|
|
@@ -11531,15 +12538,208 @@ function Kanban({
|
|
|
11531
12538
|
const handleColumnAction = (column, action) => {
|
|
11532
12539
|
switch (action) {
|
|
11533
12540
|
case "rename":
|
|
12541
|
+
setEditingColumnId(column.id);
|
|
12542
|
+
setEditingColumnTitle(column.title);
|
|
11534
12543
|
break;
|
|
11535
12544
|
case "delete":
|
|
11536
12545
|
onColumnDelete?.(column.id);
|
|
12546
|
+
toast3({
|
|
12547
|
+
title: "Column deleted",
|
|
12548
|
+
description: `"${column.title}" has been deleted`
|
|
12549
|
+
});
|
|
11537
12550
|
break;
|
|
11538
12551
|
case "collapse":
|
|
11539
|
-
|
|
12552
|
+
const updatedColumn = { ...column, collapsed: !column.collapsed };
|
|
12553
|
+
onColumnUpdate?.(updatedColumn);
|
|
12554
|
+
setColumns(columns.map((col) => col.id === column.id ? updatedColumn : col));
|
|
12555
|
+
break;
|
|
12556
|
+
case "setLimit":
|
|
12557
|
+
setWipLimitColumnId(column.id);
|
|
12558
|
+
setWipLimit(column.limit);
|
|
12559
|
+
setWipLimitModalOpen(true);
|
|
12560
|
+
break;
|
|
12561
|
+
case "changeColor":
|
|
12562
|
+
setColorPickerColumnId(column.id);
|
|
12563
|
+
setSelectedColor(column.color || "#6B7280");
|
|
12564
|
+
setColorPickerOpen(true);
|
|
12565
|
+
break;
|
|
12566
|
+
case "sortByPriority":
|
|
12567
|
+
const sortedCards = [...column.cards].sort((a, b) => {
|
|
12568
|
+
const priorityOrder = { urgent: 4, high: 3, medium: 2, low: 1 };
|
|
12569
|
+
return (priorityOrder[b.priority || "medium"] || 2) - (priorityOrder[a.priority || "medium"] || 2);
|
|
12570
|
+
});
|
|
12571
|
+
const sortedColumn = { ...column, cards: sortedCards };
|
|
12572
|
+
onColumnUpdate?.(sortedColumn);
|
|
12573
|
+
setColumns(columns.map((col) => col.id === column.id ? sortedColumn : col));
|
|
12574
|
+
toast3({
|
|
12575
|
+
title: "Cards sorted",
|
|
12576
|
+
description: "Cards sorted by priority"
|
|
12577
|
+
});
|
|
12578
|
+
break;
|
|
12579
|
+
case "sortByDueDate":
|
|
12580
|
+
const dateCards = [...column.cards].sort((a, b) => {
|
|
12581
|
+
if (!a.dueDate && !b.dueDate)
|
|
12582
|
+
return 0;
|
|
12583
|
+
if (!a.dueDate)
|
|
12584
|
+
return 1;
|
|
12585
|
+
if (!b.dueDate)
|
|
12586
|
+
return -1;
|
|
12587
|
+
return new Date(a.dueDate).getTime() - new Date(b.dueDate).getTime();
|
|
12588
|
+
});
|
|
12589
|
+
const dateColumn = { ...column, cards: dateCards };
|
|
12590
|
+
onColumnUpdate?.(dateColumn);
|
|
12591
|
+
setColumns(columns.map((col) => col.id === column.id ? dateColumn : col));
|
|
12592
|
+
toast3({
|
|
12593
|
+
title: "Cards sorted",
|
|
12594
|
+
description: "Cards sorted by due date"
|
|
12595
|
+
});
|
|
12596
|
+
break;
|
|
12597
|
+
case "sortAlphabetically":
|
|
12598
|
+
const alphaCards = [...column.cards].sort((a, b) => a.title.localeCompare(b.title));
|
|
12599
|
+
const alphaColumn = { ...column, cards: alphaCards };
|
|
12600
|
+
onColumnUpdate?.(alphaColumn);
|
|
12601
|
+
setColumns(columns.map((col) => col.id === column.id ? alphaColumn : col));
|
|
12602
|
+
toast3({
|
|
12603
|
+
title: "Cards sorted",
|
|
12604
|
+
description: "Cards sorted alphabetically"
|
|
12605
|
+
});
|
|
11540
12606
|
break;
|
|
11541
12607
|
}
|
|
11542
12608
|
};
|
|
12609
|
+
const handleCardClick = (card) => {
|
|
12610
|
+
if (onCardClick) {
|
|
12611
|
+
onCardClick(card);
|
|
12612
|
+
} else {
|
|
12613
|
+
setSelectedCard(card);
|
|
12614
|
+
}
|
|
12615
|
+
};
|
|
12616
|
+
const handleCardUpdate = (updatedCard) => {
|
|
12617
|
+
onCardUpdate?.(updatedCard);
|
|
12618
|
+
setColumns(columns.map((col) => ({
|
|
12619
|
+
...col,
|
|
12620
|
+
cards: col.cards.map((card) => card.id === updatedCard.id ? updatedCard : card)
|
|
12621
|
+
})));
|
|
12622
|
+
};
|
|
12623
|
+
const handleAddCard = (columnId, newCard) => {
|
|
12624
|
+
if (onAddCard) {
|
|
12625
|
+
onAddCard(columnId, newCard);
|
|
12626
|
+
} else {
|
|
12627
|
+
setAddCardColumnId(columnId);
|
|
12628
|
+
}
|
|
12629
|
+
};
|
|
12630
|
+
const handleAddNewCard = (card) => {
|
|
12631
|
+
if (!addCardColumnId)
|
|
12632
|
+
return;
|
|
12633
|
+
const newCard = {
|
|
12634
|
+
id: Date.now().toString(),
|
|
12635
|
+
title: card.title || "New Card",
|
|
12636
|
+
position: Date.now(),
|
|
12637
|
+
...card
|
|
12638
|
+
};
|
|
12639
|
+
setColumns(columns.map((col) => {
|
|
12640
|
+
if (col.id === addCardColumnId) {
|
|
12641
|
+
return {
|
|
12642
|
+
...col,
|
|
12643
|
+
cards: [...col.cards, newCard]
|
|
12644
|
+
};
|
|
12645
|
+
}
|
|
12646
|
+
return col;
|
|
12647
|
+
}));
|
|
12648
|
+
onAddCard?.(addCardColumnId, newCard);
|
|
12649
|
+
toast3({
|
|
12650
|
+
title: "Card added",
|
|
12651
|
+
description: `"${newCard.title}" has been added`
|
|
12652
|
+
});
|
|
12653
|
+
};
|
|
12654
|
+
const handleColumnRename = (columnId) => {
|
|
12655
|
+
const column = columns.find((col) => col.id === columnId);
|
|
12656
|
+
if (!column || !editingColumnTitle.trim())
|
|
12657
|
+
return;
|
|
12658
|
+
const updatedColumn = { ...column, title: editingColumnTitle.trim() };
|
|
12659
|
+
onColumnUpdate?.(updatedColumn);
|
|
12660
|
+
setColumns(columns.map((col) => col.id === columnId ? updatedColumn : col));
|
|
12661
|
+
setEditingColumnId(null);
|
|
12662
|
+
setEditingColumnTitle("");
|
|
12663
|
+
toast3({
|
|
12664
|
+
title: "Column renamed",
|
|
12665
|
+
description: `Column renamed to "${editingColumnTitle.trim()}"`
|
|
12666
|
+
});
|
|
12667
|
+
};
|
|
12668
|
+
const handleWipLimitUpdate = () => {
|
|
12669
|
+
const column = columns.find((col) => col.id === wipLimitColumnId);
|
|
12670
|
+
if (!column)
|
|
12671
|
+
return;
|
|
12672
|
+
const updatedColumn = { ...column, limit: wipLimit };
|
|
12673
|
+
onColumnUpdate?.(updatedColumn);
|
|
12674
|
+
setColumns(columns.map((col) => col.id === wipLimitColumnId ? updatedColumn : col));
|
|
12675
|
+
setWipLimitModalOpen(false);
|
|
12676
|
+
toast3({
|
|
12677
|
+
title: "WIP limit updated",
|
|
12678
|
+
description: wipLimit ? `WIP limit set to ${wipLimit}` : "WIP limit removed"
|
|
12679
|
+
});
|
|
12680
|
+
};
|
|
12681
|
+
const handleColorUpdate = () => {
|
|
12682
|
+
const column = columns.find((col) => col.id === colorPickerColumnId);
|
|
12683
|
+
if (!column)
|
|
12684
|
+
return;
|
|
12685
|
+
const updatedColumn = { ...column, color: selectedColor };
|
|
12686
|
+
onColumnUpdate?.(updatedColumn);
|
|
12687
|
+
setColumns(columns.map((col) => col.id === colorPickerColumnId ? updatedColumn : col));
|
|
12688
|
+
setColorPickerOpen(false);
|
|
12689
|
+
toast3({
|
|
12690
|
+
title: "Column color updated",
|
|
12691
|
+
description: "Column color has been changed"
|
|
12692
|
+
});
|
|
12693
|
+
};
|
|
12694
|
+
const handleExport = (format5) => {
|
|
12695
|
+
if (onExport) {
|
|
12696
|
+
onExport(format5);
|
|
12697
|
+
} else {
|
|
12698
|
+
if (format5 === "json") {
|
|
12699
|
+
const data = JSON.stringify(columns, null, 2);
|
|
12700
|
+
const blob = new Blob([data], { type: "application/json" });
|
|
12701
|
+
const url = URL.createObjectURL(blob);
|
|
12702
|
+
const a = document.createElement("a");
|
|
12703
|
+
a.href = url;
|
|
12704
|
+
a.download = "kanban-board.json";
|
|
12705
|
+
document.body.appendChild(a);
|
|
12706
|
+
a.click();
|
|
12707
|
+
document.body.removeChild(a);
|
|
12708
|
+
URL.revokeObjectURL(url);
|
|
12709
|
+
toast3({
|
|
12710
|
+
title: "Board exported",
|
|
12711
|
+
description: "Board exported as JSON file"
|
|
12712
|
+
});
|
|
12713
|
+
} else if (format5 === "csv") {
|
|
12714
|
+
let csv = "Column,Card Title,Description,Priority,Assignees,Due Date,Tags\n";
|
|
12715
|
+
columns.forEach((column) => {
|
|
12716
|
+
column.cards.forEach((card) => {
|
|
12717
|
+
csv += `"${column.title}",`;
|
|
12718
|
+
csv += `"${card.title}",`;
|
|
12719
|
+
csv += `"${card.description || ""}",`;
|
|
12720
|
+
csv += `"${card.priority || ""}",`;
|
|
12721
|
+
csv += `"${card.assignees?.map((a2) => a2.name).join(", ") || ""}",`;
|
|
12722
|
+
csv += `"${card.dueDate ? new Date(card.dueDate).toLocaleDateString() : ""}",`;
|
|
12723
|
+
csv += `"${card.tags?.join(", ") || ""}"
|
|
12724
|
+
`;
|
|
12725
|
+
});
|
|
12726
|
+
});
|
|
12727
|
+
const blob = new Blob([csv], { type: "text/csv" });
|
|
12728
|
+
const url = URL.createObjectURL(blob);
|
|
12729
|
+
const a = document.createElement("a");
|
|
12730
|
+
a.href = url;
|
|
12731
|
+
a.download = "kanban-board.csv";
|
|
12732
|
+
document.body.appendChild(a);
|
|
12733
|
+
a.click();
|
|
12734
|
+
document.body.removeChild(a);
|
|
12735
|
+
URL.revokeObjectURL(url);
|
|
12736
|
+
toast3({
|
|
12737
|
+
title: "Board exported",
|
|
12738
|
+
description: "Board exported as CSV file"
|
|
12739
|
+
});
|
|
12740
|
+
}
|
|
12741
|
+
}
|
|
12742
|
+
};
|
|
11543
12743
|
if (loading) {
|
|
11544
12744
|
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
12745
|
/* @__PURE__ */ jsx(MoonUICardHeaderPro, { children: /* @__PURE__ */ jsx(MoonUISkeletonPro, { className: "h-4 w-24" }) }),
|
|
@@ -11620,14 +12820,14 @@ function Kanban({
|
|
|
11620
12820
|
] })
|
|
11621
12821
|
] })
|
|
11622
12822
|
] }),
|
|
11623
|
-
|
|
12823
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
11624
12824
|
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", size: "sm", children: [
|
|
11625
12825
|
/* @__PURE__ */ jsx(Download, { className: "mr-2 h-4 w-4" }),
|
|
11626
12826
|
"Export"
|
|
11627
12827
|
] }) }),
|
|
11628
12828
|
/* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", children: [
|
|
11629
|
-
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () =>
|
|
11630
|
-
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () =>
|
|
12829
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => handleExport("json"), children: "Export as JSON" }),
|
|
12830
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => handleExport("csv"), children: "Export as CSV" })
|
|
11631
12831
|
] })
|
|
11632
12832
|
] })
|
|
11633
12833
|
] })
|
|
@@ -11688,10 +12888,29 @@ function Kanban({
|
|
|
11688
12888
|
style: { backgroundColor: column.color }
|
|
11689
12889
|
}
|
|
11690
12890
|
),
|
|
11691
|
-
/* @__PURE__ */
|
|
12891
|
+
/* @__PURE__ */ jsx(MoonUICardTitlePro, { className: "text-sm font-medium flex items-center gap-2", children: editingColumnId === column.id ? /* @__PURE__ */ jsx(
|
|
12892
|
+
MoonUIInputPro,
|
|
12893
|
+
{
|
|
12894
|
+
value: editingColumnTitle,
|
|
12895
|
+
onChange: (e) => setEditingColumnTitle(e.target.value),
|
|
12896
|
+
onBlur: () => handleColumnRename(column.id),
|
|
12897
|
+
onKeyDown: (e) => {
|
|
12898
|
+
if (e.key === "Enter") {
|
|
12899
|
+
handleColumnRename(column.id);
|
|
12900
|
+
}
|
|
12901
|
+
if (e.key === "Escape") {
|
|
12902
|
+
setEditingColumnId(null);
|
|
12903
|
+
setEditingColumnTitle("");
|
|
12904
|
+
}
|
|
12905
|
+
},
|
|
12906
|
+
className: "h-6 w-32 text-sm",
|
|
12907
|
+
autoFocus: true,
|
|
12908
|
+
onClick: (e) => e.stopPropagation()
|
|
12909
|
+
}
|
|
12910
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11692
12911
|
column.title,
|
|
11693
12912
|
column.locked && /* @__PURE__ */ jsx(Lock, { className: "h-3 w-3" })
|
|
11694
|
-
] }),
|
|
12913
|
+
] }) }),
|
|
11695
12914
|
/* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs", children: column.cards.length })
|
|
11696
12915
|
] }),
|
|
11697
12916
|
/* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
@@ -11719,13 +12938,20 @@ function Kanban({
|
|
|
11719
12938
|
/* @__PURE__ */ jsx(Timer, { className: "mr-2 h-4 w-4" }),
|
|
11720
12939
|
"Set WIP limit"
|
|
11721
12940
|
] }),
|
|
11722
|
-
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
|
|
12941
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "changeColor"), children: [
|
|
11723
12942
|
/* @__PURE__ */ jsx(Palette, { className: "mr-2 h-4 w-4" }),
|
|
11724
12943
|
"Change color"
|
|
11725
12944
|
] }),
|
|
11726
|
-
/* @__PURE__ */ jsxs(
|
|
11727
|
-
/* @__PURE__ */
|
|
11728
|
-
|
|
12945
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuSubPro, { children: [
|
|
12946
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuSubTriggerPro, { children: [
|
|
12947
|
+
/* @__PURE__ */ jsx(ArrowUpDown, { className: "mr-2 h-4 w-4" }),
|
|
12948
|
+
"Sort cards"
|
|
12949
|
+
] }),
|
|
12950
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuSubContentPro, { children: [
|
|
12951
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "sortByPriority"), children: "By Priority" }),
|
|
12952
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "sortByDueDate"), children: "By Due Date" }),
|
|
12953
|
+
/* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "sortAlphabetically"), children: "Alphabetically" })
|
|
12954
|
+
] })
|
|
11729
12955
|
] })
|
|
11730
12956
|
] })
|
|
11731
12957
|
] }),
|
|
@@ -11782,7 +13008,7 @@ function Kanban({
|
|
|
11782
13008
|
e.stopPropagation();
|
|
11783
13009
|
onCardDelete?.(card);
|
|
11784
13010
|
},
|
|
11785
|
-
onClick: () =>
|
|
13011
|
+
onClick: () => handleCardClick(card),
|
|
11786
13012
|
showDetails: showCardDetails,
|
|
11787
13013
|
disabled
|
|
11788
13014
|
}
|
|
@@ -11807,14 +13033,14 @@ function Kanban({
|
|
|
11807
13033
|
/* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "start", className: "w-48", children: [
|
|
11808
13034
|
/* @__PURE__ */ jsx(MoonUIDropdownMenuLabelPro, { children: "Card Templates" }),
|
|
11809
13035
|
/* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
|
|
11810
|
-
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () =>
|
|
13036
|
+
/* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleAddCard(column.id), children: [
|
|
11811
13037
|
/* @__PURE__ */ jsx(FileText, { className: "mr-2 h-4 w-4" }),
|
|
11812
13038
|
"Blank card"
|
|
11813
13039
|
] }),
|
|
11814
13040
|
cardTemplates.map((template, index2) => /* @__PURE__ */ jsxs(
|
|
11815
13041
|
MoonUIDropdownMenuItemPro,
|
|
11816
13042
|
{
|
|
11817
|
-
onClick: () =>
|
|
13043
|
+
onClick: () => handleAddCard(column.id, template),
|
|
11818
13044
|
children: [
|
|
11819
13045
|
/* @__PURE__ */ jsx(Star, { className: "mr-2 h-4 w-4" }),
|
|
11820
13046
|
template.title || `Template ${index2 + 1}`
|
|
@@ -11934,7 +13160,101 @@ function Kanban({
|
|
|
11934
13160
|
)
|
|
11935
13161
|
]
|
|
11936
13162
|
}
|
|
11937
|
-
)
|
|
13163
|
+
),
|
|
13164
|
+
selectedCard && /* @__PURE__ */ jsx(
|
|
13165
|
+
CardDetailModal,
|
|
13166
|
+
{
|
|
13167
|
+
card: selectedCard,
|
|
13168
|
+
isOpen: !!selectedCard,
|
|
13169
|
+
onClose: () => setSelectedCard(null),
|
|
13170
|
+
onUpdate: handleCardUpdate,
|
|
13171
|
+
onDelete: (card) => {
|
|
13172
|
+
onCardDelete?.(card);
|
|
13173
|
+
toast3({
|
|
13174
|
+
title: "Card deleted",
|
|
13175
|
+
description: `"${card.title}" has been deleted`
|
|
13176
|
+
});
|
|
13177
|
+
},
|
|
13178
|
+
availableAssignees: users,
|
|
13179
|
+
availableLabels: labels,
|
|
13180
|
+
currentColumn: columns.find((col) => col.cards.some((c2) => c2.id === selectedCard.id))?.title,
|
|
13181
|
+
availableColumns: columns.map((col) => ({ id: col.id, title: col.title }))
|
|
13182
|
+
}
|
|
13183
|
+
),
|
|
13184
|
+
addCardColumnId && /* @__PURE__ */ jsx(
|
|
13185
|
+
AddCardModal,
|
|
13186
|
+
{
|
|
13187
|
+
isOpen: !!addCardColumnId,
|
|
13188
|
+
onClose: () => setAddCardColumnId(null),
|
|
13189
|
+
onAdd: handleAddNewCard,
|
|
13190
|
+
columnId: addCardColumnId,
|
|
13191
|
+
columnTitle: columns.find((col) => col.id === addCardColumnId)?.title || "",
|
|
13192
|
+
availableAssignees: users,
|
|
13193
|
+
availableLabels: labels,
|
|
13194
|
+
templates: cardTemplates
|
|
13195
|
+
}
|
|
13196
|
+
),
|
|
13197
|
+
/* @__PURE__ */ jsx(MoonUIDialogPro, { open: wipLimitModalOpen, onOpenChange: setWipLimitModalOpen, children: /* @__PURE__ */ jsxs(MoonUIDialogContentPro, { className: "sm:max-w-md", children: [
|
|
13198
|
+
/* @__PURE__ */ jsx(MoonUIDialogHeaderPro, { children: /* @__PURE__ */ jsx(MoonUIDialogTitlePro, { children: "Set WIP Limit" }) }),
|
|
13199
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
13200
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { htmlFor: "wip-limit", children: "Work In Progress Limit" }),
|
|
13201
|
+
/* @__PURE__ */ jsx(
|
|
13202
|
+
MoonUIInputPro,
|
|
13203
|
+
{
|
|
13204
|
+
id: "wip-limit",
|
|
13205
|
+
type: "number",
|
|
13206
|
+
min: "0",
|
|
13207
|
+
value: wipLimit || "",
|
|
13208
|
+
onChange: (e) => setWipLimit(e.target.value ? parseInt(e.target.value) : void 0),
|
|
13209
|
+
placeholder: "Enter a number (leave empty to remove limit)"
|
|
13210
|
+
}
|
|
13211
|
+
),
|
|
13212
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Set a maximum number of cards allowed in this column. Leave empty to remove the limit." })
|
|
13213
|
+
] }) }),
|
|
13214
|
+
/* @__PURE__ */ jsxs(MoonUIDialogFooterPro, { children: [
|
|
13215
|
+
/* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", onClick: () => setWipLimitModalOpen(false), children: "Cancel" }),
|
|
13216
|
+
/* @__PURE__ */ jsx(MoonUIButtonPro, { onClick: handleWipLimitUpdate, children: "Save" })
|
|
13217
|
+
] })
|
|
13218
|
+
] }) }),
|
|
13219
|
+
/* @__PURE__ */ jsx(MoonUIDialogPro, { open: colorPickerOpen, onOpenChange: setColorPickerOpen, children: /* @__PURE__ */ jsxs(MoonUIDialogContentPro, { className: "sm:max-w-md", children: [
|
|
13220
|
+
/* @__PURE__ */ jsx(MoonUIDialogHeaderPro, { children: /* @__PURE__ */ jsx(MoonUIDialogTitlePro, { children: "Change Column Color" }) }),
|
|
13221
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
13222
|
+
/* @__PURE__ */ jsx(MoonUILabelPro, { children: "Select a color" }),
|
|
13223
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-8 gap-2", children: [
|
|
13224
|
+
"#6B7280",
|
|
13225
|
+
"#EF4444",
|
|
13226
|
+
"#F59E0B",
|
|
13227
|
+
"#10B981",
|
|
13228
|
+
"#3B82F6",
|
|
13229
|
+
"#8B5CF6",
|
|
13230
|
+
"#EC4899",
|
|
13231
|
+
"#06B6D4",
|
|
13232
|
+
"#F43F5E",
|
|
13233
|
+
"#84CC16",
|
|
13234
|
+
"#14B8A6",
|
|
13235
|
+
"#6366F1",
|
|
13236
|
+
"#A855F7",
|
|
13237
|
+
"#F472B6",
|
|
13238
|
+
"#0EA5E9",
|
|
13239
|
+
"#22D3EE"
|
|
13240
|
+
].map((color) => /* @__PURE__ */ jsx(
|
|
13241
|
+
"button",
|
|
13242
|
+
{
|
|
13243
|
+
className: cn(
|
|
13244
|
+
"w-10 h-10 rounded-md border-2 transition-all",
|
|
13245
|
+
selectedColor === color ? "border-primary scale-110" : "border-transparent"
|
|
13246
|
+
),
|
|
13247
|
+
style: { backgroundColor: color },
|
|
13248
|
+
onClick: () => setSelectedColor(color)
|
|
13249
|
+
},
|
|
13250
|
+
color
|
|
13251
|
+
)) })
|
|
13252
|
+
] }) }),
|
|
13253
|
+
/* @__PURE__ */ jsxs(MoonUIDialogFooterPro, { children: [
|
|
13254
|
+
/* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", onClick: () => setColorPickerOpen(false), children: "Cancel" }),
|
|
13255
|
+
/* @__PURE__ */ jsx(MoonUIButtonPro, { onClick: handleColorUpdate, children: "Save" })
|
|
13256
|
+
] })
|
|
13257
|
+
] }) })
|
|
11938
13258
|
] });
|
|
11939
13259
|
}
|
|
11940
13260
|
|
|
@@ -12120,7 +13440,7 @@ function findDiffEnd(a, b, posA, posB) {
|
|
|
12120
13440
|
posB -= size4;
|
|
12121
13441
|
}
|
|
12122
13442
|
}
|
|
12123
|
-
var
|
|
13443
|
+
var Fragment7 = class {
|
|
12124
13444
|
/**
|
|
12125
13445
|
@internal
|
|
12126
13446
|
*/
|
|
@@ -12188,7 +13508,7 @@ var Fragment5 = class {
|
|
|
12188
13508
|
}
|
|
12189
13509
|
for (; i < other.content.length; i++)
|
|
12190
13510
|
content.push(other.content[i]);
|
|
12191
|
-
return new
|
|
13511
|
+
return new Fragment7(content, this.size + other.size);
|
|
12192
13512
|
}
|
|
12193
13513
|
/**
|
|
12194
13514
|
Cut out the sub-fragment between the two given positions.
|
|
@@ -12212,17 +13532,17 @@ var Fragment5 = class {
|
|
|
12212
13532
|
}
|
|
12213
13533
|
pos = end;
|
|
12214
13534
|
}
|
|
12215
|
-
return new
|
|
13535
|
+
return new Fragment7(result, size4);
|
|
12216
13536
|
}
|
|
12217
13537
|
/**
|
|
12218
13538
|
@internal
|
|
12219
13539
|
*/
|
|
12220
13540
|
cutByIndex(from2, to) {
|
|
12221
13541
|
if (from2 == to)
|
|
12222
|
-
return
|
|
13542
|
+
return Fragment7.empty;
|
|
12223
13543
|
if (from2 == 0 && to == this.content.length)
|
|
12224
13544
|
return this;
|
|
12225
|
-
return new
|
|
13545
|
+
return new Fragment7(this.content.slice(from2, to));
|
|
12226
13546
|
}
|
|
12227
13547
|
/**
|
|
12228
13548
|
Create a new fragment in which the node at the given index is
|
|
@@ -12235,21 +13555,21 @@ var Fragment5 = class {
|
|
|
12235
13555
|
let copy2 = this.content.slice();
|
|
12236
13556
|
let size4 = this.size + node.nodeSize - current.nodeSize;
|
|
12237
13557
|
copy2[index2] = node;
|
|
12238
|
-
return new
|
|
13558
|
+
return new Fragment7(copy2, size4);
|
|
12239
13559
|
}
|
|
12240
13560
|
/**
|
|
12241
13561
|
Create a new fragment by prepending the given node to this
|
|
12242
13562
|
fragment.
|
|
12243
13563
|
*/
|
|
12244
13564
|
addToStart(node) {
|
|
12245
|
-
return new
|
|
13565
|
+
return new Fragment7([node].concat(this.content), this.size + node.nodeSize);
|
|
12246
13566
|
}
|
|
12247
13567
|
/**
|
|
12248
13568
|
Create a new fragment by appending the given node to this
|
|
12249
13569
|
fragment.
|
|
12250
13570
|
*/
|
|
12251
13571
|
addToEnd(node) {
|
|
12252
|
-
return new
|
|
13572
|
+
return new Fragment7(this.content.concat(node), this.size + node.nodeSize);
|
|
12253
13573
|
}
|
|
12254
13574
|
/**
|
|
12255
13575
|
Compare this fragment to another one.
|
|
@@ -12368,10 +13688,10 @@ var Fragment5 = class {
|
|
|
12368
13688
|
*/
|
|
12369
13689
|
static fromJSON(schema, value) {
|
|
12370
13690
|
if (!value)
|
|
12371
|
-
return
|
|
13691
|
+
return Fragment7.empty;
|
|
12372
13692
|
if (!Array.isArray(value))
|
|
12373
13693
|
throw new RangeError("Invalid input for Fragment.fromJSON");
|
|
12374
|
-
return new
|
|
13694
|
+
return new Fragment7(value.map(schema.nodeFromJSON));
|
|
12375
13695
|
}
|
|
12376
13696
|
/**
|
|
12377
13697
|
Build a fragment from an array of nodes. Ensures that adjacent
|
|
@@ -12379,7 +13699,7 @@ var Fragment5 = class {
|
|
|
12379
13699
|
*/
|
|
12380
13700
|
static fromArray(array) {
|
|
12381
13701
|
if (!array.length)
|
|
12382
|
-
return
|
|
13702
|
+
return Fragment7.empty;
|
|
12383
13703
|
let joined, size4 = 0;
|
|
12384
13704
|
for (let i = 0; i < array.length; i++) {
|
|
12385
13705
|
let node = array[i];
|
|
@@ -12392,7 +13712,7 @@ var Fragment5 = class {
|
|
|
12392
13712
|
joined.push(node);
|
|
12393
13713
|
}
|
|
12394
13714
|
}
|
|
12395
|
-
return new
|
|
13715
|
+
return new Fragment7(joined || array, size4);
|
|
12396
13716
|
}
|
|
12397
13717
|
/**
|
|
12398
13718
|
Create a fragment from something that can be interpreted as a
|
|
@@ -12402,17 +13722,17 @@ var Fragment5 = class {
|
|
|
12402
13722
|
*/
|
|
12403
13723
|
static from(nodes) {
|
|
12404
13724
|
if (!nodes)
|
|
12405
|
-
return
|
|
12406
|
-
if (nodes instanceof
|
|
13725
|
+
return Fragment7.empty;
|
|
13726
|
+
if (nodes instanceof Fragment7)
|
|
12407
13727
|
return nodes;
|
|
12408
13728
|
if (Array.isArray(nodes))
|
|
12409
13729
|
return this.fromArray(nodes);
|
|
12410
13730
|
if (nodes.attrs)
|
|
12411
|
-
return new
|
|
13731
|
+
return new Fragment7([nodes], nodes.nodeSize);
|
|
12412
13732
|
throw new RangeError("Can not convert " + nodes + " to a Fragment" + (nodes.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
|
|
12413
13733
|
}
|
|
12414
13734
|
};
|
|
12415
|
-
|
|
13735
|
+
Fragment7.empty = new Fragment7([], 0);
|
|
12416
13736
|
var found = { index: 0, offset: 0 };
|
|
12417
13737
|
function retIndex(index2, offset4) {
|
|
12418
13738
|
found.index = index2;
|
|
@@ -12637,7 +13957,7 @@ var Slice = class {
|
|
|
12637
13957
|
let openStart = json2.openStart || 0, openEnd = json2.openEnd || 0;
|
|
12638
13958
|
if (typeof openStart != "number" || typeof openEnd != "number")
|
|
12639
13959
|
throw new RangeError("Invalid input for Slice.fromJSON");
|
|
12640
|
-
return new Slice(
|
|
13960
|
+
return new Slice(Fragment7.fromJSON(schema, json2.content), openStart, openEnd);
|
|
12641
13961
|
}
|
|
12642
13962
|
/**
|
|
12643
13963
|
Create a slice from a fragment by taking the maximum possible
|
|
@@ -12652,7 +13972,7 @@ var Slice = class {
|
|
|
12652
13972
|
return new Slice(fragment, openStart, openEnd);
|
|
12653
13973
|
}
|
|
12654
13974
|
};
|
|
12655
|
-
Slice.empty = new Slice(
|
|
13975
|
+
Slice.empty = new Slice(Fragment7.empty, 0, 0);
|
|
12656
13976
|
function removeRange(content, from2, to) {
|
|
12657
13977
|
let { index: index2, offset: offset4 } = content.findIndex(from2), child = content.maybeChild(index2);
|
|
12658
13978
|
let { index: indexTo, offset: offsetTo } = content.findIndex(to);
|
|
@@ -12750,7 +14070,7 @@ function replaceThreeWay($from, $start, $end, $to, depth) {
|
|
|
12750
14070
|
addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);
|
|
12751
14071
|
}
|
|
12752
14072
|
addRange($to, null, depth, content);
|
|
12753
|
-
return new
|
|
14073
|
+
return new Fragment7(content);
|
|
12754
14074
|
}
|
|
12755
14075
|
function replaceTwoWay($from, $to, depth) {
|
|
12756
14076
|
let content = [];
|
|
@@ -12760,13 +14080,13 @@ function replaceTwoWay($from, $to, depth) {
|
|
|
12760
14080
|
addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);
|
|
12761
14081
|
}
|
|
12762
14082
|
addRange($to, null, depth, content);
|
|
12763
|
-
return new
|
|
14083
|
+
return new Fragment7(content);
|
|
12764
14084
|
}
|
|
12765
14085
|
function prepareSliceForReplace(slice2, $along) {
|
|
12766
14086
|
let extra = $along.depth - slice2.openStart, parent = $along.node(extra);
|
|
12767
14087
|
let node = parent.copy(slice2.content);
|
|
12768
14088
|
for (let i = extra - 1; i >= 0; i--)
|
|
12769
|
-
node = $along.node(i).copy(
|
|
14089
|
+
node = $along.node(i).copy(Fragment7.from(node));
|
|
12770
14090
|
return {
|
|
12771
14091
|
start: node.resolveNoCache(slice2.openStart + extra),
|
|
12772
14092
|
end: node.resolveNoCache(node.content.size - slice2.openEnd - extra)
|
|
@@ -13105,7 +14425,7 @@ var Node2 = class {
|
|
|
13105
14425
|
this.type = type;
|
|
13106
14426
|
this.attrs = attrs;
|
|
13107
14427
|
this.marks = marks;
|
|
13108
|
-
this.content = content ||
|
|
14428
|
+
this.content = content || Fragment7.empty;
|
|
13109
14429
|
}
|
|
13110
14430
|
/**
|
|
13111
14431
|
The array of this node's child nodes.
|
|
@@ -13410,7 +14730,7 @@ var Node2 = class {
|
|
|
13410
14730
|
can optionally pass `start` and `end` indices into the
|
|
13411
14731
|
replacement fragment.
|
|
13412
14732
|
*/
|
|
13413
|
-
canReplace(from2, to, replacement =
|
|
14733
|
+
canReplace(from2, to, replacement = Fragment7.empty, start = 0, end = replacement.childCount) {
|
|
13414
14734
|
let one = this.contentMatchAt(from2).matchFragment(replacement, start, end);
|
|
13415
14735
|
let two = one && one.matchFragment(this.content, to);
|
|
13416
14736
|
if (!two || !two.validEnd)
|
|
@@ -13492,7 +14812,7 @@ var Node2 = class {
|
|
|
13492
14812
|
throw new RangeError("Invalid text node in JSON");
|
|
13493
14813
|
return schema.text(json2.text, marks);
|
|
13494
14814
|
}
|
|
13495
|
-
let content =
|
|
14815
|
+
let content = Fragment7.fromJSON(schema, json2.content);
|
|
13496
14816
|
let node = schema.nodeType(json2.type).create(json2.attrs, content, marks);
|
|
13497
14817
|
node.type.checkAttrs(node.attrs);
|
|
13498
14818
|
return node;
|
|
@@ -13634,7 +14954,7 @@ var ContentMatch = class {
|
|
|
13634
14954
|
function search(match, types) {
|
|
13635
14955
|
let finished = match.matchFragment(after, startIndex);
|
|
13636
14956
|
if (finished && (!toEnd || finished.validEnd))
|
|
13637
|
-
return
|
|
14957
|
+
return Fragment7.from(types.map((tp) => tp.createAndFill()));
|
|
13638
14958
|
for (let i = 0; i < match.next.length; i++) {
|
|
13639
14959
|
let { type, next } = match.next[i];
|
|
13640
14960
|
if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {
|
|
@@ -14086,7 +15406,7 @@ var NodeType = class {
|
|
|
14086
15406
|
create(attrs = null, content, marks) {
|
|
14087
15407
|
if (this.isText)
|
|
14088
15408
|
throw new Error("NodeType.create can't construct text nodes");
|
|
14089
|
-
return new Node2(this, this.computeAttrs(attrs),
|
|
15409
|
+
return new Node2(this, this.computeAttrs(attrs), Fragment7.from(content), Mark.setFrom(marks));
|
|
14090
15410
|
}
|
|
14091
15411
|
/**
|
|
14092
15412
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
|
|
@@ -14094,7 +15414,7 @@ var NodeType = class {
|
|
|
14094
15414
|
if it doesn't match.
|
|
14095
15415
|
*/
|
|
14096
15416
|
createChecked(attrs = null, content, marks) {
|
|
14097
|
-
content =
|
|
15417
|
+
content = Fragment7.from(content);
|
|
14098
15418
|
this.checkContent(content);
|
|
14099
15419
|
return new Node2(this, this.computeAttrs(attrs), content, Mark.setFrom(marks));
|
|
14100
15420
|
}
|
|
@@ -14108,7 +15428,7 @@ var NodeType = class {
|
|
|
14108
15428
|
*/
|
|
14109
15429
|
createAndFill(attrs = null, content, marks) {
|
|
14110
15430
|
attrs = this.computeAttrs(attrs);
|
|
14111
|
-
content =
|
|
15431
|
+
content = Fragment7.from(content);
|
|
14112
15432
|
if (content.size) {
|
|
14113
15433
|
let before = this.contentMatch.fillBefore(content);
|
|
14114
15434
|
if (!before)
|
|
@@ -14116,7 +15436,7 @@ var NodeType = class {
|
|
|
14116
15436
|
content = before.append(content);
|
|
14117
15437
|
}
|
|
14118
15438
|
let matched = this.contentMatch.matchFragment(content);
|
|
14119
|
-
let after = matched && matched.fillBefore(
|
|
15439
|
+
let after = matched && matched.fillBefore(Fragment7.empty, true);
|
|
14120
15440
|
if (!after)
|
|
14121
15441
|
return null;
|
|
14122
15442
|
return new Node2(this, attrs, content.append(after), Mark.setFrom(marks));
|
|
@@ -14580,7 +15900,7 @@ var NodeContext = class {
|
|
|
14580
15900
|
if (!this.match) {
|
|
14581
15901
|
if (!this.type)
|
|
14582
15902
|
return [];
|
|
14583
|
-
let fill = this.type.contentMatch.fillBefore(
|
|
15903
|
+
let fill = this.type.contentMatch.fillBefore(Fragment7.from(node));
|
|
14584
15904
|
if (fill) {
|
|
14585
15905
|
this.match = this.type.contentMatch.matchFragment(fill);
|
|
14586
15906
|
} else {
|
|
@@ -14606,9 +15926,9 @@ var NodeContext = class {
|
|
|
14606
15926
|
this.content[this.content.length - 1] = text.withText(text.text.slice(0, text.text.length - m2[0].length));
|
|
14607
15927
|
}
|
|
14608
15928
|
}
|
|
14609
|
-
let content =
|
|
15929
|
+
let content = Fragment7.from(this.content);
|
|
14610
15930
|
if (!openEnd && this.match)
|
|
14611
|
-
content = content.append(this.match.fillBefore(
|
|
15931
|
+
content = content.append(this.match.fillBefore(Fragment7.empty, true));
|
|
14612
15932
|
return this.type ? this.type.create(this.attrs, content, this.marks) : content;
|
|
14613
15933
|
}
|
|
14614
15934
|
inlineContext(node) {
|
|
@@ -15625,7 +16945,7 @@ function mapFragment(fragment, f, parent) {
|
|
|
15625
16945
|
child = f(child, parent, i);
|
|
15626
16946
|
mapped.push(child);
|
|
15627
16947
|
}
|
|
15628
|
-
return
|
|
16948
|
+
return Fragment7.fromArray(mapped);
|
|
15629
16949
|
}
|
|
15630
16950
|
var AddMarkStep = class extends Step {
|
|
15631
16951
|
/**
|
|
@@ -15742,7 +17062,7 @@ var AddNodeMarkStep = class extends Step {
|
|
|
15742
17062
|
if (!node)
|
|
15743
17063
|
return StepResult.fail("No node at mark step's position");
|
|
15744
17064
|
let updated = node.type.create(node.attrs, null, this.mark.addToSet(node.marks));
|
|
15745
|
-
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(
|
|
17065
|
+
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment7.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
15746
17066
|
}
|
|
15747
17067
|
invert(doc3) {
|
|
15748
17068
|
let node = doc3.nodeAt(this.pos);
|
|
@@ -15788,7 +17108,7 @@ var RemoveNodeMarkStep = class extends Step {
|
|
|
15788
17108
|
if (!node)
|
|
15789
17109
|
return StepResult.fail("No node at mark step's position");
|
|
15790
17110
|
let updated = node.type.create(node.attrs, null, this.mark.removeFromSet(node.marks));
|
|
15791
|
-
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(
|
|
17111
|
+
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment7.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
15792
17112
|
}
|
|
15793
17113
|
invert(doc3) {
|
|
15794
17114
|
let node = doc3.nodeAt(this.pos);
|
|
@@ -16053,7 +17373,7 @@ function clearIncompatible(tr2, pos, parentType, match = parentType.contentMatch
|
|
|
16053
17373
|
let m2, newline = /\r?\n|\r/g, slice2;
|
|
16054
17374
|
while (m2 = newline.exec(child.text)) {
|
|
16055
17375
|
if (!slice2)
|
|
16056
|
-
slice2 = new Slice(
|
|
17376
|
+
slice2 = new Slice(Fragment7.from(parentType.schema.text(" ", parentType.allowedMarks(child.marks))), 0, 0);
|
|
16057
17377
|
replSteps.push(new ReplaceStep(cur + m2.index, cur + m2.index + m2[0].length, slice2));
|
|
16058
17378
|
}
|
|
16059
17379
|
}
|
|
@@ -16061,7 +17381,7 @@ function clearIncompatible(tr2, pos, parentType, match = parentType.contentMatch
|
|
|
16061
17381
|
cur = end;
|
|
16062
17382
|
}
|
|
16063
17383
|
if (!match.validEnd) {
|
|
16064
|
-
let fill = match.fillBefore(
|
|
17384
|
+
let fill = match.fillBefore(Fragment7.empty, true);
|
|
16065
17385
|
tr2.replace(cur, cur, new Slice(fill, 0, 0));
|
|
16066
17386
|
}
|
|
16067
17387
|
for (let i = replSteps.length - 1; i >= 0; i--)
|
|
@@ -16087,20 +17407,20 @@ function lift(tr2, range, target) {
|
|
|
16087
17407
|
let { $from, $to, depth } = range;
|
|
16088
17408
|
let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);
|
|
16089
17409
|
let start = gapStart, end = gapEnd;
|
|
16090
|
-
let before =
|
|
17410
|
+
let before = Fragment7.empty, openStart = 0;
|
|
16091
17411
|
for (let d = depth, splitting = false; d > target; d--)
|
|
16092
17412
|
if (splitting || $from.index(d) > 0) {
|
|
16093
17413
|
splitting = true;
|
|
16094
|
-
before =
|
|
17414
|
+
before = Fragment7.from($from.node(d).copy(before));
|
|
16095
17415
|
openStart++;
|
|
16096
17416
|
} else {
|
|
16097
17417
|
start--;
|
|
16098
17418
|
}
|
|
16099
|
-
let after =
|
|
17419
|
+
let after = Fragment7.empty, openEnd = 0;
|
|
16100
17420
|
for (let d = depth, splitting = false; d > target; d--)
|
|
16101
17421
|
if (splitting || $to.after(d + 1) < $to.end(d)) {
|
|
16102
17422
|
splitting = true;
|
|
16103
|
-
after =
|
|
17423
|
+
after = Fragment7.from($to.node(d).copy(after));
|
|
16104
17424
|
openEnd++;
|
|
16105
17425
|
} else {
|
|
16106
17426
|
end++;
|
|
@@ -16140,14 +17460,14 @@ function findWrappingInside(range, type) {
|
|
|
16140
17460
|
return inside;
|
|
16141
17461
|
}
|
|
16142
17462
|
function wrap(tr2, range, wrappers) {
|
|
16143
|
-
let content =
|
|
17463
|
+
let content = Fragment7.empty;
|
|
16144
17464
|
for (let i = wrappers.length - 1; i >= 0; i--) {
|
|
16145
17465
|
if (content.size) {
|
|
16146
17466
|
let match = wrappers[i].type.contentMatch.matchFragment(content);
|
|
16147
17467
|
if (!match || !match.validEnd)
|
|
16148
17468
|
throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
|
|
16149
17469
|
}
|
|
16150
|
-
content =
|
|
17470
|
+
content = Fragment7.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
16151
17471
|
}
|
|
16152
17472
|
let start = range.start, end = range.end;
|
|
16153
17473
|
tr2.step(new ReplaceAroundStep(start, end, start, end, new Slice(content, 0, 0), wrappers.length, true));
|
|
@@ -16172,7 +17492,7 @@ function setBlockType(tr2, from2, to, type, attrs) {
|
|
|
16172
17492
|
clearIncompatible(tr2, tr2.mapping.slice(mapFrom).map(pos, 1), type, void 0, convertNewlines === null);
|
|
16173
17493
|
let mapping = tr2.mapping.slice(mapFrom);
|
|
16174
17494
|
let startM = mapping.map(pos, 1), endM = mapping.map(pos + node.nodeSize, 1);
|
|
16175
|
-
tr2.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(
|
|
17495
|
+
tr2.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment7.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));
|
|
16176
17496
|
if (convertNewlines === true)
|
|
16177
17497
|
replaceNewlines(tr2, node, pos, mapFrom);
|
|
16178
17498
|
return false;
|
|
@@ -16213,7 +17533,7 @@ function setNodeMarkup(tr2, pos, type, attrs, marks) {
|
|
|
16213
17533
|
return tr2.replaceWith(pos, pos + node.nodeSize, newNode);
|
|
16214
17534
|
if (!type.validContent(node.content))
|
|
16215
17535
|
throw new RangeError("Invalid content for node type " + type.name);
|
|
16216
|
-
tr2.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(
|
|
17536
|
+
tr2.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment7.from(newNode), 0, 0), 1, true));
|
|
16217
17537
|
}
|
|
16218
17538
|
function canSplit(doc3, pos, depth = 1, typesAfter) {
|
|
16219
17539
|
let $pos = doc3.resolve(pos), base2 = $pos.depth - depth;
|
|
@@ -16237,11 +17557,11 @@ function canSplit(doc3, pos, depth = 1, typesAfter) {
|
|
|
16237
17557
|
return $pos.node(base2).canReplaceWith(index2, index2, baseType ? baseType.type : $pos.node(base2 + 1).type);
|
|
16238
17558
|
}
|
|
16239
17559
|
function split(tr2, pos, depth = 1, typesAfter) {
|
|
16240
|
-
let $pos = tr2.doc.resolve(pos), before =
|
|
17560
|
+
let $pos = tr2.doc.resolve(pos), before = Fragment7.empty, after = Fragment7.empty;
|
|
16241
17561
|
for (let d = $pos.depth, e = $pos.depth - depth, i = depth - 1; d > e; d--, i--) {
|
|
16242
|
-
before =
|
|
17562
|
+
before = Fragment7.from($pos.node(d).copy(before));
|
|
16243
17563
|
let typeAfter = typesAfter && typesAfter[i];
|
|
16244
|
-
after =
|
|
17564
|
+
after = Fragment7.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
|
|
16245
17565
|
}
|
|
16246
17566
|
tr2.step(new ReplaceStep(pos, pos, new Slice(before.append(after), depth, depth), true));
|
|
16247
17567
|
}
|
|
@@ -16380,7 +17700,7 @@ var Fitter = class {
|
|
|
16380
17700
|
this.$to = $to;
|
|
16381
17701
|
this.unplaced = unplaced;
|
|
16382
17702
|
this.frontier = [];
|
|
16383
|
-
this.placed =
|
|
17703
|
+
this.placed = Fragment7.empty;
|
|
16384
17704
|
for (let i = 0; i <= $from.depth; i++) {
|
|
16385
17705
|
let node = $from.node(i);
|
|
16386
17706
|
this.frontier.push({
|
|
@@ -16389,7 +17709,7 @@ var Fitter = class {
|
|
|
16389
17709
|
});
|
|
16390
17710
|
}
|
|
16391
17711
|
for (let i = $from.depth; i > 0; i--)
|
|
16392
|
-
this.placed =
|
|
17712
|
+
this.placed = Fragment7.from($from.node(i).copy(this.placed));
|
|
16393
17713
|
}
|
|
16394
17714
|
get depth() {
|
|
16395
17715
|
return this.frontier.length - 1;
|
|
@@ -16446,7 +17766,7 @@ var Fitter = class {
|
|
|
16446
17766
|
let first2 = fragment.firstChild;
|
|
16447
17767
|
for (let frontierDepth = this.depth; frontierDepth >= 0; frontierDepth--) {
|
|
16448
17768
|
let { type, match } = this.frontier[frontierDepth], wrap2, inject = null;
|
|
16449
|
-
if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(
|
|
17769
|
+
if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(Fragment7.from(first2), false)) : parent && type.compatibleContent(parent.type)))
|
|
16450
17770
|
return { sliceDepth, frontierDepth, parent, inject };
|
|
16451
17771
|
else if (pass == 2 && first2 && (wrap2 = match.findWrapping(first2.type)))
|
|
16452
17772
|
return { sliceDepth, frontierDepth, parent, wrap: wrap2 };
|
|
@@ -16506,7 +17826,7 @@ var Fitter = class {
|
|
|
16506
17826
|
let toEnd = taken == fragment.childCount;
|
|
16507
17827
|
if (!toEnd)
|
|
16508
17828
|
openEndCount = -1;
|
|
16509
|
-
this.placed = addToFragment(this.placed, frontierDepth,
|
|
17829
|
+
this.placed = addToFragment(this.placed, frontierDepth, Fragment7.from(add));
|
|
16510
17830
|
this.frontier[frontierDepth].match = match;
|
|
16511
17831
|
if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1)
|
|
16512
17832
|
this.closeFrontierNode();
|
|
@@ -16563,12 +17883,12 @@ var Fitter = class {
|
|
|
16563
17883
|
openFrontierNode(type, attrs = null, content) {
|
|
16564
17884
|
let top = this.frontier[this.depth];
|
|
16565
17885
|
top.match = top.match.matchType(type);
|
|
16566
|
-
this.placed = addToFragment(this.placed, this.depth,
|
|
17886
|
+
this.placed = addToFragment(this.placed, this.depth, Fragment7.from(type.create(attrs, content)));
|
|
16567
17887
|
this.frontier.push({ type, match: type.contentMatch });
|
|
16568
17888
|
}
|
|
16569
17889
|
closeFrontierNode() {
|
|
16570
17890
|
let open = this.frontier.pop();
|
|
16571
|
-
let add = open.match.fillBefore(
|
|
17891
|
+
let add = open.match.fillBefore(Fragment7.empty, true);
|
|
16572
17892
|
if (add.childCount)
|
|
16573
17893
|
this.placed = addToFragment(this.placed, this.frontier.length, add);
|
|
16574
17894
|
}
|
|
@@ -16597,7 +17917,7 @@ function closeNodeStart(node, openStart, openEnd) {
|
|
|
16597
17917
|
if (openStart > 0) {
|
|
16598
17918
|
frag = node.type.contentMatch.fillBefore(frag).append(frag);
|
|
16599
17919
|
if (openEnd <= 0)
|
|
16600
|
-
frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(
|
|
17920
|
+
frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment7.empty, true));
|
|
16601
17921
|
}
|
|
16602
17922
|
return node.copy(frag);
|
|
16603
17923
|
}
|
|
@@ -16689,7 +18009,7 @@ function closeFragment(fragment, depth, oldOpen, newOpen, parent) {
|
|
|
16689
18009
|
if (depth > newOpen) {
|
|
16690
18010
|
let match = parent.contentMatchAt(0);
|
|
16691
18011
|
let start = match.fillBefore(fragment).append(fragment);
|
|
16692
|
-
fragment = start.append(match.matchFragment(start).fillBefore(
|
|
18012
|
+
fragment = start.append(match.matchFragment(start).fillBefore(Fragment7.empty, true));
|
|
16693
18013
|
}
|
|
16694
18014
|
return fragment;
|
|
16695
18015
|
}
|
|
@@ -16699,7 +18019,7 @@ function replaceRangeWith(tr2, from2, to, node) {
|
|
|
16699
18019
|
if (point != null)
|
|
16700
18020
|
from2 = to = point;
|
|
16701
18021
|
}
|
|
16702
|
-
tr2.replaceRange(from2, to, new Slice(
|
|
18022
|
+
tr2.replaceRange(from2, to, new Slice(Fragment7.from(node), 0, 0));
|
|
16703
18023
|
}
|
|
16704
18024
|
function deleteRange(tr2, from2, to) {
|
|
16705
18025
|
let $from = tr2.doc.resolve(from2), $to = tr2.doc.resolve(to);
|
|
@@ -16747,7 +18067,7 @@ var AttrStep = class extends Step {
|
|
|
16747
18067
|
attrs[name] = node.attrs[name];
|
|
16748
18068
|
attrs[this.attr] = this.value;
|
|
16749
18069
|
let updated = node.type.create(attrs, null, node.marks);
|
|
16750
|
-
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(
|
|
18070
|
+
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment7.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
16751
18071
|
}
|
|
16752
18072
|
getMap() {
|
|
16753
18073
|
return StepMap.empty;
|
|
@@ -16882,7 +18202,7 @@ var Transform = class {
|
|
|
16882
18202
|
fragment, node, or array of nodes.
|
|
16883
18203
|
*/
|
|
16884
18204
|
replaceWith(from2, to, content) {
|
|
16885
|
-
return this.replace(from2, to, new Slice(
|
|
18205
|
+
return this.replace(from2, to, new Slice(Fragment7.from(content), 0, 0));
|
|
16886
18206
|
}
|
|
16887
18207
|
/**
|
|
16888
18208
|
Delete the content between the given positions.
|
|
@@ -17384,7 +18704,7 @@ var NodeSelection = class extends Selection {
|
|
|
17384
18704
|
return new NodeSelection($pos);
|
|
17385
18705
|
}
|
|
17386
18706
|
content() {
|
|
17387
|
-
return new Slice(
|
|
18707
|
+
return new Slice(Fragment7.from(this.node), 0, 0);
|
|
17388
18708
|
}
|
|
17389
18709
|
eq(other) {
|
|
17390
18710
|
return other instanceof NodeSelection && other.anchor == this.anchor;
|
|
@@ -19206,7 +20526,7 @@ var NodeViewDesc = class extends ViewDesc {
|
|
|
19206
20526
|
}
|
|
19207
20527
|
}
|
|
19208
20528
|
if (!rule.contentElement)
|
|
19209
|
-
rule.getContent = () =>
|
|
20529
|
+
rule.getContent = () => Fragment7.empty;
|
|
19210
20530
|
}
|
|
19211
20531
|
return rule;
|
|
19212
20532
|
}
|
|
@@ -20525,7 +21845,7 @@ function parseFromClipboard(view, text, html, plainText, $context) {
|
|
|
20525
21845
|
text = f(text, inCode || plainText, view);
|
|
20526
21846
|
});
|
|
20527
21847
|
if (inCode)
|
|
20528
|
-
return text ? new Slice(
|
|
21848
|
+
return text ? new Slice(Fragment7.from(view.state.schema.text(text.replace(/\r\n?/g, "\n"))), 0, 0) : Slice.empty;
|
|
20529
21849
|
let parsed = view.someProp("clipboardTextParser", (f) => f(text, $context, plainText, view));
|
|
20530
21850
|
if (parsed) {
|
|
20531
21851
|
slice2 = parsed;
|
|
@@ -20614,13 +21934,13 @@ function normalizeSiblings(fragment, $context) {
|
|
|
20614
21934
|
}
|
|
20615
21935
|
});
|
|
20616
21936
|
if (result)
|
|
20617
|
-
return
|
|
21937
|
+
return Fragment7.from(result);
|
|
20618
21938
|
}
|
|
20619
21939
|
return fragment;
|
|
20620
21940
|
}
|
|
20621
21941
|
function withWrappers(node, wrap2, from2 = 0) {
|
|
20622
21942
|
for (let i = wrap2.length - 1; i >= from2; i--)
|
|
20623
|
-
node = wrap2[i].create(null,
|
|
21943
|
+
node = wrap2[i].create(null, Fragment7.from(node));
|
|
20624
21944
|
return node;
|
|
20625
21945
|
}
|
|
20626
21946
|
function addToSibling(wrap2, lastWrap, node, sibling, depth) {
|
|
@@ -20630,14 +21950,14 @@ function addToSibling(wrap2, lastWrap, node, sibling, depth) {
|
|
|
20630
21950
|
return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner));
|
|
20631
21951
|
let match = sibling.contentMatchAt(sibling.childCount);
|
|
20632
21952
|
if (match.matchType(depth == wrap2.length - 1 ? node.type : wrap2[depth + 1]))
|
|
20633
|
-
return sibling.copy(sibling.content.append(
|
|
21953
|
+
return sibling.copy(sibling.content.append(Fragment7.from(withWrappers(node, wrap2, depth + 1))));
|
|
20634
21954
|
}
|
|
20635
21955
|
}
|
|
20636
21956
|
function closeRight(node, depth) {
|
|
20637
21957
|
if (depth == 0)
|
|
20638
21958
|
return node;
|
|
20639
21959
|
let fragment = node.content.replaceChild(node.childCount - 1, closeRight(node.lastChild, depth - 1));
|
|
20640
|
-
let fill = node.contentMatchAt(node.childCount).fillBefore(
|
|
21960
|
+
let fill = node.contentMatchAt(node.childCount).fillBefore(Fragment7.empty, true);
|
|
20641
21961
|
return node.copy(fragment.append(fill));
|
|
20642
21962
|
}
|
|
20643
21963
|
function closeRange(fragment, side, from2, to, depth, openEnd) {
|
|
@@ -20647,7 +21967,7 @@ function closeRange(fragment, side, from2, to, depth, openEnd) {
|
|
|
20647
21967
|
if (depth < to - 1)
|
|
20648
21968
|
inner = closeRange(inner, side, from2, to, depth + 1, openEnd);
|
|
20649
21969
|
if (depth >= from2)
|
|
20650
|
-
inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(
|
|
21970
|
+
inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(Fragment7.empty, true));
|
|
20651
21971
|
return fragment.replaceChild(side < 0 ? 0 : fragment.childCount - 1, node.copy(inner));
|
|
20652
21972
|
}
|
|
20653
21973
|
function closeSlice(slice2, openStart, openEnd) {
|
|
@@ -20717,7 +22037,7 @@ function addContext(slice2, context) {
|
|
|
20717
22037
|
let type = schema.nodes[array[i]];
|
|
20718
22038
|
if (!type || type.hasRequiredAttrs())
|
|
20719
22039
|
break;
|
|
20720
|
-
content =
|
|
22040
|
+
content = Fragment7.from(type.create(array[i + 1], content));
|
|
20721
22041
|
openStart++;
|
|
20722
22042
|
openEnd++;
|
|
20723
22043
|
}
|
|
@@ -22578,7 +23898,7 @@ function isMarkChange(cur, prev) {
|
|
|
22578
23898
|
let updated = [];
|
|
22579
23899
|
for (let i = 0; i < prev.childCount; i++)
|
|
22580
23900
|
updated.push(update(prev.child(i)));
|
|
22581
|
-
if (
|
|
23901
|
+
if (Fragment7.from(updated).eq(cur))
|
|
22582
23902
|
return { mark, type };
|
|
22583
23903
|
}
|
|
22584
23904
|
function looksLikeBackspace(old, start, end, $newStart, $newEnd) {
|
|
@@ -23688,10 +25008,10 @@ function deleteBarrier(state, $cut, dispatch2, dir) {
|
|
|
23688
25008
|
let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);
|
|
23689
25009
|
if (canDelAfter && (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) && match.matchType(conn[0] || after.type).validEnd) {
|
|
23690
25010
|
if (dispatch2) {
|
|
23691
|
-
let end = $cut.pos + after.nodeSize, wrap2 =
|
|
25011
|
+
let end = $cut.pos + after.nodeSize, wrap2 = Fragment7.empty;
|
|
23692
25012
|
for (let i = conn.length - 1; i >= 0; i--)
|
|
23693
|
-
wrap2 =
|
|
23694
|
-
wrap2 =
|
|
25013
|
+
wrap2 = Fragment7.from(conn[i].create(null, wrap2));
|
|
25014
|
+
wrap2 = Fragment7.from(before.copy(wrap2));
|
|
23695
25015
|
let tr2 = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap2, 1, 0), conn.length, true));
|
|
23696
25016
|
let $joinAt = tr2.doc.resolve(end + 2 * conn.length);
|
|
23697
25017
|
if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type && canJoin(tr2.doc, $joinAt.pos))
|
|
@@ -23720,9 +25040,9 @@ function deleteBarrier(state, $cut, dispatch2, dir) {
|
|
|
23720
25040
|
afterDepth++;
|
|
23721
25041
|
if (at.canReplace(at.childCount, at.childCount, afterText.content)) {
|
|
23722
25042
|
if (dispatch2) {
|
|
23723
|
-
let end =
|
|
25043
|
+
let end = Fragment7.empty;
|
|
23724
25044
|
for (let i = wrap2.length - 1; i >= 0; i--)
|
|
23725
|
-
end =
|
|
25045
|
+
end = Fragment7.from(wrap2[i].copy(end));
|
|
23726
25046
|
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));
|
|
23727
25047
|
dispatch2(tr2.scrollIntoView());
|
|
23728
25048
|
}
|
|
@@ -23827,9 +25147,9 @@ function wrapRangeInList(tr2, range, listType, attrs = null) {
|
|
|
23827
25147
|
return true;
|
|
23828
25148
|
}
|
|
23829
25149
|
function doWrapInList(tr2, range, wrappers, joinBefore, listType) {
|
|
23830
|
-
let content =
|
|
25150
|
+
let content = Fragment7.empty;
|
|
23831
25151
|
for (let i = wrappers.length - 1; i >= 0; i--)
|
|
23832
|
-
content =
|
|
25152
|
+
content = Fragment7.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
23833
25153
|
tr2.step(new ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new Slice(content, 0, 0), wrappers.length, true));
|
|
23834
25154
|
let found2 = 0;
|
|
23835
25155
|
for (let i = 0; i < wrappers.length; i++)
|
|
@@ -23863,7 +25183,7 @@ function liftListItem(itemType) {
|
|
|
23863
25183
|
function liftToOuterList(state, dispatch2, itemType, range) {
|
|
23864
25184
|
let tr2 = state.tr, end = range.end, endOfList = range.$to.end(range.depth);
|
|
23865
25185
|
if (end < endOfList) {
|
|
23866
|
-
tr2.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(
|
|
25186
|
+
tr2.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment7.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
|
|
23867
25187
|
range = new NodeRange(tr2.doc.resolve(range.$from.pos), tr2.doc.resolve(endOfList), range.depth);
|
|
23868
25188
|
}
|
|
23869
25189
|
const target = liftTarget(range);
|
|
@@ -23887,10 +25207,10 @@ function liftOutOfList(state, dispatch2, range) {
|
|
|
23887
25207
|
return false;
|
|
23888
25208
|
let atStart = range.startIndex == 0, atEnd = range.endIndex == list.childCount;
|
|
23889
25209
|
let parent = $start.node(-1), indexBefore = $start.index(-1);
|
|
23890
|
-
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ?
|
|
25210
|
+
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment7.empty : Fragment7.from(list))))
|
|
23891
25211
|
return false;
|
|
23892
25212
|
let start = $start.pos, end = start + item.nodeSize;
|
|
23893
|
-
tr2.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ?
|
|
25213
|
+
tr2.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment7.empty : Fragment7.from(list.copy(Fragment7.empty))).append(atEnd ? Fragment7.empty : Fragment7.from(list.copy(Fragment7.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
|
|
23894
25214
|
dispatch2(tr2.scrollIntoView());
|
|
23895
25215
|
return true;
|
|
23896
25216
|
}
|
|
@@ -23908,8 +25228,8 @@ function sinkListItem(itemType) {
|
|
|
23908
25228
|
return false;
|
|
23909
25229
|
if (dispatch2) {
|
|
23910
25230
|
let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
|
|
23911
|
-
let inner =
|
|
23912
|
-
let slice2 = new Slice(
|
|
25231
|
+
let inner = Fragment7.from(nestedBefore ? itemType.create() : null);
|
|
25232
|
+
let slice2 = new Slice(Fragment7.from(itemType.create(null, Fragment7.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
|
|
23913
25233
|
let before = range.start, after = range.end;
|
|
23914
25234
|
dispatch2(state.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice2, 1, true)).scrollIntoView());
|
|
23915
25235
|
}
|
|
@@ -24127,7 +25447,7 @@ function elementFromString(value) {
|
|
|
24127
25447
|
return removeWhitespaces(html);
|
|
24128
25448
|
}
|
|
24129
25449
|
function createNodeFromContent(content, schema, options) {
|
|
24130
|
-
if (content instanceof Node2 || content instanceof
|
|
25450
|
+
if (content instanceof Node2 || content instanceof Fragment7) {
|
|
24131
25451
|
return content;
|
|
24132
25452
|
}
|
|
24133
25453
|
options = {
|
|
@@ -24141,7 +25461,7 @@ function createNodeFromContent(content, schema, options) {
|
|
|
24141
25461
|
try {
|
|
24142
25462
|
const isArrayContent = Array.isArray(content) && content.length > 0;
|
|
24143
25463
|
if (isArrayContent) {
|
|
24144
|
-
return
|
|
25464
|
+
return Fragment7.fromArray(content.map((item) => schema.nodeFromJSON(item)));
|
|
24145
25465
|
}
|
|
24146
25466
|
const node = schema.nodeFromJSON(content);
|
|
24147
25467
|
if (options.errorOnInvalidContent) {
|
|
@@ -25275,7 +26595,7 @@ function inputRulesPlugin(props) {
|
|
|
25275
26595
|
if (typeof text === "string") {
|
|
25276
26596
|
text = text;
|
|
25277
26597
|
} else {
|
|
25278
|
-
text = getHTMLFromFragment(
|
|
26598
|
+
text = getHTMLFromFragment(Fragment7.from(text), state.schema);
|
|
25279
26599
|
}
|
|
25280
26600
|
const { from: from2 } = simulatedInputMeta;
|
|
25281
26601
|
const to = from2 + text.length;
|
|
@@ -25653,7 +26973,7 @@ function pasteRulesPlugin(props) {
|
|
|
25653
26973
|
if (typeof text === "string") {
|
|
25654
26974
|
text = text;
|
|
25655
26975
|
} else {
|
|
25656
|
-
text = getHTMLFromFragment(
|
|
26976
|
+
text = getHTMLFromFragment(Fragment7.from(text), state.schema);
|
|
25657
26977
|
}
|
|
25658
26978
|
const { from: from22 } = simulatedPasteMeta;
|
|
25659
26979
|
const to2 = from22 + text.length;
|
|
@@ -26311,7 +27631,7 @@ var insertContentAt = (position, value, options) => ({ tr: tr2, dispatch: dispat
|
|
|
26311
27631
|
if (isOnlyTextContent) {
|
|
26312
27632
|
if (Array.isArray(value)) {
|
|
26313
27633
|
newContent = value.map((v) => v.text || "").join("");
|
|
26314
|
-
} else if (value instanceof
|
|
27634
|
+
} else if (value instanceof Fragment7) {
|
|
26315
27635
|
let text = "";
|
|
26316
27636
|
value.forEach((node) => {
|
|
26317
27637
|
if (node.text) {
|
|
@@ -26778,10 +28098,10 @@ var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr: tr2, state, dispa
|
|
|
26778
28098
|
return false;
|
|
26779
28099
|
}
|
|
26780
28100
|
if (dispatch2) {
|
|
26781
|
-
let wrap2 =
|
|
28101
|
+
let wrap2 = Fragment7.empty;
|
|
26782
28102
|
const depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
|
|
26783
28103
|
for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d -= 1) {
|
|
26784
|
-
wrap2 =
|
|
28104
|
+
wrap2 = Fragment7.from($from.node(d).copy(wrap2));
|
|
26785
28105
|
}
|
|
26786
28106
|
const depthAfter = (
|
|
26787
28107
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -26792,7 +28112,7 @@ var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr: tr2, state, dispa
|
|
|
26792
28112
|
...overrideAttrs
|
|
26793
28113
|
};
|
|
26794
28114
|
const nextType2 = ((_a = type.contentMatch.defaultType) == null ? void 0 : _a.createAndFill(newNextTypeAttributes2)) || void 0;
|
|
26795
|
-
wrap2 = wrap2.append(
|
|
28115
|
+
wrap2 = wrap2.append(Fragment7.from(type.createAndFill(null, nextType2) || void 0));
|
|
26796
28116
|
const start = $from.before($from.depth - (depthBefore - 1));
|
|
26797
28117
|
tr2.replace(start, $from.after(-depthAfter), new Slice(wrap2, 4 - depthBefore, 0));
|
|
26798
28118
|
let sel = -1;
|
|
@@ -28423,7 +29743,7 @@ function markPasteRule(config) {
|
|
|
28423
29743
|
}
|
|
28424
29744
|
|
|
28425
29745
|
// ../../node_modules/@tiptap/react/dist/index.js
|
|
28426
|
-
var
|
|
29746
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
28427
29747
|
var mergeRefs = (...refs) => {
|
|
28428
29748
|
return (node) => {
|
|
28429
29749
|
refs.forEach((ref) => {
|
|
@@ -28642,7 +29962,7 @@ function useEditorState(options) {
|
|
|
28642
29962
|
editorStateManager.getSnapshot,
|
|
28643
29963
|
editorStateManager.getServerSnapshot,
|
|
28644
29964
|
options.selector,
|
|
28645
|
-
(_a = options.equalityFn) != null ? _a :
|
|
29965
|
+
(_a = options.equalityFn) != null ? _a : import_react19.default
|
|
28646
29966
|
);
|
|
28647
29967
|
useIsomorphicLayoutEffect(() => {
|
|
28648
29968
|
return editorStateManager.watch(options.editor);
|
|
@@ -28921,11 +30241,11 @@ var ReactNodeViewContext = createContext({
|
|
|
28921
30241
|
var useReactNodeView = () => useContext(ReactNodeViewContext);
|
|
28922
30242
|
t__default.forwardRef((props, ref) => {
|
|
28923
30243
|
const { onDragStart } = useReactNodeView();
|
|
28924
|
-
const
|
|
30244
|
+
const Tag4 = props.as || "div";
|
|
28925
30245
|
return (
|
|
28926
30246
|
// @ts-ignore
|
|
28927
30247
|
/* @__PURE__ */ jsx(
|
|
28928
|
-
|
|
30248
|
+
Tag4,
|
|
28929
30249
|
{
|
|
28930
30250
|
...props,
|
|
28931
30251
|
ref,
|
|
@@ -32238,9 +33558,9 @@ function beforeinput(view, event) {
|
|
|
32238
33558
|
let insert = $from.parent.contentMatchAt($from.index()).findWrapping(view.state.schema.nodes.text);
|
|
32239
33559
|
if (!insert)
|
|
32240
33560
|
return false;
|
|
32241
|
-
let frag =
|
|
33561
|
+
let frag = Fragment7.empty;
|
|
32242
33562
|
for (let i = insert.length - 1; i >= 0; i--)
|
|
32243
|
-
frag =
|
|
33563
|
+
frag = Fragment7.from(insert[i].createAndFill(null, frag));
|
|
32244
33564
|
let tr2 = view.state.tr.replace($from.pos, $from.pos, new Slice(frag, 0, 0));
|
|
32245
33565
|
tr2.setSelection(TextSelection.near(tr2.doc.resolve($from.pos + 1)));
|
|
32246
33566
|
view.dispatch(tr2);
|
|
@@ -33365,7 +34685,7 @@ var index_default7 = Highlight;
|
|
|
33365
34685
|
|
|
33366
34686
|
// ../../node_modules/@tiptap/extension-image/dist/index.js
|
|
33367
34687
|
var inputRegex6 = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;
|
|
33368
|
-
var
|
|
34688
|
+
var Image5 = Node3.create({
|
|
33369
34689
|
name: "image",
|
|
33370
34690
|
addOptions() {
|
|
33371
34691
|
return {
|
|
@@ -33433,7 +34753,7 @@ var Image4 = Node3.create({
|
|
|
33433
34753
|
];
|
|
33434
34754
|
}
|
|
33435
34755
|
});
|
|
33436
|
-
var index_default8 =
|
|
34756
|
+
var index_default8 = Image5;
|
|
33437
34757
|
|
|
33438
34758
|
// ../../node_modules/prosemirror-tables/dist/index.js
|
|
33439
34759
|
var readFromCache;
|
|
@@ -33920,10 +35240,10 @@ var CellSelection = class _CellSelection extends Selection {
|
|
|
33920
35240
|
}
|
|
33921
35241
|
rowContent.push(cell);
|
|
33922
35242
|
}
|
|
33923
|
-
rows.push(table.child(row).copy(
|
|
35243
|
+
rows.push(table.child(row).copy(Fragment7.from(rowContent)));
|
|
33924
35244
|
}
|
|
33925
35245
|
const fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
|
|
33926
|
-
return new Slice(
|
|
35246
|
+
return new Slice(Fragment7.from(fragment), 1, 1);
|
|
33927
35247
|
}
|
|
33928
35248
|
replace(tr2, content = Slice.empty) {
|
|
33929
35249
|
const mapFrom = tr2.steps.length, ranges = this.ranges;
|
|
@@ -33943,7 +35263,7 @@ var CellSelection = class _CellSelection extends Selection {
|
|
|
33943
35263
|
tr2.setSelection(sel);
|
|
33944
35264
|
}
|
|
33945
35265
|
replaceWith(tr2, node) {
|
|
33946
|
-
this.replace(tr2, new Slice(
|
|
35266
|
+
this.replace(tr2, new Slice(Fragment7.from(node), 0, 0));
|
|
33947
35267
|
}
|
|
33948
35268
|
forEachCell(f) {
|
|
33949
35269
|
const table = this.$anchorCell.node(-1);
|
|
@@ -34491,7 +35811,7 @@ function mergeCells(state, dispatch2) {
|
|
|
34491
35811
|
if (dispatch2) {
|
|
34492
35812
|
const tr2 = state.tr;
|
|
34493
35813
|
const seen = {};
|
|
34494
|
-
let content =
|
|
35814
|
+
let content = Fragment7.empty;
|
|
34495
35815
|
let mergedPos;
|
|
34496
35816
|
let mergedCell;
|
|
34497
35817
|
for (let row = rect.top; row < rect.bottom; row++) {
|
|
@@ -34872,14 +36192,14 @@ function ensureRectangular(schema, rows) {
|
|
|
34872
36192
|
width = Math.max(width, widths[r2]);
|
|
34873
36193
|
for (let r2 = 0; r2 < widths.length; r2++) {
|
|
34874
36194
|
if (r2 >= rows.length)
|
|
34875
|
-
rows.push(
|
|
36195
|
+
rows.push(Fragment7.empty);
|
|
34876
36196
|
if (widths[r2] < width) {
|
|
34877
36197
|
const empty2 = tableNodeTypes(schema).cell.createAndFill();
|
|
34878
36198
|
const cells = [];
|
|
34879
36199
|
for (let i = widths[r2]; i < width; i++) {
|
|
34880
36200
|
cells.push(empty2);
|
|
34881
36201
|
}
|
|
34882
|
-
rows[r2] = rows[r2].append(
|
|
36202
|
+
rows[r2] = rows[r2].append(Fragment7.from(cells));
|
|
34883
36203
|
}
|
|
34884
36204
|
}
|
|
34885
36205
|
return { height: rows.length, width, rows };
|
|
@@ -34911,7 +36231,7 @@ function clipCells({ width, height, rows }, newWidth, newHeight) {
|
|
|
34911
36231
|
for (let j = 1; j < cell.attrs.rowspan; j++)
|
|
34912
36232
|
added[row + j] = (added[row + j] || 0) + cell.attrs.colspan;
|
|
34913
36233
|
}
|
|
34914
|
-
newRows.push(
|
|
36234
|
+
newRows.push(Fragment7.from(cells));
|
|
34915
36235
|
}
|
|
34916
36236
|
rows = newRows;
|
|
34917
36237
|
width = newWidth;
|
|
@@ -34932,7 +36252,7 @@ function clipCells({ width, height, rows }, newWidth, newHeight) {
|
|
|
34932
36252
|
);
|
|
34933
36253
|
cells.push(cell);
|
|
34934
36254
|
}
|
|
34935
|
-
newRows.push(
|
|
36255
|
+
newRows.push(Fragment7.from(cells));
|
|
34936
36256
|
}
|
|
34937
36257
|
rows = newRows;
|
|
34938
36258
|
height = newHeight;
|
|
@@ -34967,7 +36287,7 @@ function growTable(tr2, map2, table, start, width, height, mapFrom) {
|
|
|
34967
36287
|
header ? emptyHead || (emptyHead = types.header_cell.createAndFill()) : empty2 || (empty2 = types.cell.createAndFill())
|
|
34968
36288
|
);
|
|
34969
36289
|
}
|
|
34970
|
-
const emptyRow = types.row.create(null,
|
|
36290
|
+
const emptyRow = types.row.create(null, Fragment7.from(cells)), rows = [];
|
|
34971
36291
|
for (let i = map2.height; i < height; i++)
|
|
34972
36292
|
rows.push(emptyRow);
|
|
34973
36293
|
tr2.insert(tr2.mapping.slice(mapFrom).map(start + table.nodeSize - 2), rows);
|
|
@@ -35176,7 +36496,7 @@ function handlePaste(view, _, slice2) {
|
|
|
35176
36496
|
width: 1,
|
|
35177
36497
|
height: 1,
|
|
35178
36498
|
rows: [
|
|
35179
|
-
|
|
36499
|
+
Fragment7.from(
|
|
35180
36500
|
fitSlice(tableNodeTypes(view.state.schema).cell, slice2)
|
|
35181
36501
|
)
|
|
35182
36502
|
]
|
|
@@ -53370,7 +54690,7 @@ function Timeline({
|
|
|
53370
54690
|
return formatDate2(date);
|
|
53371
54691
|
}
|
|
53372
54692
|
};
|
|
53373
|
-
const
|
|
54693
|
+
const getInitials4 = (name) => {
|
|
53374
54694
|
return name.split(" ").map((n) => n[0]).join("").toUpperCase();
|
|
53375
54695
|
};
|
|
53376
54696
|
const groupEventsByDate = (events2) => {
|
|
@@ -53430,7 +54750,7 @@ function Timeline({
|
|
|
53430
54750
|
showUserInfo && event.user && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
53431
54751
|
/* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-6 w-6", children: [
|
|
53432
54752
|
/* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: event.user.avatar }),
|
|
53433
|
-
/* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children:
|
|
54753
|
+
/* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials4(event.user.name) })
|
|
53434
54754
|
] }),
|
|
53435
54755
|
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: event.user.name })
|
|
53436
54756
|
] }),
|
|
@@ -53736,9 +55056,9 @@ function AdvancedChart({
|
|
|
53736
55056
|
toggleSeriesVisibility(entry.dataKey);
|
|
53737
55057
|
}
|
|
53738
55058
|
};
|
|
53739
|
-
const handleExport = (
|
|
55059
|
+
const handleExport = (format5) => {
|
|
53740
55060
|
if (onExport) {
|
|
53741
|
-
onExport(
|
|
55061
|
+
onExport(format5);
|
|
53742
55062
|
}
|
|
53743
55063
|
};
|
|
53744
55064
|
const handleZoom = (direction) => {
|
|
@@ -57934,7 +59254,7 @@ var OptimizedImageInternal = ({
|
|
|
57934
59254
|
width,
|
|
57935
59255
|
height,
|
|
57936
59256
|
quality = 75,
|
|
57937
|
-
format:
|
|
59257
|
+
format: format5 = "auto",
|
|
57938
59258
|
lazy = true,
|
|
57939
59259
|
blur: blur2 = true,
|
|
57940
59260
|
priority = false,
|
|
@@ -57973,7 +59293,7 @@ var OptimizedImageInternal = ({
|
|
|
57973
59293
|
params.set("f", options.format);
|
|
57974
59294
|
return optimizedUrl;
|
|
57975
59295
|
};
|
|
57976
|
-
const optimizedSrc = getOptimizedSrc(src, { width, height, quality, format:
|
|
59296
|
+
const optimizedSrc = getOptimizedSrc(src, { width, height, quality, format: format5 });
|
|
57977
59297
|
const handleImageLoad = () => {
|
|
57978
59298
|
setIsLoaded(true);
|
|
57979
59299
|
setIsLoading(false);
|
|
@@ -58137,7 +59457,7 @@ var OptimizedImageInternal = ({
|
|
|
58137
59457
|
] }),
|
|
58138
59458
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
58139
59459
|
"Format: ",
|
|
58140
|
-
|
|
59460
|
+
format5
|
|
58141
59461
|
] })
|
|
58142
59462
|
]
|
|
58143
59463
|
}
|
|
@@ -59282,7 +60602,7 @@ ${options.description}` : options.title;
|
|
|
59282
60602
|
}
|
|
59283
60603
|
}
|
|
59284
60604
|
}
|
|
59285
|
-
var
|
|
60605
|
+
var useToast2 = () => {
|
|
59286
60606
|
return { toast: toast2 };
|
|
59287
60607
|
};
|
|
59288
60608
|
var fileUploadVariants = cva(
|
|
@@ -59306,7 +60626,7 @@ var fileUploadVariants = cva(
|
|
|
59306
60626
|
}
|
|
59307
60627
|
}
|
|
59308
60628
|
);
|
|
59309
|
-
var
|
|
60629
|
+
var formatFileSize2 = (bytes) => {
|
|
59310
60630
|
if (bytes === 0)
|
|
59311
60631
|
return "0 B";
|
|
59312
60632
|
const k3 = 1024;
|
|
@@ -59471,7 +60791,7 @@ var FilePreviewModal = ({
|
|
|
59471
60791
|
/* @__PURE__ */ jsx(MoonUIDialogHeaderPro, { children: /* @__PURE__ */ jsxs(MoonUIDialogTitlePro, { className: "flex items-center gap-2", children: [
|
|
59472
60792
|
getFileIcon(file.file.type),
|
|
59473
60793
|
file.file.name,
|
|
59474
|
-
/* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", children:
|
|
60794
|
+
/* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", children: formatFileSize2(file.file.size) })
|
|
59475
60795
|
] }) }),
|
|
59476
60796
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center p-4 bg-muted/20 rounded-lg", children: [
|
|
59477
60797
|
file.preview.type === "image" && /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
@@ -59579,7 +60899,7 @@ var MoonUIFileUploadPro = t__default.forwardRef(
|
|
|
59579
60899
|
}
|
|
59580
60900
|
const validateFile = useCallback(async (file) => {
|
|
59581
60901
|
if (file.size > maxSize) {
|
|
59582
|
-
return `File size exceeds ${
|
|
60902
|
+
return `File size exceeds ${formatFileSize2(maxSize)} limit`;
|
|
59583
60903
|
}
|
|
59584
60904
|
if (allowedMimeTypes.length > 0 && !allowedMimeTypes.includes(file.type)) {
|
|
59585
60905
|
return `File type ${file.type} is not supported`;
|
|
@@ -59932,7 +61252,7 @@ var MoonUIFileUploadPro = t__default.forwardRef(
|
|
|
59932
61252
|
const currentSize = files.reduce((sum, f) => sum + f.file.size, 0);
|
|
59933
61253
|
const newSize = fileArray.reduce((sum, f) => sum + f.size, 0);
|
|
59934
61254
|
if (currentSize + newSize > maxTotalSize) {
|
|
59935
|
-
setError(`Total file size exceeds ${
|
|
61255
|
+
setError(`Total file size exceeds ${formatFileSize2(maxTotalSize)} limit`);
|
|
59936
61256
|
return;
|
|
59937
61257
|
}
|
|
59938
61258
|
}
|
|
@@ -60145,7 +61465,7 @@ var MoonUIFileUploadPro = t__default.forwardRef(
|
|
|
60145
61465
|
] }),
|
|
60146
61466
|
/* @__PURE__ */ jsx("span", { children: "\u2022" }),
|
|
60147
61467
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
60148
|
-
|
|
61468
|
+
formatFileSize2(maxSize),
|
|
60149
61469
|
" per file"
|
|
60150
61470
|
] }),
|
|
60151
61471
|
resumable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -60258,7 +61578,7 @@ var FileUploadItem = ({
|
|
|
60258
61578
|
onPauseResume,
|
|
60259
61579
|
onPreview
|
|
60260
61580
|
}) => {
|
|
60261
|
-
const { toast: toast3 } =
|
|
61581
|
+
const { toast: toast3 } = useToast2();
|
|
60262
61582
|
const canPauseResume = resumable && ["uploading", "paused"].includes(file.status);
|
|
60263
61583
|
const canPreview = showPreview && file.preview && ["image", "video", "audio"].includes(file.preview.type);
|
|
60264
61584
|
return /* @__PURE__ */ jsxs(
|
|
@@ -60344,7 +61664,7 @@ var FileUploadItem = ({
|
|
|
60344
61664
|
variant === "compact" ? "text-xs" : "text-sm",
|
|
60345
61665
|
variant === "grid" && "justify-center"
|
|
60346
61666
|
), children: [
|
|
60347
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
61667
|
+
/* @__PURE__ */ jsx("span", { children: formatFileSize2(file.file.size) }),
|
|
60348
61668
|
file.preview?.dimensions && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60349
61669
|
/* @__PURE__ */ jsx("span", { children: "\u2022" }),
|
|
60350
61670
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
@@ -60385,7 +61705,7 @@ var FileUploadItem = ({
|
|
|
60385
61705
|
"%"
|
|
60386
61706
|
] }),
|
|
60387
61707
|
file.speed && /* @__PURE__ */ jsxs("span", { children: [
|
|
60388
|
-
|
|
61708
|
+
formatFileSize2(file.speed),
|
|
60389
61709
|
"/s"
|
|
60390
61710
|
] }),
|
|
60391
61711
|
file.estimatedTime && file.estimatedTime > 0 && /* @__PURE__ */ jsxs("span", { children: [
|
|
@@ -61017,11 +62337,11 @@ function downloadFile(content, filename, mimeType) {
|
|
|
61017
62337
|
URL.revokeObjectURL(url);
|
|
61018
62338
|
}
|
|
61019
62339
|
async function exportData(data, options) {
|
|
61020
|
-
const { format:
|
|
62340
|
+
const { format: format5, filename = "data-export", columns, includeHeaders = true } = options;
|
|
61021
62341
|
let content;
|
|
61022
62342
|
let mimeType;
|
|
61023
62343
|
let extension;
|
|
61024
|
-
switch (
|
|
62344
|
+
switch (format5) {
|
|
61025
62345
|
case "csv":
|
|
61026
62346
|
content = dataToCSV(data, columns, includeHeaders);
|
|
61027
62347
|
mimeType = "text/csv;charset=utf-8;";
|
|
@@ -61035,7 +62355,7 @@ async function exportData(data, options) {
|
|
|
61035
62355
|
case "xlsx":
|
|
61036
62356
|
throw new Error("XLSX export requires additional dependencies. Use CSV format instead.");
|
|
61037
62357
|
default:
|
|
61038
|
-
throw new Error(`Unsupported export format: ${
|
|
62358
|
+
throw new Error(`Unsupported export format: ${format5}`);
|
|
61039
62359
|
}
|
|
61040
62360
|
const finalFilename = `${filename}-${( new Date()).toISOString().split("T")[0]}.${extension}`;
|
|
61041
62361
|
downloadFile(content, finalFilename, mimeType);
|
|
@@ -61518,11 +62838,11 @@ function DataTable({
|
|
|
61518
62838
|
rowSelection: features.rowSelection !== false || selectable,
|
|
61519
62839
|
export: features.export !== false || exportable
|
|
61520
62840
|
});
|
|
61521
|
-
const handleExport = async (
|
|
62841
|
+
const handleExport = async (format5) => {
|
|
61522
62842
|
const selectedRows = table.getFilteredSelectedRowModel().rows;
|
|
61523
62843
|
const dataToExport = selectedRows.length > 0 ? selectedRows.map((row) => row.original) : table.getFilteredRowModel().rows.map((row) => row.original);
|
|
61524
62844
|
if (typeof exportable === "object" && exportable.onExport) {
|
|
61525
|
-
exportable.onExport(dataToExport,
|
|
62845
|
+
exportable.onExport(dataToExport, format5);
|
|
61526
62846
|
return;
|
|
61527
62847
|
}
|
|
61528
62848
|
if (onExport) {
|
|
@@ -61532,7 +62852,7 @@ function DataTable({
|
|
|
61532
62852
|
const filename = typeof exportable === "object" && exportable.filename ? exportable.filename : "data-export";
|
|
61533
62853
|
const visibleColumns = getVisibleColumns(columns, columnVisibility);
|
|
61534
62854
|
await exportData(dataToExport, {
|
|
61535
|
-
format:
|
|
62855
|
+
format: format5,
|
|
61536
62856
|
filename,
|
|
61537
62857
|
columns: visibleColumns,
|
|
61538
62858
|
includeHeaders: true
|
|
@@ -63464,18 +64784,18 @@ var countries = [
|
|
|
63464
64784
|
{ code: "NO", name: "Norway", dialCode: "+47", flag: "\u{1F1F3}\u{1F1F4}", format: "xxx xx xxx" },
|
|
63465
64785
|
{ code: "FI", name: "Finland", dialCode: "+358", flag: "\u{1F1EB}\u{1F1EE}", format: "xx xxxxxxx" }
|
|
63466
64786
|
];
|
|
63467
|
-
function formatPhoneNumber(number,
|
|
63468
|
-
if (!number || !
|
|
64787
|
+
function formatPhoneNumber(number, format5) {
|
|
64788
|
+
if (!number || !format5)
|
|
63469
64789
|
return "";
|
|
63470
64790
|
const cleaned = number.replace(/\D/g, "");
|
|
63471
64791
|
let formatted = "";
|
|
63472
64792
|
let digitIndex = 0;
|
|
63473
|
-
for (let i = 0; i <
|
|
63474
|
-
if (
|
|
64793
|
+
for (let i = 0; i < format5.length && digitIndex < cleaned.length; i++) {
|
|
64794
|
+
if (format5[i] === "x") {
|
|
63475
64795
|
formatted += cleaned[digitIndex];
|
|
63476
64796
|
digitIndex++;
|
|
63477
64797
|
} else {
|
|
63478
|
-
formatted +=
|
|
64798
|
+
formatted += format5[i];
|
|
63479
64799
|
}
|
|
63480
64800
|
}
|
|
63481
64801
|
return formatted;
|