sa2kit 1.6.9 → 1.6.11
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/ConfigService-BxK06xP6.d.mts +262 -0
- package/dist/ConfigService-BxK06xP6.d.ts +262 -0
- package/dist/UniversalFileService-BuHN-jrR.d.ts +515 -0
- package/dist/UniversalFileService-CGGzYeeF.d.mts +515 -0
- package/dist/analytics/index.d.mts +1084 -0
- package/dist/analytics/index.d.ts +1084 -0
- package/dist/analytics/server/index.d.mts +499 -0
- package/dist/analytics/server/index.d.ts +499 -0
- package/dist/api/index.d.mts +248 -0
- package/dist/api/index.d.ts +248 -0
- package/dist/audioDetection/index.d.mts +449 -0
- package/dist/audioDetection/index.d.ts +449 -0
- package/dist/auth/client/index.d.mts +32 -0
- package/dist/auth/client/index.d.ts +32 -0
- package/dist/auth/client/index.js +4 -4
- package/dist/auth/client/index.mjs +1 -1
- package/dist/auth/components/index.d.mts +227 -0
- package/dist/auth/components/index.d.ts +227 -0
- package/dist/auth/components/index.js +4 -4
- package/dist/auth/components/index.mjs +1 -1
- package/dist/auth/hooks/index.d.mts +31 -0
- package/dist/auth/hooks/index.d.ts +31 -0
- package/dist/auth/hooks/index.js +3 -3
- package/dist/auth/hooks/index.mjs +1 -1
- package/dist/auth/index.d.mts +41 -0
- package/dist/auth/index.d.ts +41 -0
- package/dist/auth/index.js +17 -36
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/index.mjs +3 -33
- package/dist/auth/index.mjs.map +1 -1
- package/dist/auth/middleware/index.d.mts +75 -0
- package/dist/auth/middleware/index.d.ts +75 -0
- package/dist/auth/routes/index.d.mts +261 -0
- package/dist/auth/routes/index.d.ts +261 -0
- package/dist/auth/schema/index.d.mts +789 -0
- package/dist/auth/schema/index.d.ts +789 -0
- package/dist/auth/services/index.d.mts +48 -0
- package/dist/auth/services/index.d.ts +48 -0
- package/dist/base-api-client-B-yUCal3.d.ts +103 -0
- package/dist/base-api-client-BQ8ZPZjk.d.mts +103 -0
- package/dist/calendar/index.d.mts +1197 -0
- package/dist/calendar/index.d.ts +1197 -0
- package/dist/calendar/index.js +8 -8
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs +1 -1
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/calendar/routes/index.d.mts +118 -0
- package/dist/calendar/routes/index.d.ts +118 -0
- package/dist/calendar/server.d.mts +1184 -0
- package/dist/calendar/server.d.ts +1184 -0
- package/dist/{chunk-ROEYW4A7.js → chunk-5QMBZP7S.js} +2 -2
- package/dist/chunk-5QMBZP7S.js.map +1 -0
- package/dist/chunk-6BZ3QFA5.mjs +33 -0
- package/dist/chunk-6BZ3QFA5.mjs.map +1 -0
- package/dist/{chunk-HEMA7SWK.mjs → chunk-6YKMCPQI.mjs} +2 -2
- package/dist/chunk-6YKMCPQI.mjs.map +1 -0
- package/dist/chunk-BH5TLVS5.mjs +1593 -0
- package/dist/chunk-BH5TLVS5.mjs.map +1 -0
- package/dist/chunk-E72D5KHY.js +1723 -0
- package/dist/chunk-E72D5KHY.js.map +1 -0
- package/dist/chunk-FAHLZIYQ.js +36 -0
- package/dist/chunk-FAHLZIYQ.js.map +1 -0
- package/dist/{chunk-KGRQNEIR.mjs → chunk-KW5JH6V6.mjs} +2 -2
- package/dist/chunk-KW5JH6V6.mjs.map +1 -0
- package/dist/{chunk-O26VCNS3.js → chunk-UOFTHYIH.js} +2 -2
- package/dist/chunk-UOFTHYIH.js.map +1 -0
- package/dist/config/index.d.mts +64 -0
- package/dist/config/index.d.ts +64 -0
- package/dist/config/server/index.d.mts +1533 -0
- package/dist/config/server/index.d.ts +1533 -0
- package/dist/drizzle-auth-service-Bxlovhv8.d.ts +145 -0
- package/dist/drizzle-auth-service-DZY2F1sv.d.mts +145 -0
- package/dist/drizzle-schema-BNhqj2AZ.d.mts +1114 -0
- package/dist/drizzle-schema-BNhqj2AZ.d.ts +1114 -0
- package/dist/enums-Dume-V5Y.d.mts +16 -0
- package/dist/enums-Dume-V5Y.d.ts +16 -0
- package/dist/i18n/index.d.mts +417 -0
- package/dist/i18n/index.d.ts +417 -0
- package/dist/imageCrop/index.d.mts +165 -0
- package/dist/imageCrop/index.d.ts +165 -0
- package/dist/index-DSel44Ke.d.mts +93 -0
- package/dist/index-DSel44Ke.d.ts +93 -0
- package/dist/index.d.mts +933 -0
- package/dist/index.d.ts +933 -0
- package/dist/index.js +1626 -2184
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +708 -1543
- package/dist/index.mjs.map +1 -1
- package/dist/logger/index.d.mts +125 -0
- package/dist/logger/index.d.ts +125 -0
- package/dist/mmd/admin/index.d.mts +487 -0
- package/dist/mmd/admin/index.d.ts +487 -0
- package/dist/mmd/index.d.mts +1412 -0
- package/dist/mmd/index.d.ts +1412 -0
- package/dist/mmd/index.js +2695 -625
- package/dist/mmd/index.js.map +1 -1
- package/dist/mmd/index.mjs +2501 -448
- package/dist/mmd/index.mjs.map +1 -1
- package/dist/mmd/server/index.d.mts +138 -0
- package/dist/mmd/server/index.d.ts +138 -0
- package/dist/music/index.d.mts +74 -0
- package/dist/music/index.d.ts +74 -0
- package/dist/music/server/index.d.mts +1 -0
- package/dist/music/server/index.d.ts +1 -0
- package/dist/request/index.d.mts +51 -0
- package/dist/request/index.d.ts +51 -0
- package/dist/storage/index.d.mts +75 -0
- package/dist/storage/index.d.ts +75 -0
- package/dist/testYourself/admin/index.d.mts +58 -0
- package/dist/testYourself/admin/index.d.ts +58 -0
- package/dist/testYourself/index.d.mts +53 -0
- package/dist/testYourself/index.d.ts +53 -0
- package/dist/testYourself/server/index.d.mts +1029 -0
- package/dist/testYourself/server/index.d.ts +1029 -0
- package/dist/types-BB-7_WtE.d.mts +253 -0
- package/dist/types-BB-7_WtE.d.ts +253 -0
- package/dist/types-BINlP9MK.d.mts +286 -0
- package/dist/types-BINlP9MK.d.ts +286 -0
- package/dist/types-BaZccpvk.d.mts +48 -0
- package/dist/types-BaZccpvk.d.ts +48 -0
- package/dist/types-CK4We_aI.d.mts +270 -0
- package/dist/types-CK4We_aI.d.ts +270 -0
- package/dist/types-CbTsi9CZ.d.mts +31 -0
- package/dist/types-CbTsi9CZ.d.ts +31 -0
- package/dist/types-CiYK5Klf.d.mts +99 -0
- package/dist/types-D3R6GzOw.d.mts +70 -0
- package/dist/types-Dlu52uDy.d.ts +99 -0
- package/dist/types-iFeyR443.d.ts +70 -0
- package/dist/universalExport/index.d.mts +235 -0
- package/dist/universalExport/index.d.ts +235 -0
- package/dist/universalExport/server/index.d.mts +1270 -0
- package/dist/universalExport/server/index.d.ts +1270 -0
- package/dist/universalFile/index.d.mts +480 -0
- package/dist/universalFile/index.d.ts +480 -0
- package/dist/universalFile/server/index.d.mts +4516 -0
- package/dist/universalFile/server/index.d.ts +4516 -0
- package/dist/useElectronStorage-Dj0rcorG.d.mts +65 -0
- package/dist/useElectronStorage-DwnNfIhl.d.ts +65 -0
- package/dist/utils/index.d.mts +192 -0
- package/dist/utils/index.d.ts +192 -0
- package/package.json +2 -1
- package/dist/chunk-4FOBBWXW.mjs +0 -179
- package/dist/chunk-4FOBBWXW.mjs.map +0 -1
- package/dist/chunk-G6WRJ2H2.js +0 -187
- package/dist/chunk-G6WRJ2H2.js.map +0 -1
- package/dist/chunk-HEMA7SWK.mjs.map +0 -1
- package/dist/chunk-KGRQNEIR.mjs.map +0 -1
- package/dist/chunk-O26VCNS3.js.map +0 -1
- package/dist/chunk-ROEYW4A7.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
import { Dialog, DialogContent, Avatar, AvatarImage, AvatarFallback, Button, Timeline, CollisionBalls, FilterButtonGroup, BackButton, Grid, Badge } from './chunk-BH5TLVS5.mjs';
|
|
2
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, BackButton, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CollisionBalls, ConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FilterButtonGroup, GenericOrderManager, Grid, Input, Label, Modal, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, ScrollArea, ScrollBar, SearchBox, SearchResultHint, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Timeline, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants } from './chunk-BH5TLVS5.mjs';
|
|
3
|
+
import './chunk-6BZ3QFA5.mjs';
|
|
4
|
+
import './chunk-QAT2RWAO.mjs';
|
|
5
|
+
import './chunk-ESRCX5TQ.mjs';
|
|
6
|
+
import './chunk-6YKMCPQI.mjs';
|
|
7
|
+
import { useAuth } from './chunk-KW5JH6V6.mjs';
|
|
8
|
+
import './chunk-OCR5DS4C.mjs';
|
|
9
|
+
import './chunk-AIKEVVDR.mjs';
|
|
2
10
|
import { cn } from './chunk-3BGPZN4X.mjs';
|
|
3
11
|
export { arrayUtils, cn, debugUtils, errorUtils, fileUtils, formatTime, japaneseUtils, stringUtils, validators } from './chunk-3BGPZN4X.mjs';
|
|
4
12
|
export { useAsyncStorage, useElectronStorage, useLocalStorage, useStorage, useTaroStorage } from './chunk-T5OZHYVM.mjs';
|
|
5
13
|
import './chunk-OLHGZXN3.mjs';
|
|
6
14
|
export { ConsoleLoggerAdapter, LogLevel, Logger, createLogger, logger } from './chunk-KQGP6BTS.mjs';
|
|
7
15
|
import './chunk-BJTO5JO5.mjs';
|
|
8
|
-
import
|
|
9
|
-
import React37__default, { useState, useRef, useCallback, useEffect } from 'react';
|
|
16
|
+
import React12, { useState, useRef, useCallback, useEffect } from 'react';
|
|
10
17
|
import { createWorker } from 'tesseract.js';
|
|
11
|
-
import {
|
|
12
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
13
|
-
import { cva } from 'class-variance-authority';
|
|
14
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
15
|
-
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
16
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
17
|
-
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
18
|
-
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
19
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
20
|
-
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
21
|
-
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
22
|
-
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
23
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
24
|
-
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
25
|
-
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
26
|
-
import { useRouter } from 'next/navigation';
|
|
18
|
+
import { Upload, X, Loader2, FileText, Eraser, Download, MessageSquare, Send, Bot, User, Shield, AlertTriangle, FlaskConical, LogOut, Meh, Frown, Smile } from 'lucide-react';
|
|
27
19
|
import Link from 'next/link';
|
|
28
20
|
import { createPortal } from 'react-dom';
|
|
21
|
+
import { useSensors, useSensor, PointerSensor, TouchSensor, KeyboardSensor, DndContext, closestCenter } from '@dnd-kit/core';
|
|
22
|
+
import { useSortable, sortableKeyboardCoordinates, SortableContext, rectSortingStrategy, arrayMove } from '@dnd-kit/sortable';
|
|
23
|
+
import { CSS } from '@dnd-kit/utilities';
|
|
29
24
|
|
|
30
25
|
var useOCR = (options = {}) => {
|
|
31
26
|
const [state, setState] = useState({
|
|
@@ -154,43 +149,43 @@ var OCRScanner = ({
|
|
|
154
149
|
handleFileChange(mockEvent);
|
|
155
150
|
}
|
|
156
151
|
};
|
|
157
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ React12.createElement(
|
|
158
153
|
"div",
|
|
159
154
|
{
|
|
160
155
|
className: `p-6 border-2 border-dashed rounded-xl transition-all ${isProcessing ? "border-blue-400 bg-blue-50/10" : "border-gray-200 hover:border-blue-400"} ${className}`,
|
|
161
156
|
onDragOver: handleDragOver,
|
|
162
157
|
onDrop: handleDrop
|
|
163
158
|
},
|
|
164
|
-
!imagePreview ? /* @__PURE__ */
|
|
159
|
+
!imagePreview ? /* @__PURE__ */ React12.createElement(
|
|
165
160
|
"div",
|
|
166
161
|
{
|
|
167
162
|
className: "flex flex-col items-center justify-center cursor-pointer space-y-4",
|
|
168
163
|
onClick: () => fileInputRef.current?.click()
|
|
169
164
|
},
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
) : /* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ React12.createElement("div", { className: "p-4 bg-blue-50 rounded-full text-blue-500" }, /* @__PURE__ */ React12.createElement(Upload, { size: 32 })),
|
|
166
|
+
/* @__PURE__ */ React12.createElement("div", { className: "text-center" }, /* @__PURE__ */ React12.createElement("p", { className: "text-lg font-medium text-gray-700" }, "\u70B9\u51FB\u6216\u62D6\u62FD\u56FE\u7247\u8FDB\u884C OCR \u8BC6\u522B"), /* @__PURE__ */ React12.createElement("p", { className: "text-sm text-gray-500" }, "\u652F\u6301 JPG, PNG, WebP"))
|
|
167
|
+
) : /* @__PURE__ */ React12.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React12.createElement("div", { className: "relative group rounded-lg overflow-hidden border border-gray-200" }, /* @__PURE__ */ React12.createElement(
|
|
173
168
|
"img",
|
|
174
169
|
{
|
|
175
170
|
src: imagePreview,
|
|
176
171
|
alt: "Preview",
|
|
177
172
|
className: `max-h-64 mx-auto object-contain transition-opacity ${isProcessing ? "opacity-50" : "opacity-100"}`
|
|
178
173
|
}
|
|
179
|
-
), !isProcessing && /* @__PURE__ */
|
|
174
|
+
), !isProcessing && /* @__PURE__ */ React12.createElement(
|
|
180
175
|
"button",
|
|
181
176
|
{
|
|
182
177
|
onClick: reset,
|
|
183
178
|
className: "absolute top-2 right-2 p-1 bg-white/80 rounded-full hover:bg-white text-gray-600 shadow-sm"
|
|
184
179
|
},
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
), isProcessing && /* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ React12.createElement(X, { size: 18 })
|
|
181
|
+
), isProcessing && /* @__PURE__ */ React12.createElement("div", { className: "absolute inset-0 flex flex-col items-center justify-center bg-black/5" }, /* @__PURE__ */ React12.createElement(Loader2, { className: "animate-spin text-blue-500 mb-2", size: 32 }), /* @__PURE__ */ React12.createElement("div", { className: "w-48 bg-gray-200 rounded-full h-1.5 overflow-hidden" }, /* @__PURE__ */ React12.createElement(
|
|
187
182
|
"div",
|
|
188
183
|
{
|
|
189
184
|
className: "bg-blue-500 h-full transition-all duration-300",
|
|
190
185
|
style: { width: `${progress * 100}%` }
|
|
191
186
|
}
|
|
192
|
-
)), /* @__PURE__ */
|
|
193
|
-
/* @__PURE__ */
|
|
187
|
+
)), /* @__PURE__ */ React12.createElement("p", { className: "text-xs font-medium text-blue-600 mt-2" }, status === "initializing" ? "\u6B63\u5728\u52A0\u8F7D\u5F15\u64CE..." : `\u8BC6\u522B\u4E2D ${Math.round(progress * 100)}%`))), result && !isProcessing && /* @__PURE__ */ React12.createElement("div", { className: "bg-gray-50 p-4 rounded-lg border border-gray-100 animate-in fade-in slide-in-from-bottom-2" }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-2 mb-2 text-gray-600 font-medium" }, /* @__PURE__ */ React12.createElement(FileText, { size: 18 }), /* @__PURE__ */ React12.createElement("span", null, "\u8BC6\u522B\u7ED3\u679C (\u7F6E\u4FE1\u5EA6: ", Math.round(result.confidence), "%)")), /* @__PURE__ */ React12.createElement("pre", { className: "text-sm text-gray-800 whitespace-pre-wrap font-sans" }, result.text)), error && /* @__PURE__ */ React12.createElement("div", { className: "p-3 bg-red-50 text-red-600 text-sm rounded-lg border border-red-100" }, "\u8BC6\u522B\u5931\u8D25: ", error.message)),
|
|
188
|
+
/* @__PURE__ */ React12.createElement(
|
|
194
189
|
"input",
|
|
195
190
|
{
|
|
196
191
|
type: "file",
|
|
@@ -338,37 +333,37 @@ var BackgroundRemover = ({
|
|
|
338
333
|
a.download = "removed_background.png";
|
|
339
334
|
a.click();
|
|
340
335
|
};
|
|
341
|
-
return /* @__PURE__ */
|
|
336
|
+
return /* @__PURE__ */ React12.createElement("div", { className: `p-6 border-2 border-dashed rounded-xl transition-all ${isProcessing ? "border-purple-400 bg-purple-50/10" : "border-gray-200 hover:border-purple-400"} ${className}` }, !imagePreview ? /* @__PURE__ */ React12.createElement(
|
|
342
337
|
"div",
|
|
343
338
|
{
|
|
344
339
|
className: "flex flex-col items-center justify-center cursor-pointer space-y-4",
|
|
345
340
|
onClick: () => fileInputRef.current?.click()
|
|
346
341
|
},
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
) : /* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ React12.createElement("div", { className: "p-4 bg-purple-50 rounded-full text-purple-500" }, /* @__PURE__ */ React12.createElement(Eraser, { size: 32 })),
|
|
343
|
+
/* @__PURE__ */ React12.createElement("div", { className: "text-center" }, /* @__PURE__ */ React12.createElement("p", { className: "text-lg font-medium text-gray-700" }, "\u4E0A\u4F20\u56FE\u7247\u79FB\u9664\u80CC\u666F"), /* @__PURE__ */ React12.createElement("p", { className: "text-sm text-gray-500" }, "\u5EFA\u8BAE\u4F7F\u7528\u4E3B\u4F53\u660E\u786E\u7684\u56FE\u7247"))
|
|
344
|
+
) : /* @__PURE__ */ React12.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React12.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4" }, /* @__PURE__ */ React12.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React12.createElement("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wider" }, "\u539F\u56FE"), /* @__PURE__ */ React12.createElement("div", { className: "relative rounded-lg overflow-hidden border border-gray-200 bg-gray-50" }, /* @__PURE__ */ React12.createElement("img", { src: imagePreview, alt: "Original", className: "max-h-64 mx-auto object-contain" }))), /* @__PURE__ */ React12.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React12.createElement("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wider" }, "\u5904\u7406\u7ED3\u679C"), /* @__PURE__ */ React12.createElement("div", { className: "relative rounded-lg overflow-hidden border border-gray-200 bg-grid-slate-100 bg-[size:20px_20px]" }, resultUrl ? /* @__PURE__ */ React12.createElement("img", { src: resultUrl, alt: "Result", className: "max-h-64 mx-auto object-contain animate-in fade-in zoom-in-95 duration-500" }) : /* @__PURE__ */ React12.createElement("div", { className: "h-64 flex flex-col items-center justify-center text-gray-400" }, isProcessing ? /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(Loader2, { className: "animate-spin text-purple-500 mb-2", size: 32 }), /* @__PURE__ */ React12.createElement("div", { className: "w-32 bg-gray-200 rounded-full h-1.5 overflow-hidden" }, /* @__PURE__ */ React12.createElement(
|
|
350
345
|
"div",
|
|
351
346
|
{
|
|
352
347
|
className: "bg-purple-500 h-full transition-all duration-300",
|
|
353
348
|
style: { width: `${progress * 100}%` }
|
|
354
349
|
}
|
|
355
|
-
)), /* @__PURE__ */
|
|
350
|
+
)), /* @__PURE__ */ React12.createElement("p", { className: "text-[10px] mt-2 font-mono uppercase" }, status.replace(/-/g, " "))) : /* @__PURE__ */ React12.createElement("span", { className: "text-sm italic" }, "\u7B49\u5F85\u5904\u7406..."))))), /* @__PURE__ */ React12.createElement("div", { className: "flex justify-between items-center pt-2" }, !isProcessing && /* @__PURE__ */ React12.createElement(
|
|
356
351
|
"button",
|
|
357
352
|
{
|
|
358
353
|
onClick: reset,
|
|
359
354
|
className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-900 transition-colors"
|
|
360
355
|
},
|
|
361
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ React12.createElement(X, { size: 16 }),
|
|
362
357
|
"\u91CD\u65B0\u5F00\u59CB"
|
|
363
|
-
), resultUrl && !isProcessing && /* @__PURE__ */
|
|
358
|
+
), resultUrl && !isProcessing && /* @__PURE__ */ React12.createElement(
|
|
364
359
|
"button",
|
|
365
360
|
{
|
|
366
361
|
onClick: downloadResult,
|
|
367
362
|
className: "flex items-center gap-2 px-6 py-2 bg-purple-600 hover:bg-purple-700 text-white rounded-lg shadow-sm transition-all"
|
|
368
363
|
},
|
|
369
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ React12.createElement(Download, { size: 16 }),
|
|
370
365
|
"\u4E0B\u8F7D PNG"
|
|
371
|
-
)), error && /* @__PURE__ */
|
|
366
|
+
)), error && /* @__PURE__ */ React12.createElement("div", { className: "p-3 bg-red-50 text-red-600 text-sm rounded-lg border border-red-100" }, "\u5904\u7406\u5931\u8D25: ", error.message)), /* @__PURE__ */ React12.createElement(
|
|
372
367
|
"input",
|
|
373
368
|
{
|
|
374
369
|
type: "file",
|
|
@@ -487,11 +482,11 @@ var SentimentAnalyzer = ({
|
|
|
487
482
|
if (!result) return null;
|
|
488
483
|
switch (result.sentiment) {
|
|
489
484
|
case "positive":
|
|
490
|
-
return /* @__PURE__ */
|
|
485
|
+
return /* @__PURE__ */ React12.createElement(Smile, { className: "text-green-500", size: 24 });
|
|
491
486
|
case "negative":
|
|
492
|
-
return /* @__PURE__ */
|
|
487
|
+
return /* @__PURE__ */ React12.createElement(Frown, { className: "text-red-500", size: 24 });
|
|
493
488
|
default:
|
|
494
|
-
return /* @__PURE__ */
|
|
489
|
+
return /* @__PURE__ */ React12.createElement(Meh, { className: "text-yellow-500", size: 24 });
|
|
495
490
|
}
|
|
496
491
|
};
|
|
497
492
|
const getSentimentColor = () => {
|
|
@@ -505,7 +500,7 @@ var SentimentAnalyzer = ({
|
|
|
505
500
|
return "bg-yellow-50 border-yellow-200 text-yellow-700";
|
|
506
501
|
}
|
|
507
502
|
};
|
|
508
|
-
return /* @__PURE__ */
|
|
503
|
+
return /* @__PURE__ */ React12.createElement("div", { className: `p-6 border rounded-xl bg-white dark:bg-gray-800 shadow-sm ${className}` }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-2 mb-4 text-gray-700 dark:text-gray-300 font-medium" }, /* @__PURE__ */ React12.createElement(MessageSquare, { size: 20 }), /* @__PURE__ */ React12.createElement("span", null, "\u6587\u672C\u60C5\u611F\u5206\u6790")), /* @__PURE__ */ React12.createElement("div", { className: "relative" }, /* @__PURE__ */ React12.createElement(
|
|
509
504
|
"textarea",
|
|
510
505
|
{
|
|
511
506
|
value: text,
|
|
@@ -514,15 +509,15 @@ var SentimentAnalyzer = ({
|
|
|
514
509
|
className: "w-full h-32 p-4 bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all outline-none resize-none text-gray-800 dark:text-gray-200",
|
|
515
510
|
disabled: isProcessing
|
|
516
511
|
}
|
|
517
|
-
), /* @__PURE__ */
|
|
512
|
+
), /* @__PURE__ */ React12.createElement(
|
|
518
513
|
"button",
|
|
519
514
|
{
|
|
520
515
|
onClick: handleAnalyze,
|
|
521
516
|
disabled: !text.trim() || isProcessing,
|
|
522
517
|
className: "absolute bottom-3 right-3 p-2 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 text-white rounded-md transition-colors shadow-sm"
|
|
523
518
|
},
|
|
524
|
-
isProcessing ? /* @__PURE__ */
|
|
525
|
-
)), isProcessing && /* @__PURE__ */
|
|
519
|
+
isProcessing ? /* @__PURE__ */ React12.createElement(Loader2, { className: "animate-spin", size: 18 }) : /* @__PURE__ */ React12.createElement(Send, { size: 18 })
|
|
520
|
+
)), isProcessing && /* @__PURE__ */ React12.createElement("div", { className: "mt-4 flex items-center gap-2 text-sm text-blue-600 animate-pulse" }, /* @__PURE__ */ React12.createElement(Loader2, { size: 14, className: "animate-spin" }), /* @__PURE__ */ React12.createElement("span", null, "\u6B63\u5728\u5206\u6790 (\u9996\u6B21\u8FD0\u884C\u5C06\u52A0\u8F7D\u6A21\u578B\u8D44\u6E90)...")), result && !isProcessing && /* @__PURE__ */ React12.createElement("div", { className: `mt-4 p-4 border rounded-lg flex items-center gap-4 animate-in fade-in slide-in-from-top-2 ${getSentimentColor()}` }, /* @__PURE__ */ React12.createElement("div", { className: "p-2 bg-white rounded-full shadow-sm" }, getSentimentIcon()), /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("p", { className: "font-bold text-lg capitalize" }, result.sentiment), /* @__PURE__ */ React12.createElement("p", { className: "text-sm opacity-80" }, "\u7F6E\u4FE1\u5EA6: ", (result.score * 100).toFixed(1), "% (", result.label, ")"))), error && /* @__PURE__ */ React12.createElement("div", { className: "mt-4 p-3 bg-red-50 text-red-600 text-sm rounded-lg border border-red-100" }, "\u5206\u6790\u5931\u8D25: ", error.message));
|
|
526
521
|
};
|
|
527
522
|
var useTextGeneration = (options = {}) => {
|
|
528
523
|
const [state, setState] = useState({
|
|
@@ -662,7 +657,7 @@ AI\u56DE\u5E94\uFF1A\u201C`;
|
|
|
662
657
|
setChatHistory((prev) => [...prev, { role: "assistant", content: "\uFF08\u672C\u5730\u6A21\u578B\u601D\u8003\u8FC7\u5EA6\uFF0C\u6682\u65F6\u4F11\u606F\u4E2D...\uFF09" }]);
|
|
663
658
|
}
|
|
664
659
|
};
|
|
665
|
-
return /* @__PURE__ */
|
|
660
|
+
return /* @__PURE__ */ React12.createElement("div", { className: `flex flex-col h-[500px] bg-white dark:bg-gray-800 rounded-xl shadow-inner border border-gray-100 dark:border-gray-700 overflow-hidden ${className}` }, /* @__PURE__ */ React12.createElement("div", { ref: scrollRef, className: "flex-1 overflow-y-auto p-4 space-y-4 bg-gray-50/50 dark:bg-gray-900/50" }, chatHistory.length === 0 && /* @__PURE__ */ React12.createElement("div", { className: "h-full flex flex-col items-center justify-center text-gray-400 space-y-2" }, /* @__PURE__ */ React12.createElement(Bot, { size: 48, className: "opacity-20" }), /* @__PURE__ */ React12.createElement("p", { className: "text-sm italic text-center px-8 text-gray-400 font-sans" }, "\u4F60\u597D\uFF01\u6211\u662F 100% \u672C\u5730\u8FD0\u884C\u7684 AI\u3002", /* @__PURE__ */ React12.createElement("br", null), "\u4F60\u53EF\u4EE5\u548C\u6211\u804A\u804A\u5929\uFF0C\u6211\u4F1A\u5C1D\u8BD5\u7406\u89E3\u4F60\u7684\u610F\u601D\u3002")), chatHistory.map((msg, i) => /* @__PURE__ */ React12.createElement("div", { key: i, className: `flex ${msg.role === "user" ? "justify-end" : "justify-start"} animate-in fade-in slide-in-from-bottom-2` }, /* @__PURE__ */ React12.createElement("div", { className: `flex gap-3 max-w-[85%] ${msg.role === "user" ? "flex-row-reverse" : ""}` }, /* @__PURE__ */ React12.createElement("div", { className: `p-2 rounded-lg h-fit ${msg.role === "user" ? "bg-blue-100 text-blue-600" : "bg-white dark:bg-gray-700 shadow-sm border border-gray-100 dark:border-gray-600 text-gray-400"}` }, msg.role === "user" ? /* @__PURE__ */ React12.createElement(User, { size: 18 }) : /* @__PURE__ */ React12.createElement(Bot, { size: 18 })), /* @__PURE__ */ React12.createElement("div", { className: `p-3 rounded-2xl shadow-sm text-sm ${msg.role === "user" ? "bg-blue-600 text-white rounded-tr-none" : "bg-white dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-tl-none border border-gray-100 dark:border-gray-600 leading-relaxed"}` }, msg.content)))), isGenerating && /* @__PURE__ */ React12.createElement("div", { className: "flex justify-start" }, /* @__PURE__ */ React12.createElement("div", { className: "flex gap-3 items-center bg-white dark:bg-gray-700 p-3 rounded-2xl rounded-tl-none border border-gray-100 dark:border-gray-600" }, /* @__PURE__ */ React12.createElement(Loader2, { className: "animate-spin text-blue-500", size: 16 }), /* @__PURE__ */ React12.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React12.createElement("span", { className: "text-xs text-gray-500 font-medium" }, "\u601D\u8003\u4E2D..."), /* @__PURE__ */ React12.createElement("span", { className: "text-[10px] text-blue-400 font-mono tracking-tighter" }, genStatus))))), /* @__PURE__ */ React12.createElement("div", { className: "p-4 bg-white dark:bg-gray-800 border-t border-gray-100 dark:border-gray-700" }, /* @__PURE__ */ React12.createElement("div", { className: "relative flex items-center gap-2" }, /* @__PURE__ */ React12.createElement(
|
|
666
661
|
"input",
|
|
667
662
|
{
|
|
668
663
|
type: "text",
|
|
@@ -673,1438 +668,16 @@ AI\u56DE\u5E94\uFF1A\u201C`;
|
|
|
673
668
|
className: "flex-1 bg-gray-50 dark:bg-gray-900 border-none rounded-full px-5 py-3 pr-12 text-sm focus:ring-2 focus:ring-blue-500 outline-none dark:text-white text-gray-800",
|
|
674
669
|
disabled: isGenerating
|
|
675
670
|
}
|
|
676
|
-
), /* @__PURE__ */
|
|
671
|
+
), /* @__PURE__ */ React12.createElement(
|
|
677
672
|
"button",
|
|
678
673
|
{
|
|
679
674
|
onClick: handleSend,
|
|
680
675
|
disabled: !input.trim() || isGenerating,
|
|
681
676
|
className: "absolute right-1 p-2.5 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 text-white rounded-full transition-all shadow-md active:scale-95 flex items-center justify-center"
|
|
682
677
|
},
|
|
683
|
-
/* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ React12.createElement(Send, { size: 18 })
|
|
684
679
|
))));
|
|
685
680
|
};
|
|
686
|
-
var buttonVariants = cva(
|
|
687
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
688
|
-
{
|
|
689
|
-
variants: {
|
|
690
|
-
variant: {
|
|
691
|
-
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
692
|
-
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
693
|
-
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
694
|
-
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
695
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
696
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
697
|
-
},
|
|
698
|
-
size: {
|
|
699
|
-
default: "h-9 px-4 py-2",
|
|
700
|
-
sm: "h-8 rounded-md px-3 text-xs",
|
|
701
|
-
lg: "h-10 rounded-md px-8",
|
|
702
|
-
icon: "h-9 w-9"
|
|
703
|
-
}
|
|
704
|
-
},
|
|
705
|
-
defaultVariants: {
|
|
706
|
-
variant: "default",
|
|
707
|
-
size: "default"
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
);
|
|
711
|
-
var Button = React37.forwardRef(
|
|
712
|
-
({ className, variant = "default", size = "default", asChild = false, ...props }, ref) => {
|
|
713
|
-
const Comp = asChild ? Slot : "button";
|
|
714
|
-
return /* @__PURE__ */ React37.createElement(
|
|
715
|
-
Comp,
|
|
716
|
-
{
|
|
717
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
718
|
-
ref,
|
|
719
|
-
...props
|
|
720
|
-
}
|
|
721
|
-
);
|
|
722
|
-
}
|
|
723
|
-
);
|
|
724
|
-
Button.displayName = "Button";
|
|
725
|
-
var Card = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
726
|
-
"div",
|
|
727
|
-
{
|
|
728
|
-
ref,
|
|
729
|
-
className: cn(
|
|
730
|
-
"rounded-xl border bg-card text-card-foreground shadow",
|
|
731
|
-
className
|
|
732
|
-
),
|
|
733
|
-
...props
|
|
734
|
-
}
|
|
735
|
-
));
|
|
736
|
-
Card.displayName = "Card";
|
|
737
|
-
var CardHeader = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
738
|
-
"div",
|
|
739
|
-
{
|
|
740
|
-
ref,
|
|
741
|
-
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
742
|
-
...props
|
|
743
|
-
}
|
|
744
|
-
));
|
|
745
|
-
CardHeader.displayName = "CardHeader";
|
|
746
|
-
var CardTitle = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
747
|
-
"div",
|
|
748
|
-
{
|
|
749
|
-
ref,
|
|
750
|
-
className: cn("font-semibold leading-none tracking-tight", className),
|
|
751
|
-
...props
|
|
752
|
-
}
|
|
753
|
-
));
|
|
754
|
-
CardTitle.displayName = "CardTitle";
|
|
755
|
-
var CardDescription = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
756
|
-
"div",
|
|
757
|
-
{
|
|
758
|
-
ref,
|
|
759
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
760
|
-
...props
|
|
761
|
-
}
|
|
762
|
-
));
|
|
763
|
-
CardDescription.displayName = "CardDescription";
|
|
764
|
-
var CardContent = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
765
|
-
CardContent.displayName = "CardContent";
|
|
766
|
-
var CardFooter = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
767
|
-
"div",
|
|
768
|
-
{
|
|
769
|
-
ref,
|
|
770
|
-
className: cn("flex items-center p-6 pt-0", className),
|
|
771
|
-
...props
|
|
772
|
-
}
|
|
773
|
-
));
|
|
774
|
-
CardFooter.displayName = "CardFooter";
|
|
775
|
-
var badgeVariants = cva(
|
|
776
|
-
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
777
|
-
{
|
|
778
|
-
variants: {
|
|
779
|
-
variant: {
|
|
780
|
-
default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
781
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
782
|
-
destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
783
|
-
outline: "text-foreground"
|
|
784
|
-
}
|
|
785
|
-
},
|
|
786
|
-
defaultVariants: {
|
|
787
|
-
variant: "default"
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
);
|
|
791
|
-
function Badge({ className, variant, ...props }) {
|
|
792
|
-
return /* @__PURE__ */ React37.createElement("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
793
|
-
}
|
|
794
|
-
var Input = React37.forwardRef(
|
|
795
|
-
({ className, type, ...props }, ref) => {
|
|
796
|
-
return /* @__PURE__ */ React37.createElement(
|
|
797
|
-
"input",
|
|
798
|
-
{
|
|
799
|
-
type,
|
|
800
|
-
className: cn(
|
|
801
|
-
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
802
|
-
className
|
|
803
|
-
),
|
|
804
|
-
ref,
|
|
805
|
-
...props
|
|
806
|
-
}
|
|
807
|
-
);
|
|
808
|
-
}
|
|
809
|
-
);
|
|
810
|
-
Input.displayName = "Input";
|
|
811
|
-
var labelVariants = cva(
|
|
812
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
813
|
-
);
|
|
814
|
-
var Label = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
815
|
-
LabelPrimitive.Root,
|
|
816
|
-
{
|
|
817
|
-
ref,
|
|
818
|
-
className: cn(labelVariants(), className),
|
|
819
|
-
...props
|
|
820
|
-
}
|
|
821
|
-
));
|
|
822
|
-
Label.displayName = LabelPrimitive.Root.displayName;
|
|
823
|
-
var Tabs = TabsPrimitive.Root;
|
|
824
|
-
var TabsList = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
825
|
-
TabsPrimitive.List,
|
|
826
|
-
{
|
|
827
|
-
ref,
|
|
828
|
-
className: cn(
|
|
829
|
-
"inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
|
|
830
|
-
className
|
|
831
|
-
),
|
|
832
|
-
...props
|
|
833
|
-
}
|
|
834
|
-
));
|
|
835
|
-
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
836
|
-
var TabsTrigger = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
837
|
-
TabsPrimitive.Trigger,
|
|
838
|
-
{
|
|
839
|
-
ref,
|
|
840
|
-
className: cn(
|
|
841
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
|
|
842
|
-
className
|
|
843
|
-
),
|
|
844
|
-
...props
|
|
845
|
-
}
|
|
846
|
-
));
|
|
847
|
-
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
848
|
-
var TabsContent = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
849
|
-
TabsPrimitive.Content,
|
|
850
|
-
{
|
|
851
|
-
ref,
|
|
852
|
-
className: cn(
|
|
853
|
-
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
854
|
-
className
|
|
855
|
-
),
|
|
856
|
-
...props
|
|
857
|
-
}
|
|
858
|
-
));
|
|
859
|
-
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
860
|
-
var Dialog = DialogPrimitive.Root;
|
|
861
|
-
var DialogTrigger = DialogPrimitive.Trigger;
|
|
862
|
-
var DialogPortal = DialogPrimitive.Portal;
|
|
863
|
-
var DialogClose = DialogPrimitive.Close;
|
|
864
|
-
var DialogOverlay = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
865
|
-
DialogPrimitive.Overlay,
|
|
866
|
-
{
|
|
867
|
-
ref,
|
|
868
|
-
className: cn(
|
|
869
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
870
|
-
className
|
|
871
|
-
),
|
|
872
|
-
...props
|
|
873
|
-
}
|
|
874
|
-
));
|
|
875
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
876
|
-
var DialogContent = React37.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React37.createElement(DialogPortal, null, /* @__PURE__ */ React37.createElement(DialogOverlay, null), /* @__PURE__ */ React37.createElement(
|
|
877
|
-
DialogPrimitive.Content,
|
|
878
|
-
{
|
|
879
|
-
ref,
|
|
880
|
-
className: cn(
|
|
881
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
882
|
-
className
|
|
883
|
-
),
|
|
884
|
-
...props
|
|
885
|
-
},
|
|
886
|
-
children,
|
|
887
|
-
/* @__PURE__ */ React37.createElement(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground" }, /* @__PURE__ */ React37.createElement(X, { className: "h-4 w-4" }), /* @__PURE__ */ React37.createElement("span", { className: "sr-only" }, "Close"))
|
|
888
|
-
)));
|
|
889
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
890
|
-
var DialogHeader = ({
|
|
891
|
-
className,
|
|
892
|
-
...props
|
|
893
|
-
}) => /* @__PURE__ */ React37.createElement(
|
|
894
|
-
"div",
|
|
895
|
-
{
|
|
896
|
-
className: cn(
|
|
897
|
-
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
898
|
-
className
|
|
899
|
-
),
|
|
900
|
-
...props
|
|
901
|
-
}
|
|
902
|
-
);
|
|
903
|
-
DialogHeader.displayName = "DialogHeader";
|
|
904
|
-
var DialogFooter = ({
|
|
905
|
-
className,
|
|
906
|
-
...props
|
|
907
|
-
}) => /* @__PURE__ */ React37.createElement(
|
|
908
|
-
"div",
|
|
909
|
-
{
|
|
910
|
-
className: cn(
|
|
911
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
912
|
-
className
|
|
913
|
-
),
|
|
914
|
-
...props
|
|
915
|
-
}
|
|
916
|
-
);
|
|
917
|
-
DialogFooter.displayName = "DialogFooter";
|
|
918
|
-
var DialogTitle = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
919
|
-
DialogPrimitive.Title,
|
|
920
|
-
{
|
|
921
|
-
ref,
|
|
922
|
-
className: cn(
|
|
923
|
-
"text-lg font-semibold leading-none tracking-tight",
|
|
924
|
-
className
|
|
925
|
-
),
|
|
926
|
-
...props
|
|
927
|
-
}
|
|
928
|
-
));
|
|
929
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
930
|
-
var DialogDescription = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
931
|
-
DialogPrimitive.Description,
|
|
932
|
-
{
|
|
933
|
-
ref,
|
|
934
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
935
|
-
...props
|
|
936
|
-
}
|
|
937
|
-
));
|
|
938
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
939
|
-
var AlertDialog = AlertDialogPrimitive.Root;
|
|
940
|
-
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
941
|
-
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
942
|
-
var AlertDialogOverlay = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
943
|
-
AlertDialogPrimitive.Overlay,
|
|
944
|
-
{
|
|
945
|
-
className: cn(
|
|
946
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
947
|
-
className
|
|
948
|
-
),
|
|
949
|
-
...props,
|
|
950
|
-
ref
|
|
951
|
-
}
|
|
952
|
-
));
|
|
953
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
954
|
-
var AlertDialogContent = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(AlertDialogPortal, null, /* @__PURE__ */ React37.createElement(AlertDialogOverlay, null), /* @__PURE__ */ React37.createElement(
|
|
955
|
-
AlertDialogPrimitive.Content,
|
|
956
|
-
{
|
|
957
|
-
ref,
|
|
958
|
-
className: cn(
|
|
959
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
960
|
-
className
|
|
961
|
-
),
|
|
962
|
-
...props
|
|
963
|
-
}
|
|
964
|
-
)));
|
|
965
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
966
|
-
var AlertDialogHeader = ({
|
|
967
|
-
className,
|
|
968
|
-
...props
|
|
969
|
-
}) => /* @__PURE__ */ React37.createElement(
|
|
970
|
-
"div",
|
|
971
|
-
{
|
|
972
|
-
className: cn(
|
|
973
|
-
"flex flex-col space-y-2 text-center sm:text-left",
|
|
974
|
-
className
|
|
975
|
-
),
|
|
976
|
-
...props
|
|
977
|
-
}
|
|
978
|
-
);
|
|
979
|
-
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
980
|
-
var AlertDialogFooter = ({
|
|
981
|
-
className,
|
|
982
|
-
...props
|
|
983
|
-
}) => /* @__PURE__ */ React37.createElement(
|
|
984
|
-
"div",
|
|
985
|
-
{
|
|
986
|
-
className: cn(
|
|
987
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
988
|
-
className
|
|
989
|
-
),
|
|
990
|
-
...props
|
|
991
|
-
}
|
|
992
|
-
);
|
|
993
|
-
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
994
|
-
var AlertDialogTitle = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
995
|
-
AlertDialogPrimitive.Title,
|
|
996
|
-
{
|
|
997
|
-
ref,
|
|
998
|
-
className: cn("text-lg font-semibold", className),
|
|
999
|
-
...props
|
|
1000
|
-
}
|
|
1001
|
-
));
|
|
1002
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
1003
|
-
var AlertDialogDescription = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1004
|
-
AlertDialogPrimitive.Description,
|
|
1005
|
-
{
|
|
1006
|
-
ref,
|
|
1007
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
1008
|
-
...props
|
|
1009
|
-
}
|
|
1010
|
-
));
|
|
1011
|
-
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
1012
|
-
var AlertDialogAction = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1013
|
-
AlertDialogPrimitive.Action,
|
|
1014
|
-
{
|
|
1015
|
-
ref,
|
|
1016
|
-
className: cn(buttonVariants(), className),
|
|
1017
|
-
...props
|
|
1018
|
-
}
|
|
1019
|
-
));
|
|
1020
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
1021
|
-
var AlertDialogCancel = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1022
|
-
AlertDialogPrimitive.Cancel,
|
|
1023
|
-
{
|
|
1024
|
-
ref,
|
|
1025
|
-
className: cn(
|
|
1026
|
-
buttonVariants({ variant: "outline" }),
|
|
1027
|
-
"mt-2 sm:mt-0",
|
|
1028
|
-
className
|
|
1029
|
-
),
|
|
1030
|
-
...props
|
|
1031
|
-
}
|
|
1032
|
-
));
|
|
1033
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
1034
|
-
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
1035
|
-
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1036
|
-
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
1037
|
-
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
1038
|
-
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
1039
|
-
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
1040
|
-
var DropdownMenuSubTrigger = React37.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1041
|
-
DropdownMenuPrimitive.SubTrigger,
|
|
1042
|
-
{
|
|
1043
|
-
ref,
|
|
1044
|
-
className: cn(
|
|
1045
|
-
"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
1046
|
-
inset && "pl-8",
|
|
1047
|
-
className
|
|
1048
|
-
),
|
|
1049
|
-
...props
|
|
1050
|
-
},
|
|
1051
|
-
children,
|
|
1052
|
-
/* @__PURE__ */ React37.createElement(ChevronRight, { className: "ml-auto" })
|
|
1053
|
-
));
|
|
1054
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1055
|
-
var DropdownMenuSubContent = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1056
|
-
DropdownMenuPrimitive.SubContent,
|
|
1057
|
-
{
|
|
1058
|
-
ref,
|
|
1059
|
-
className: cn(
|
|
1060
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
1061
|
-
className
|
|
1062
|
-
),
|
|
1063
|
-
...props
|
|
1064
|
-
}
|
|
1065
|
-
));
|
|
1066
|
-
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1067
|
-
var DropdownMenuContent = React37.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React37.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React37.createElement(
|
|
1068
|
-
DropdownMenuPrimitive.Content,
|
|
1069
|
-
{
|
|
1070
|
-
ref,
|
|
1071
|
-
sideOffset,
|
|
1072
|
-
className: cn(
|
|
1073
|
-
"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
1074
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
1075
|
-
className
|
|
1076
|
-
),
|
|
1077
|
-
...props
|
|
1078
|
-
}
|
|
1079
|
-
)));
|
|
1080
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1081
|
-
var DropdownMenuItem = React37.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1082
|
-
DropdownMenuPrimitive.Item,
|
|
1083
|
-
{
|
|
1084
|
-
ref,
|
|
1085
|
-
className: cn(
|
|
1086
|
-
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
1087
|
-
inset && "pl-8",
|
|
1088
|
-
className
|
|
1089
|
-
),
|
|
1090
|
-
...props
|
|
1091
|
-
}
|
|
1092
|
-
));
|
|
1093
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1094
|
-
var DropdownMenuCheckboxItem = React37.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1095
|
-
DropdownMenuPrimitive.CheckboxItem,
|
|
1096
|
-
{
|
|
1097
|
-
ref,
|
|
1098
|
-
className: cn(
|
|
1099
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1100
|
-
className
|
|
1101
|
-
),
|
|
1102
|
-
checked,
|
|
1103
|
-
...props
|
|
1104
|
-
},
|
|
1105
|
-
/* @__PURE__ */ React37.createElement("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center" }, /* @__PURE__ */ React37.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React37.createElement(Check, { className: "h-4 w-4" }))),
|
|
1106
|
-
children
|
|
1107
|
-
));
|
|
1108
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1109
|
-
var DropdownMenuRadioItem = React37.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1110
|
-
DropdownMenuPrimitive.RadioItem,
|
|
1111
|
-
{
|
|
1112
|
-
ref,
|
|
1113
|
-
className: cn(
|
|
1114
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1115
|
-
className
|
|
1116
|
-
),
|
|
1117
|
-
...props
|
|
1118
|
-
},
|
|
1119
|
-
/* @__PURE__ */ React37.createElement("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center" }, /* @__PURE__ */ React37.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React37.createElement(Circle, { className: "h-2 w-2 fill-current" }))),
|
|
1120
|
-
children
|
|
1121
|
-
));
|
|
1122
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
1123
|
-
var DropdownMenuLabel = React37.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1124
|
-
DropdownMenuPrimitive.Label,
|
|
1125
|
-
{
|
|
1126
|
-
ref,
|
|
1127
|
-
className: cn(
|
|
1128
|
-
"px-2 py-1.5 text-sm font-semibold",
|
|
1129
|
-
inset && "pl-8",
|
|
1130
|
-
className
|
|
1131
|
-
),
|
|
1132
|
-
...props
|
|
1133
|
-
}
|
|
1134
|
-
));
|
|
1135
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1136
|
-
var DropdownMenuSeparator = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1137
|
-
DropdownMenuPrimitive.Separator,
|
|
1138
|
-
{
|
|
1139
|
-
ref,
|
|
1140
|
-
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
1141
|
-
...props
|
|
1142
|
-
}
|
|
1143
|
-
));
|
|
1144
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
1145
|
-
var DropdownMenuShortcut = ({
|
|
1146
|
-
className,
|
|
1147
|
-
...props
|
|
1148
|
-
}) => {
|
|
1149
|
-
return /* @__PURE__ */ React37.createElement(
|
|
1150
|
-
"span",
|
|
1151
|
-
{
|
|
1152
|
-
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
1153
|
-
...props
|
|
1154
|
-
}
|
|
1155
|
-
);
|
|
1156
|
-
};
|
|
1157
|
-
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
1158
|
-
var Popover = PopoverPrimitive.Root;
|
|
1159
|
-
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1160
|
-
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
1161
|
-
var PopoverContent = React37.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React37.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React37.createElement(
|
|
1162
|
-
PopoverPrimitive.Content,
|
|
1163
|
-
{
|
|
1164
|
-
ref,
|
|
1165
|
-
align,
|
|
1166
|
-
sideOffset,
|
|
1167
|
-
className: cn(
|
|
1168
|
-
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",
|
|
1169
|
-
className
|
|
1170
|
-
),
|
|
1171
|
-
...props
|
|
1172
|
-
}
|
|
1173
|
-
)));
|
|
1174
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1175
|
-
var Progress = React37.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1176
|
-
ProgressPrimitive.Root,
|
|
1177
|
-
{
|
|
1178
|
-
ref,
|
|
1179
|
-
className: cn(
|
|
1180
|
-
"relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
|
|
1181
|
-
className
|
|
1182
|
-
),
|
|
1183
|
-
...props
|
|
1184
|
-
},
|
|
1185
|
-
/* @__PURE__ */ React37.createElement(
|
|
1186
|
-
ProgressPrimitive.Indicator,
|
|
1187
|
-
{
|
|
1188
|
-
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
1189
|
-
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
1190
|
-
}
|
|
1191
|
-
)
|
|
1192
|
-
));
|
|
1193
|
-
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
1194
|
-
var ScrollArea = React37.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1195
|
-
ScrollAreaPrimitive.Root,
|
|
1196
|
-
{
|
|
1197
|
-
ref,
|
|
1198
|
-
className: cn("relative overflow-hidden", className),
|
|
1199
|
-
...props
|
|
1200
|
-
},
|
|
1201
|
-
/* @__PURE__ */ React37.createElement(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]" }, children),
|
|
1202
|
-
/* @__PURE__ */ React37.createElement(ScrollBar, null),
|
|
1203
|
-
/* @__PURE__ */ React37.createElement(ScrollAreaPrimitive.Corner, null)
|
|
1204
|
-
));
|
|
1205
|
-
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
1206
|
-
var ScrollBar = React37.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1207
|
-
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
1208
|
-
{
|
|
1209
|
-
ref,
|
|
1210
|
-
orientation,
|
|
1211
|
-
className: cn(
|
|
1212
|
-
"flex touch-none select-none transition-colors",
|
|
1213
|
-
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
1214
|
-
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
1215
|
-
className
|
|
1216
|
-
),
|
|
1217
|
-
...props
|
|
1218
|
-
},
|
|
1219
|
-
/* @__PURE__ */ React37.createElement(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
1220
|
-
));
|
|
1221
|
-
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
1222
|
-
var Select = SelectPrimitive.Root;
|
|
1223
|
-
var SelectGroup = SelectPrimitive.Group;
|
|
1224
|
-
var SelectValue = SelectPrimitive.Value;
|
|
1225
|
-
var SelectTrigger = React37.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1226
|
-
SelectPrimitive.Trigger,
|
|
1227
|
-
{
|
|
1228
|
-
ref,
|
|
1229
|
-
className: cn(
|
|
1230
|
-
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
1231
|
-
className
|
|
1232
|
-
),
|
|
1233
|
-
...props
|
|
1234
|
-
},
|
|
1235
|
-
children,
|
|
1236
|
-
/* @__PURE__ */ React37.createElement(SelectPrimitive.Icon, { asChild: true }, /* @__PURE__ */ React37.createElement(ChevronDown, { className: "h-4 w-4 opacity-50" }))
|
|
1237
|
-
));
|
|
1238
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
1239
|
-
var SelectScrollUpButton = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1240
|
-
SelectPrimitive.ScrollUpButton,
|
|
1241
|
-
{
|
|
1242
|
-
ref,
|
|
1243
|
-
className: cn(
|
|
1244
|
-
"flex cursor-default items-center justify-center py-1",
|
|
1245
|
-
className
|
|
1246
|
-
),
|
|
1247
|
-
...props
|
|
1248
|
-
},
|
|
1249
|
-
/* @__PURE__ */ React37.createElement(ChevronUp, { className: "h-4 w-4" })
|
|
1250
|
-
));
|
|
1251
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
1252
|
-
var SelectScrollDownButton = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1253
|
-
SelectPrimitive.ScrollDownButton,
|
|
1254
|
-
{
|
|
1255
|
-
ref,
|
|
1256
|
-
className: cn(
|
|
1257
|
-
"flex cursor-default items-center justify-center py-1",
|
|
1258
|
-
className
|
|
1259
|
-
),
|
|
1260
|
-
...props
|
|
1261
|
-
},
|
|
1262
|
-
/* @__PURE__ */ React37.createElement(ChevronDown, { className: "h-4 w-4" })
|
|
1263
|
-
));
|
|
1264
|
-
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1265
|
-
var SelectContent = React37.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ React37.createElement(SelectPrimitive.Portal, null, /* @__PURE__ */ React37.createElement(
|
|
1266
|
-
SelectPrimitive.Content,
|
|
1267
|
-
{
|
|
1268
|
-
ref,
|
|
1269
|
-
className: cn(
|
|
1270
|
-
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
|
|
1271
|
-
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
1272
|
-
className
|
|
1273
|
-
),
|
|
1274
|
-
position,
|
|
1275
|
-
...props
|
|
1276
|
-
},
|
|
1277
|
-
/* @__PURE__ */ React37.createElement(SelectScrollUpButton, null),
|
|
1278
|
-
/* @__PURE__ */ React37.createElement(
|
|
1279
|
-
SelectPrimitive.Viewport,
|
|
1280
|
-
{
|
|
1281
|
-
className: cn(
|
|
1282
|
-
"p-1",
|
|
1283
|
-
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
1284
|
-
)
|
|
1285
|
-
},
|
|
1286
|
-
children
|
|
1287
|
-
),
|
|
1288
|
-
/* @__PURE__ */ React37.createElement(SelectScrollDownButton, null)
|
|
1289
|
-
)));
|
|
1290
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
1291
|
-
var SelectLabel = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1292
|
-
SelectPrimitive.Label,
|
|
1293
|
-
{
|
|
1294
|
-
ref,
|
|
1295
|
-
className: cn("px-2 py-1.5 text-sm font-semibold", className),
|
|
1296
|
-
...props
|
|
1297
|
-
}
|
|
1298
|
-
));
|
|
1299
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
1300
|
-
var SelectItem = React37.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1301
|
-
SelectPrimitive.Item,
|
|
1302
|
-
{
|
|
1303
|
-
ref,
|
|
1304
|
-
className: cn(
|
|
1305
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1306
|
-
className
|
|
1307
|
-
),
|
|
1308
|
-
...props
|
|
1309
|
-
},
|
|
1310
|
-
/* @__PURE__ */ React37.createElement("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center" }, /* @__PURE__ */ React37.createElement(SelectPrimitive.ItemIndicator, null, /* @__PURE__ */ React37.createElement(Check, { className: "h-4 w-4" }))),
|
|
1311
|
-
/* @__PURE__ */ React37.createElement(SelectPrimitive.ItemText, null, children)
|
|
1312
|
-
));
|
|
1313
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
1314
|
-
var SelectSeparator = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1315
|
-
SelectPrimitive.Separator,
|
|
1316
|
-
{
|
|
1317
|
-
ref,
|
|
1318
|
-
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
1319
|
-
...props
|
|
1320
|
-
}
|
|
1321
|
-
));
|
|
1322
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1323
|
-
var Separator3 = React37.forwardRef(
|
|
1324
|
-
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1325
|
-
SeparatorPrimitive.Root,
|
|
1326
|
-
{
|
|
1327
|
-
ref,
|
|
1328
|
-
decorative,
|
|
1329
|
-
orientation,
|
|
1330
|
-
className: cn(
|
|
1331
|
-
"shrink-0 bg-border",
|
|
1332
|
-
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
1333
|
-
className
|
|
1334
|
-
),
|
|
1335
|
-
...props
|
|
1336
|
-
}
|
|
1337
|
-
)
|
|
1338
|
-
);
|
|
1339
|
-
Separator3.displayName = SeparatorPrimitive.Root.displayName;
|
|
1340
|
-
var Sheet = DialogPrimitive.Root;
|
|
1341
|
-
var SheetTrigger = DialogPrimitive.Trigger;
|
|
1342
|
-
var SheetClose = DialogPrimitive.Close;
|
|
1343
|
-
var SheetPortal = DialogPrimitive.Portal;
|
|
1344
|
-
var SheetOverlay = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1345
|
-
DialogPrimitive.Overlay,
|
|
1346
|
-
{
|
|
1347
|
-
className: cn(
|
|
1348
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1349
|
-
className
|
|
1350
|
-
),
|
|
1351
|
-
...props,
|
|
1352
|
-
ref
|
|
1353
|
-
}
|
|
1354
|
-
));
|
|
1355
|
-
SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1356
|
-
var sheetVariants = cva(
|
|
1357
|
-
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1358
|
-
{
|
|
1359
|
-
variants: {
|
|
1360
|
-
side: {
|
|
1361
|
-
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
1362
|
-
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
1363
|
-
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
1364
|
-
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
1365
|
-
}
|
|
1366
|
-
},
|
|
1367
|
-
defaultVariants: {
|
|
1368
|
-
side: "right"
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
);
|
|
1372
|
-
var SheetContent = React37.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ React37.createElement(SheetPortal, null, /* @__PURE__ */ React37.createElement(SheetOverlay, null), /* @__PURE__ */ React37.createElement(
|
|
1373
|
-
DialogPrimitive.Content,
|
|
1374
|
-
{
|
|
1375
|
-
ref,
|
|
1376
|
-
className: cn(sheetVariants({ side }), className),
|
|
1377
|
-
...props
|
|
1378
|
-
},
|
|
1379
|
-
/* @__PURE__ */ React37.createElement(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary" }, /* @__PURE__ */ React37.createElement(X, { className: "h-4 w-4" }), /* @__PURE__ */ React37.createElement("span", { className: "sr-only" }, "Close")),
|
|
1380
|
-
children
|
|
1381
|
-
)));
|
|
1382
|
-
SheetContent.displayName = DialogPrimitive.Content.displayName;
|
|
1383
|
-
var SheetHeader = ({
|
|
1384
|
-
className,
|
|
1385
|
-
...props
|
|
1386
|
-
}) => /* @__PURE__ */ React37.createElement(
|
|
1387
|
-
"div",
|
|
1388
|
-
{
|
|
1389
|
-
className: cn(
|
|
1390
|
-
"flex flex-col space-y-2 text-center sm:text-left",
|
|
1391
|
-
className
|
|
1392
|
-
),
|
|
1393
|
-
...props
|
|
1394
|
-
}
|
|
1395
|
-
);
|
|
1396
|
-
SheetHeader.displayName = "SheetHeader";
|
|
1397
|
-
var SheetFooter = ({
|
|
1398
|
-
className,
|
|
1399
|
-
...props
|
|
1400
|
-
}) => /* @__PURE__ */ React37.createElement(
|
|
1401
|
-
"div",
|
|
1402
|
-
{
|
|
1403
|
-
className: cn(
|
|
1404
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
1405
|
-
className
|
|
1406
|
-
),
|
|
1407
|
-
...props
|
|
1408
|
-
}
|
|
1409
|
-
);
|
|
1410
|
-
SheetFooter.displayName = "SheetFooter";
|
|
1411
|
-
var SheetTitle = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1412
|
-
DialogPrimitive.Title,
|
|
1413
|
-
{
|
|
1414
|
-
ref,
|
|
1415
|
-
className: cn("text-lg font-semibold text-foreground", className),
|
|
1416
|
-
...props
|
|
1417
|
-
}
|
|
1418
|
-
));
|
|
1419
|
-
SheetTitle.displayName = DialogPrimitive.Title.displayName;
|
|
1420
|
-
var SheetDescription = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1421
|
-
DialogPrimitive.Description,
|
|
1422
|
-
{
|
|
1423
|
-
ref,
|
|
1424
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
1425
|
-
...props
|
|
1426
|
-
}
|
|
1427
|
-
));
|
|
1428
|
-
SheetDescription.displayName = DialogPrimitive.Description.displayName;
|
|
1429
|
-
var Textarea = React37.forwardRef(({ className, ...props }, ref) => {
|
|
1430
|
-
return /* @__PURE__ */ React37.createElement(
|
|
1431
|
-
"textarea",
|
|
1432
|
-
{
|
|
1433
|
-
className: cn(
|
|
1434
|
-
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
1435
|
-
className
|
|
1436
|
-
),
|
|
1437
|
-
ref,
|
|
1438
|
-
...props
|
|
1439
|
-
}
|
|
1440
|
-
);
|
|
1441
|
-
});
|
|
1442
|
-
Textarea.displayName = "Textarea";
|
|
1443
|
-
var TooltipProvider = TooltipPrimitive.Provider;
|
|
1444
|
-
var Tooltip = TooltipPrimitive.Root;
|
|
1445
|
-
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
1446
|
-
var TooltipContent = React37.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React37.createElement(TooltipPrimitive.Portal, null, /* @__PURE__ */ React37.createElement(
|
|
1447
|
-
TooltipPrimitive.Content,
|
|
1448
|
-
{
|
|
1449
|
-
ref,
|
|
1450
|
-
sideOffset,
|
|
1451
|
-
className: cn(
|
|
1452
|
-
"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",
|
|
1453
|
-
className
|
|
1454
|
-
),
|
|
1455
|
-
...props
|
|
1456
|
-
}
|
|
1457
|
-
)));
|
|
1458
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
1459
|
-
var Avatar = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1460
|
-
AvatarPrimitive.Root,
|
|
1461
|
-
{
|
|
1462
|
-
ref,
|
|
1463
|
-
className: cn(
|
|
1464
|
-
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
1465
|
-
className
|
|
1466
|
-
),
|
|
1467
|
-
...props
|
|
1468
|
-
}
|
|
1469
|
-
));
|
|
1470
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
1471
|
-
var AvatarImage = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1472
|
-
AvatarPrimitive.Image,
|
|
1473
|
-
{
|
|
1474
|
-
ref,
|
|
1475
|
-
className: cn("aspect-square h-full w-full", className),
|
|
1476
|
-
...props
|
|
1477
|
-
}
|
|
1478
|
-
));
|
|
1479
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
1480
|
-
var AvatarFallback = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React37.createElement(
|
|
1481
|
-
AvatarPrimitive.Fallback,
|
|
1482
|
-
{
|
|
1483
|
-
ref,
|
|
1484
|
-
className: cn(
|
|
1485
|
-
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
1486
|
-
className
|
|
1487
|
-
),
|
|
1488
|
-
...props
|
|
1489
|
-
}
|
|
1490
|
-
));
|
|
1491
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
1492
|
-
function buildGridColsClasses(columns) {
|
|
1493
|
-
return [
|
|
1494
|
-
"grid-cols-1",
|
|
1495
|
-
// 默认单列
|
|
1496
|
-
columns.sm ? `sm:grid-cols-${columns.sm}` : "",
|
|
1497
|
-
columns.md ? `md:grid-cols-${columns.md}` : "md:grid-cols-2",
|
|
1498
|
-
columns.lg ? `lg:grid-cols-${columns.lg}` : "lg:grid-cols-3",
|
|
1499
|
-
columns.xl ? `xl:grid-cols-${columns.xl}` : ""
|
|
1500
|
-
].filter(Boolean).join(" ");
|
|
1501
|
-
}
|
|
1502
|
-
function getGapClassName(gap) {
|
|
1503
|
-
const gapClasses = {
|
|
1504
|
-
sm: "gap-3",
|
|
1505
|
-
md: "gap-6",
|
|
1506
|
-
lg: "gap-8",
|
|
1507
|
-
xl: "gap-10"
|
|
1508
|
-
};
|
|
1509
|
-
return gapClasses[gap];
|
|
1510
|
-
}
|
|
1511
|
-
function Grid({
|
|
1512
|
-
items,
|
|
1513
|
-
renderItem,
|
|
1514
|
-
columns = { md: 2, lg: 3 },
|
|
1515
|
-
gap = "md",
|
|
1516
|
-
className = "",
|
|
1517
|
-
style
|
|
1518
|
-
}) {
|
|
1519
|
-
const gridColsClasses = buildGridColsClasses(columns);
|
|
1520
|
-
const gapClass = getGapClassName(gap);
|
|
1521
|
-
return /* @__PURE__ */ React37__default.createElement(
|
|
1522
|
-
"div",
|
|
1523
|
-
{
|
|
1524
|
-
className: `grid ${gridColsClasses} ${gapClass} ${className}`.trim(),
|
|
1525
|
-
style
|
|
1526
|
-
},
|
|
1527
|
-
items.map((item, index) => /* @__PURE__ */ React37__default.createElement("div", { key: item.id }, renderItem(item, index)))
|
|
1528
|
-
);
|
|
1529
|
-
}
|
|
1530
|
-
var Timeline = ({ items = [] }) => {
|
|
1531
|
-
if (!items || items.length === 0) {
|
|
1532
|
-
return null;
|
|
1533
|
-
}
|
|
1534
|
-
return /* @__PURE__ */ React37__default.createElement("div", { className: "relative" }, /* @__PURE__ */ React37__default.createElement("div", { className: "absolute left-4 top-0 bottom-0 w-0.5 bg-gray-200" }), items.map((item, index) => /* @__PURE__ */ React37__default.createElement("div", { key: index, className: "relative pl-12 pb-8" }, /* @__PURE__ */ React37__default.createElement("div", { className: "absolute left-0 w-8 h-8 rounded-full bg-blue-500 border-4 border-white shadow-md flex items-center justify-center" }, /* @__PURE__ */ React37__default.createElement("div", { className: "w-2 h-2 rounded-full bg-white" })), /* @__PURE__ */ React37__default.createElement("div", { className: "bg-white rounded-lg p-4 shadow-md" }, /* @__PURE__ */ React37__default.createElement("div", { className: "text-sm text-gray-500 mb-2" }, item.date), /* @__PURE__ */ React37__default.createElement("h4", { className: "text-lg font-semibold mb-2" }, item.title), /* @__PURE__ */ React37__default.createElement("p", { className: "text-gray-600" }, item.description)))));
|
|
1535
|
-
};
|
|
1536
|
-
var CollisionBalls = ({
|
|
1537
|
-
collisionBallsConfig: {
|
|
1538
|
-
balls,
|
|
1539
|
-
width,
|
|
1540
|
-
height
|
|
1541
|
-
}
|
|
1542
|
-
}) => {
|
|
1543
|
-
const canvasRef = useRef(null);
|
|
1544
|
-
const containerRef = useRef(null);
|
|
1545
|
-
const ballsRef = useRef([]);
|
|
1546
|
-
const [isShaking, setIsShaking] = useState(false);
|
|
1547
|
-
const [draggedBall, setDraggedBall] = useState(null);
|
|
1548
|
-
const [mousePos, setMousePos] = useState({ x: 0, y: 0 });
|
|
1549
|
-
const animationRef = useRef(null);
|
|
1550
|
-
const updateCanvasSize = () => {
|
|
1551
|
-
const container = containerRef.current;
|
|
1552
|
-
const canvas = canvasRef.current;
|
|
1553
|
-
if (!container || !canvas) {
|
|
1554
|
-
console.error("Container or canvas not found");
|
|
1555
|
-
return;
|
|
1556
|
-
}
|
|
1557
|
-
const containerWidth = container.clientWidth;
|
|
1558
|
-
const containerHeight = container.clientHeight;
|
|
1559
|
-
console.log("Container size:", { containerWidth, containerHeight });
|
|
1560
|
-
canvas.width = containerWidth;
|
|
1561
|
-
canvas.height = containerHeight;
|
|
1562
|
-
canvas.style.width = `${containerWidth}px`;
|
|
1563
|
-
canvas.style.height = `${containerHeight}px`;
|
|
1564
|
-
console.log("Canvas size updated:", {
|
|
1565
|
-
width: canvas.width,
|
|
1566
|
-
height: canvas.height,
|
|
1567
|
-
containerWidth,
|
|
1568
|
-
containerHeight
|
|
1569
|
-
});
|
|
1570
|
-
};
|
|
1571
|
-
const initBalls = () => {
|
|
1572
|
-
const canvas = canvasRef.current;
|
|
1573
|
-
if (!canvas) {
|
|
1574
|
-
console.error("Canvas not found during ball initialization");
|
|
1575
|
-
return [];
|
|
1576
|
-
}
|
|
1577
|
-
console.log("Initializing balls with canvas size:", {
|
|
1578
|
-
width: canvas.width,
|
|
1579
|
-
height: canvas.height
|
|
1580
|
-
});
|
|
1581
|
-
return balls.map((ballConfig) => ({
|
|
1582
|
-
x: Math.random() * (canvas.width - 100) + 50,
|
|
1583
|
-
y: Math.random() * (canvas.height - 100) + 50,
|
|
1584
|
-
vx: (Math.random() - 0.5) * 4,
|
|
1585
|
-
vy: (Math.random() - 0.5) * 4,
|
|
1586
|
-
radius: ballConfig.size,
|
|
1587
|
-
color: ballConfig.color,
|
|
1588
|
-
text: ballConfig.label,
|
|
1589
|
-
isDragging: false
|
|
1590
|
-
}));
|
|
1591
|
-
};
|
|
1592
|
-
useEffect(() => {
|
|
1593
|
-
const handleResize = () => {
|
|
1594
|
-
console.log("Window resized");
|
|
1595
|
-
updateCanvasSize();
|
|
1596
|
-
};
|
|
1597
|
-
if (typeof window !== "undefined") {
|
|
1598
|
-
window.addEventListener("resize", handleResize);
|
|
1599
|
-
updateCanvasSize();
|
|
1600
|
-
}
|
|
1601
|
-
return () => {
|
|
1602
|
-
if (typeof window !== "undefined") {
|
|
1603
|
-
window.removeEventListener("resize", handleResize);
|
|
1604
|
-
}
|
|
1605
|
-
};
|
|
1606
|
-
}, []);
|
|
1607
|
-
useEffect(() => {
|
|
1608
|
-
const canvas = canvasRef.current;
|
|
1609
|
-
if (!canvas) {
|
|
1610
|
-
console.error("Canvas element not found");
|
|
1611
|
-
return;
|
|
1612
|
-
}
|
|
1613
|
-
const ctx = canvas.getContext("2d");
|
|
1614
|
-
if (!ctx) {
|
|
1615
|
-
console.error("Failed to get canvas context");
|
|
1616
|
-
return;
|
|
1617
|
-
}
|
|
1618
|
-
console.log("Starting animation setup...");
|
|
1619
|
-
updateCanvasSize();
|
|
1620
|
-
ballsRef.current = initBalls();
|
|
1621
|
-
console.log("Balls initialized:", ballsRef.current);
|
|
1622
|
-
let lastTime = performance.now();
|
|
1623
|
-
let frameCount = 0;
|
|
1624
|
-
const animate = (currentTime) => {
|
|
1625
|
-
try {
|
|
1626
|
-
frameCount++;
|
|
1627
|
-
if (currentTime - lastTime >= 1e3) {
|
|
1628
|
-
console.log(`FPS: ${frameCount}`);
|
|
1629
|
-
frameCount = 0;
|
|
1630
|
-
lastTime = currentTime;
|
|
1631
|
-
}
|
|
1632
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
1633
|
-
ballsRef.current.forEach((ball) => {
|
|
1634
|
-
if (!ball.isDragging) {
|
|
1635
|
-
updatePosition(ball, canvas.width, canvas.height);
|
|
1636
|
-
}
|
|
1637
|
-
for (let i = 0; i < ballsRef.current.length; i++) {
|
|
1638
|
-
for (let j = i + 1; j < ballsRef.current.length; j++) {
|
|
1639
|
-
const ball1 = ballsRef.current[i];
|
|
1640
|
-
const ball2 = ballsRef.current[j];
|
|
1641
|
-
if (ball1 && ball2) {
|
|
1642
|
-
checkCollision(ball1, ball2);
|
|
1643
|
-
}
|
|
1644
|
-
}
|
|
1645
|
-
}
|
|
1646
|
-
draw(ctx, ball);
|
|
1647
|
-
});
|
|
1648
|
-
animationRef.current = requestAnimationFrame(animate);
|
|
1649
|
-
} catch (error) {
|
|
1650
|
-
console.error("Animation error:", error);
|
|
1651
|
-
}
|
|
1652
|
-
};
|
|
1653
|
-
console.log("Starting animation loop...");
|
|
1654
|
-
animationRef.current = requestAnimationFrame(animate);
|
|
1655
|
-
return () => {
|
|
1656
|
-
console.log("Cleaning up animation...");
|
|
1657
|
-
if (animationRef.current) {
|
|
1658
|
-
cancelAnimationFrame(animationRef.current);
|
|
1659
|
-
animationRef.current = null;
|
|
1660
|
-
}
|
|
1661
|
-
};
|
|
1662
|
-
}, []);
|
|
1663
|
-
const shake = () => {
|
|
1664
|
-
setIsShaking(true);
|
|
1665
|
-
ballsRef.current.forEach((ball) => {
|
|
1666
|
-
ball.vx = (Math.random() - 0.5) * 10;
|
|
1667
|
-
ball.vy = (Math.random() - 0.5) * 10;
|
|
1668
|
-
});
|
|
1669
|
-
setTimeout(() => setIsShaking(false), 200);
|
|
1670
|
-
};
|
|
1671
|
-
const slowdown = () => {
|
|
1672
|
-
setIsShaking(true);
|
|
1673
|
-
ballsRef.current.forEach((ball) => {
|
|
1674
|
-
ball.vx = ball.vx * 0.5;
|
|
1675
|
-
ball.vy = ball.vy * 0.5;
|
|
1676
|
-
});
|
|
1677
|
-
setTimeout(() => setIsShaking(false), 200);
|
|
1678
|
-
};
|
|
1679
|
-
const checkCollision = (ball1, ball2) => {
|
|
1680
|
-
const dx = ball2.x - ball1.x;
|
|
1681
|
-
const dy = ball2.y - ball1.y;
|
|
1682
|
-
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
1683
|
-
if (distance < ball1.radius + ball2.radius) {
|
|
1684
|
-
const angle = Math.atan2(dy, dx);
|
|
1685
|
-
const overlap = (ball1.radius + ball2.radius - distance) / 2;
|
|
1686
|
-
if (ball1.isDragging || ball2.isDragging) {
|
|
1687
|
-
const draggedBall2 = ball1.isDragging ? ball1 : ball2;
|
|
1688
|
-
const otherBall = ball1.isDragging ? ball2 : ball1;
|
|
1689
|
-
otherBall.x += (draggedBall2 === ball1 ? 1 : -1) * overlap * Math.cos(angle);
|
|
1690
|
-
otherBall.y += (draggedBall2 === ball1 ? 1 : -1) * overlap * Math.sin(angle);
|
|
1691
|
-
const pushForce = 2;
|
|
1692
|
-
otherBall.vx = (draggedBall2 === ball1 ? -1 : 1) * Math.cos(angle) * pushForce;
|
|
1693
|
-
otherBall.vy = (draggedBall2 === ball1 ? -1 : 1) * Math.sin(angle) * pushForce;
|
|
1694
|
-
return;
|
|
1695
|
-
}
|
|
1696
|
-
const sin = Math.sin(angle);
|
|
1697
|
-
const cos = Math.cos(angle);
|
|
1698
|
-
const vx1 = ball1.vx * cos + ball1.vy * sin;
|
|
1699
|
-
const vy1 = ball1.vy * cos - ball1.vx * sin;
|
|
1700
|
-
const vx2 = ball2.vx * cos + ball2.vy * sin;
|
|
1701
|
-
const vy2 = ball2.vy * cos - ball2.vx * sin;
|
|
1702
|
-
const newVx1 = vx2;
|
|
1703
|
-
const newVx2 = vx1;
|
|
1704
|
-
ball1.vx = newVx1 * cos - vy1 * sin;
|
|
1705
|
-
ball1.vy = vy1 * cos + newVx1 * sin;
|
|
1706
|
-
ball2.vx = newVx2 * cos - vy2 * sin;
|
|
1707
|
-
ball2.vy = vy2 * cos + newVx2 * sin;
|
|
1708
|
-
ball1.x -= overlap * Math.cos(angle);
|
|
1709
|
-
ball1.y -= overlap * Math.sin(angle);
|
|
1710
|
-
ball2.x += overlap * Math.cos(angle);
|
|
1711
|
-
ball2.y += overlap * Math.sin(angle);
|
|
1712
|
-
}
|
|
1713
|
-
};
|
|
1714
|
-
const updatePosition = (ball, width2, height2) => {
|
|
1715
|
-
const handleBoundaryCollision = (velocity, position, boundary, radius) => {
|
|
1716
|
-
let newVelocity = velocity;
|
|
1717
|
-
let newPosition = position;
|
|
1718
|
-
if (position - radius < 0) {
|
|
1719
|
-
newPosition = radius;
|
|
1720
|
-
newVelocity = Math.abs(velocity);
|
|
1721
|
-
} else if (position + radius > boundary) {
|
|
1722
|
-
newPosition = boundary - radius;
|
|
1723
|
-
newVelocity = -Math.abs(velocity);
|
|
1724
|
-
}
|
|
1725
|
-
return [newVelocity, newPosition];
|
|
1726
|
-
};
|
|
1727
|
-
const [newVx, newX] = handleBoundaryCollision(
|
|
1728
|
-
ball.vx,
|
|
1729
|
-
ball.x,
|
|
1730
|
-
width2,
|
|
1731
|
-
ball.radius
|
|
1732
|
-
);
|
|
1733
|
-
const [newVy, newY] = handleBoundaryCollision(
|
|
1734
|
-
ball.vy,
|
|
1735
|
-
ball.y,
|
|
1736
|
-
height2,
|
|
1737
|
-
ball.radius
|
|
1738
|
-
);
|
|
1739
|
-
ball.vx = newVx;
|
|
1740
|
-
ball.vy = newVy;
|
|
1741
|
-
ball.x = newX;
|
|
1742
|
-
ball.y = newY;
|
|
1743
|
-
};
|
|
1744
|
-
const draw = (ctx, ball) => {
|
|
1745
|
-
ctx.beginPath();
|
|
1746
|
-
ctx.arc(ball.x, ball.y, ball.radius, 0, Math.PI * 2);
|
|
1747
|
-
ctx.fillStyle = ball.color;
|
|
1748
|
-
ctx.fill();
|
|
1749
|
-
ctx.closePath();
|
|
1750
|
-
if (ball.text) {
|
|
1751
|
-
ctx.font = "14px Arial";
|
|
1752
|
-
ctx.fillStyle = "#fff";
|
|
1753
|
-
ctx.textAlign = "center";
|
|
1754
|
-
ctx.textBaseline = "middle";
|
|
1755
|
-
ctx.fillText(ball.text, ball.x, ball.y);
|
|
1756
|
-
}
|
|
1757
|
-
};
|
|
1758
|
-
const handleMouseDown = (event) => {
|
|
1759
|
-
const mousePos2 = getMousePos(event);
|
|
1760
|
-
const ball = ballsRef.current.find((b) => {
|
|
1761
|
-
const dx = b.x - mousePos2.x;
|
|
1762
|
-
const dy = b.y - mousePos2.y;
|
|
1763
|
-
return Math.sqrt(dx * dx + dy * dy) < b.radius;
|
|
1764
|
-
});
|
|
1765
|
-
if (ball) {
|
|
1766
|
-
ball.isDragging = true;
|
|
1767
|
-
setDraggedBall(ball);
|
|
1768
|
-
}
|
|
1769
|
-
};
|
|
1770
|
-
const handleMouseMove = (event) => {
|
|
1771
|
-
const mousePos2 = getMousePos(event);
|
|
1772
|
-
setMousePos(mousePos2);
|
|
1773
|
-
if (draggedBall) {
|
|
1774
|
-
draggedBall.x = mousePos2.x;
|
|
1775
|
-
draggedBall.y = mousePos2.y;
|
|
1776
|
-
draggedBall.vx = 0;
|
|
1777
|
-
draggedBall.vy = 0;
|
|
1778
|
-
}
|
|
1779
|
-
};
|
|
1780
|
-
const handleMouseUp = () => {
|
|
1781
|
-
if (draggedBall) {
|
|
1782
|
-
draggedBall.isDragging = false;
|
|
1783
|
-
setDraggedBall(null);
|
|
1784
|
-
}
|
|
1785
|
-
};
|
|
1786
|
-
const getMousePos = (event) => {
|
|
1787
|
-
const canvas = canvasRef.current;
|
|
1788
|
-
if (!canvas) return { x: 0, y: 0 };
|
|
1789
|
-
const rect = canvas.getBoundingClientRect();
|
|
1790
|
-
const scaleX = canvas.width / rect.width;
|
|
1791
|
-
const scaleY = canvas.height / rect.height;
|
|
1792
|
-
return {
|
|
1793
|
-
x: (event.clientX - rect.left) * scaleX,
|
|
1794
|
-
y: (event.clientY - rect.top) * scaleY
|
|
1795
|
-
};
|
|
1796
|
-
};
|
|
1797
|
-
return /* @__PURE__ */ React37__default.createElement("div", { style: { width: "100%", height: "100%", position: "relative", backgroundColor: "#f9fafb", borderRadius: "0.5rem" } }, /* @__PURE__ */ React37__default.createElement("div", { ref: containerRef, style: { width: "100%", height: "100%", position: "absolute", top: 0, left: 0 } }, /* @__PURE__ */ React37__default.createElement(
|
|
1798
|
-
"canvas",
|
|
1799
|
-
{
|
|
1800
|
-
ref: canvasRef,
|
|
1801
|
-
style: {
|
|
1802
|
-
width: "100%",
|
|
1803
|
-
height: "100%",
|
|
1804
|
-
display: "block"
|
|
1805
|
-
// 确保canvas正确显示
|
|
1806
|
-
},
|
|
1807
|
-
onMouseDown: handleMouseDown,
|
|
1808
|
-
onMouseMove: handleMouseMove,
|
|
1809
|
-
onMouseUp: handleMouseUp,
|
|
1810
|
-
onMouseLeave: handleMouseUp
|
|
1811
|
-
}
|
|
1812
|
-
)), /* @__PURE__ */ React37__default.createElement("div", { className: "absolute bottom-4 right-4 flex gap-2" }, /* @__PURE__ */ React37__default.createElement(
|
|
1813
|
-
"button",
|
|
1814
|
-
{
|
|
1815
|
-
onClick: shake,
|
|
1816
|
-
className: `px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors ${isShaking ? "animate-pulse" : ""}`
|
|
1817
|
-
},
|
|
1818
|
-
"\u6447\u4E00\u6447"
|
|
1819
|
-
), /* @__PURE__ */ React37__default.createElement(
|
|
1820
|
-
"button",
|
|
1821
|
-
{
|
|
1822
|
-
onClick: slowdown,
|
|
1823
|
-
className: `px-4 py-2 bg-green-500 text-white rounded-lg hover:bg-green-600 transition-colors ${isShaking ? "animate-pulse" : ""}`
|
|
1824
|
-
},
|
|
1825
|
-
"\u51CF\u901F"
|
|
1826
|
-
)));
|
|
1827
|
-
};
|
|
1828
|
-
function GenericOrderManager({
|
|
1829
|
-
operations,
|
|
1830
|
-
renderItem,
|
|
1831
|
-
className = "",
|
|
1832
|
-
title = "\u987A\u5E8F\u7BA1\u7406",
|
|
1833
|
-
description = "\u62D6\u62FD\u6216\u4F7F\u7528\u6309\u94AE\u8C03\u6574\u663E\u793A\u987A\u5E8F",
|
|
1834
|
-
onOrderChanged,
|
|
1835
|
-
emptyMessage = "\u6682\u65E0\u6570\u636E",
|
|
1836
|
-
loadingMessage = "\u52A0\u8F7D\u6570\u636E..."
|
|
1837
|
-
}) {
|
|
1838
|
-
const [items, setItems] = useState([]);
|
|
1839
|
-
const [originalOrder, setOriginalOrder] = useState([]);
|
|
1840
|
-
const [loading, setLoading] = useState(true);
|
|
1841
|
-
const [saving, setSaving] = useState(false);
|
|
1842
|
-
const [error, setError] = useState(null);
|
|
1843
|
-
const [hasChanges, setHasChanges] = useState(false);
|
|
1844
|
-
const [draggedItem, setDraggedItem] = useState(null);
|
|
1845
|
-
const loadItems = useCallback(async () => {
|
|
1846
|
-
try {
|
|
1847
|
-
setLoading(true);
|
|
1848
|
-
setError(null);
|
|
1849
|
-
const data = await operations.loadItems();
|
|
1850
|
-
setItems(data);
|
|
1851
|
-
setOriginalOrder([...data]);
|
|
1852
|
-
setHasChanges(false);
|
|
1853
|
-
} catch (err) {
|
|
1854
|
-
console.error("\u274C [\u901A\u7528\u6392\u5E8F] \u52A0\u8F7D\u6570\u636E\u9519\u8BEF:", err);
|
|
1855
|
-
setError(err instanceof Error ? err.message : "\u52A0\u8F7D\u6570\u636E\u5931\u8D25");
|
|
1856
|
-
} finally {
|
|
1857
|
-
setLoading(false);
|
|
1858
|
-
}
|
|
1859
|
-
}, [operations]);
|
|
1860
|
-
useEffect(() => {
|
|
1861
|
-
loadItems();
|
|
1862
|
-
}, [loadItems]);
|
|
1863
|
-
useEffect(() => {
|
|
1864
|
-
const hasOrderChanged = items.some(
|
|
1865
|
-
(item, index) => originalOrder[index]?.id !== item.id
|
|
1866
|
-
);
|
|
1867
|
-
setHasChanges(hasOrderChanged);
|
|
1868
|
-
}, [items, originalOrder]);
|
|
1869
|
-
const handleMoveUp = async (itemId) => {
|
|
1870
|
-
try {
|
|
1871
|
-
setError(null);
|
|
1872
|
-
const currentIndex = items.findIndex((item) => item.id === itemId);
|
|
1873
|
-
if (currentIndex === -1) {
|
|
1874
|
-
setError("\u9879\u76EE\u4E0D\u5B58\u5728");
|
|
1875
|
-
return;
|
|
1876
|
-
}
|
|
1877
|
-
if (currentIndex === 0) {
|
|
1878
|
-
setError("\u9879\u76EE\u5DF2\u7ECF\u5728\u6700\u524D\u9762\uFF0C\u65E0\u6CD5\u4E0A\u79FB");
|
|
1879
|
-
return;
|
|
1880
|
-
}
|
|
1881
|
-
await operations.moveItemUp(itemId);
|
|
1882
|
-
await loadItems();
|
|
1883
|
-
onOrderChanged?.();
|
|
1884
|
-
} catch (err) {
|
|
1885
|
-
console.error("\u274C [\u901A\u7528\u6392\u5E8F] \u4E0A\u79FB\u9879\u76EE\u9519\u8BEF:", err);
|
|
1886
|
-
setError(err instanceof Error ? err.message : "\u4E0A\u79FB\u5931\u8D25");
|
|
1887
|
-
}
|
|
1888
|
-
};
|
|
1889
|
-
const handleMoveDown = async (itemId) => {
|
|
1890
|
-
try {
|
|
1891
|
-
setError(null);
|
|
1892
|
-
const currentIndex = items.findIndex((item) => item.id === itemId);
|
|
1893
|
-
if (currentIndex === -1) {
|
|
1894
|
-
setError("\u9879\u76EE\u4E0D\u5B58\u5728");
|
|
1895
|
-
return;
|
|
1896
|
-
}
|
|
1897
|
-
if (currentIndex === items.length - 1) {
|
|
1898
|
-
setError("\u9879\u76EE\u5DF2\u7ECF\u5728\u6700\u540E\u9762\uFF0C\u65E0\u6CD5\u4E0B\u79FB");
|
|
1899
|
-
return;
|
|
1900
|
-
}
|
|
1901
|
-
await operations.moveItemDown(itemId);
|
|
1902
|
-
await loadItems();
|
|
1903
|
-
onOrderChanged?.();
|
|
1904
|
-
} catch (err) {
|
|
1905
|
-
console.error("\u274C [\u901A\u7528\u6392\u5E8F] \u4E0B\u79FB\u9879\u76EE\u9519\u8BEF:", err);
|
|
1906
|
-
setError(err instanceof Error ? err.message : "\u4E0B\u79FB\u5931\u8D25");
|
|
1907
|
-
}
|
|
1908
|
-
};
|
|
1909
|
-
const handleDragStart = (e, index) => {
|
|
1910
|
-
setDraggedItem(index);
|
|
1911
|
-
e.dataTransfer.effectAllowed = "move";
|
|
1912
|
-
};
|
|
1913
|
-
const handleDragOver = (e, _index) => {
|
|
1914
|
-
e.preventDefault();
|
|
1915
|
-
e.dataTransfer.dropEffect = "move";
|
|
1916
|
-
};
|
|
1917
|
-
const handleDrop = async (e, dropIndex) => {
|
|
1918
|
-
e.preventDefault();
|
|
1919
|
-
if (draggedItem === null || draggedItem === dropIndex) {
|
|
1920
|
-
setDraggedItem(null);
|
|
1921
|
-
return;
|
|
1922
|
-
}
|
|
1923
|
-
try {
|
|
1924
|
-
setError(null);
|
|
1925
|
-
const newItems = [...items];
|
|
1926
|
-
const draggedItemData = newItems[draggedItem];
|
|
1927
|
-
if (!draggedItemData) return;
|
|
1928
|
-
newItems.splice(draggedItem, 1);
|
|
1929
|
-
newItems.splice(dropIndex, 0, draggedItemData);
|
|
1930
|
-
const itemOrders = newItems.map((item, index) => ({
|
|
1931
|
-
id: item.id,
|
|
1932
|
-
order: index
|
|
1933
|
-
}));
|
|
1934
|
-
await operations.updateItemOrder(itemOrders);
|
|
1935
|
-
await loadItems();
|
|
1936
|
-
onOrderChanged?.();
|
|
1937
|
-
} catch (err) {
|
|
1938
|
-
console.error("\u274C [\u901A\u7528\u6392\u5E8F] \u62D6\u62FD\u6392\u5E8F\u9519\u8BEF:", err);
|
|
1939
|
-
setError(err instanceof Error ? err.message : "\u6392\u5E8F\u5931\u8D25");
|
|
1940
|
-
} finally {
|
|
1941
|
-
setDraggedItem(null);
|
|
1942
|
-
}
|
|
1943
|
-
};
|
|
1944
|
-
const handleSaveOrder = async () => {
|
|
1945
|
-
try {
|
|
1946
|
-
setSaving(true);
|
|
1947
|
-
setError(null);
|
|
1948
|
-
const itemOrders = items.map((item, index) => ({
|
|
1949
|
-
id: item.id,
|
|
1950
|
-
order: index
|
|
1951
|
-
}));
|
|
1952
|
-
await operations.updateItemOrder(itemOrders);
|
|
1953
|
-
setOriginalOrder([...items]);
|
|
1954
|
-
setHasChanges(false);
|
|
1955
|
-
onOrderChanged?.();
|
|
1956
|
-
} catch (err) {
|
|
1957
|
-
console.error("\u274C [\u901A\u7528\u6392\u5E8F] \u4FDD\u5B58\u987A\u5E8F\u9519\u8BEF:", err);
|
|
1958
|
-
setError(err instanceof Error ? err.message : "\u4FDD\u5B58\u5931\u8D25");
|
|
1959
|
-
await loadItems();
|
|
1960
|
-
} finally {
|
|
1961
|
-
setSaving(false);
|
|
1962
|
-
}
|
|
1963
|
-
};
|
|
1964
|
-
const handleResetOrder = () => {
|
|
1965
|
-
setItems([...originalOrder]);
|
|
1966
|
-
};
|
|
1967
|
-
if (loading) {
|
|
1968
|
-
return /* @__PURE__ */ React37__default.createElement("div", { className: cn("flex flex-col items-center justify-center p-12 text-gray-500", className) }, /* @__PURE__ */ React37__default.createElement("div", { className: "w-6 h-6 border-2 border-gray-200 border-t-blue-500 rounded-full animate-spin mb-2" }), /* @__PURE__ */ React37__default.createElement("span", null, loadingMessage));
|
|
1969
|
-
}
|
|
1970
|
-
return /* @__PURE__ */ React37__default.createElement("div", { className: cn("bg-white rounded-xl p-6 shadow-md border-2 border-gray-100", className) }, /* @__PURE__ */ React37__default.createElement("div", { className: "flex items-center justify-between mb-4 pb-3 border-b border-gray-100 sm:flex-row flex-col sm:items-center items-start gap-4" }, /* @__PURE__ */ React37__default.createElement("h3", { className: "m-0 text-gray-900 text-lg font-semibold" }, title), /* @__PURE__ */ React37__default.createElement("div", { className: "flex gap-3 w-full sm:w-auto" }, hasChanges && /* @__PURE__ */ React37__default.createElement(React37__default.Fragment, null, /* @__PURE__ */ React37__default.createElement(
|
|
1971
|
-
"button",
|
|
1972
|
-
{
|
|
1973
|
-
onClick: handleResetOrder,
|
|
1974
|
-
className: "flex items-center gap-2 bg-amber-500 hover:bg-amber-600 text-white px-4 py-2 rounded-lg font-medium transition-colors",
|
|
1975
|
-
title: "\u91CD\u7F6E\u4E3A\u539F\u59CB\u987A\u5E8F"
|
|
1976
|
-
},
|
|
1977
|
-
/* @__PURE__ */ React37__default.createElement(RotateCcw, { size: 16 }),
|
|
1978
|
-
"\u91CD\u7F6E"
|
|
1979
|
-
), /* @__PURE__ */ React37__default.createElement(
|
|
1980
|
-
"button",
|
|
1981
|
-
{
|
|
1982
|
-
onClick: handleSaveOrder,
|
|
1983
|
-
disabled: saving,
|
|
1984
|
-
className: "flex items-center gap-2 bg-blue-500 hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed text-white px-4 py-2 rounded-lg font-medium transition-colors",
|
|
1985
|
-
title: "\u4FDD\u5B58\u65B0\u987A\u5E8F"
|
|
1986
|
-
},
|
|
1987
|
-
/* @__PURE__ */ React37__default.createElement(Save, { size: 16 }),
|
|
1988
|
-
saving ? "\u4FDD\u5B58\u4E2D..." : "\u4FDD\u5B58\u987A\u5E8F"
|
|
1989
|
-
)))), error && /* @__PURE__ */ React37__default.createElement("div", { className: "flex items-center gap-2 bg-red-50 text-red-600 p-3 rounded-lg mb-4 border border-red-200" }, /* @__PURE__ */ React37__default.createElement(AlertCircle, { size: 16 }), /* @__PURE__ */ React37__default.createElement("span", null, error)), /* @__PURE__ */ React37__default.createElement("div", { className: "bg-slate-50 border border-slate-200 rounded-lg p-4 mb-6" }, /* @__PURE__ */ React37__default.createElement("p", { className: "m-0 mb-2 color-slate-500 text-sm" }, description), /* @__PURE__ */ React37__default.createElement("ul", { className: "m-0 pl-6 color-slate-500 text-sm list-disc" }, /* @__PURE__ */ React37__default.createElement("li", { className: "mb-1" }, "\u4F7F\u7528\u62D6\u62FD\uFF1A\u70B9\u51FB\u5E76\u62D6\u52A8 ", /* @__PURE__ */ React37__default.createElement(GripVertical, { size: 14, className: "inline-block align-middle text-gray-500" }), " \u56FE\u6807"), /* @__PURE__ */ React37__default.createElement("li", { className: "mb-1" }, "\u4F7F\u7528\u6309\u94AE\uFF1A\u70B9\u51FB ", /* @__PURE__ */ React37__default.createElement(ChevronUp, { size: 14, className: "inline-block align-middle text-gray-500" }), " \u6216 ", /* @__PURE__ */ React37__default.createElement(ChevronDown, { size: 14, className: "inline-block align-middle text-gray-500" }), " \u6309\u94AE"), /* @__PURE__ */ React37__default.createElement("li", null, '\u5B8C\u6210\u8C03\u6574\u540E\uFF0C\u70B9\u51FB"\u4FDD\u5B58\u987A\u5E8F"\u6309\u94AE\u4FDD\u5B58\u66F4\u6539'))), /* @__PURE__ */ React37__default.createElement("div", { className: "flex flex-col gap-3" }, items.map((item, index) => /* @__PURE__ */ React37__default.createElement(
|
|
1990
|
-
"div",
|
|
1991
|
-
{
|
|
1992
|
-
key: item.id,
|
|
1993
|
-
className: cn(
|
|
1994
|
-
"flex items-center gap-3 p-4 bg-gray-50 border-2 border-gray-200 rounded-lg transition-all hover:border-gray-300 hover:shadow-sm",
|
|
1995
|
-
draggedItem === index && "opacity-50 rotate-2 border-blue-500"
|
|
1996
|
-
),
|
|
1997
|
-
draggable: true,
|
|
1998
|
-
onDragStart: (e) => handleDragStart(e, index),
|
|
1999
|
-
onDragOver: (e) => handleDragOver(e),
|
|
2000
|
-
onDrop: (e) => handleDrop(e, index)
|
|
2001
|
-
},
|
|
2002
|
-
/* @__PURE__ */ React37__default.createElement("div", { className: "flex items-center cursor-grab active:cursor-grabbing text-gray-400 p-1 rounded hover:text-gray-500 hover:bg-gray-100 transition-colors" }, /* @__PURE__ */ React37__default.createElement(GripVertical, { size: 20 })),
|
|
2003
|
-
/* @__PURE__ */ React37__default.createElement("div", { className: "flex-1 min-w-0" }, renderItem(item, index, index === 0, index === items.length - 1)),
|
|
2004
|
-
/* @__PURE__ */ React37__default.createElement("div", { className: "flex items-center mx-3" }, /* @__PURE__ */ React37__default.createElement("span", { className: "flex items-center justify-center w-8 h-8 bg-blue-500 text-white text-sm font-semibold rounded-full sm:w-8 sm:h-8 w-7 h-7 sm:text-sm text-xs" }, "#", index + 1)),
|
|
2005
|
-
/* @__PURE__ */ React37__default.createElement("div", { className: "flex flex-col gap-1 sm:flex-col flex-row" }, /* @__PURE__ */ React37__default.createElement(
|
|
2006
|
-
"button",
|
|
2007
|
-
{
|
|
2008
|
-
onClick: () => handleMoveUp(item.id),
|
|
2009
|
-
disabled: index === 0,
|
|
2010
|
-
className: "flex items-center justify-center w-8 h-8 p-0 border border-gray-300 bg-white text-gray-500 rounded cursor-pointer transition-all hover:bg-gray-100 hover:border-gray-400 hover:text-gray-700 disabled:opacity-40 disabled:cursor-not-allowed disabled:bg-gray-50 sm:w-8 sm:h-8 w-7 h-7",
|
|
2011
|
-
title: "\u4E0A\u79FB"
|
|
2012
|
-
},
|
|
2013
|
-
/* @__PURE__ */ React37__default.createElement(ChevronUp, { size: 18 })
|
|
2014
|
-
), /* @__PURE__ */ React37__default.createElement(
|
|
2015
|
-
"button",
|
|
2016
|
-
{
|
|
2017
|
-
onClick: () => handleMoveDown(item.id),
|
|
2018
|
-
disabled: index === items.length - 1,
|
|
2019
|
-
className: "flex items-center justify-center w-8 h-8 p-0 border border-gray-300 bg-white text-gray-500 rounded cursor-pointer transition-all hover:bg-gray-100 hover:border-gray-400 hover:text-gray-700 disabled:opacity-40 disabled:cursor-not-allowed disabled:bg-gray-50 sm:w-8 sm:h-8 w-7 h-7",
|
|
2020
|
-
title: "\u4E0B\u79FB"
|
|
2021
|
-
},
|
|
2022
|
-
/* @__PURE__ */ React37__default.createElement(ChevronDown, { size: 18 })
|
|
2023
|
-
))
|
|
2024
|
-
))), items.length === 0 && /* @__PURE__ */ React37__default.createElement("div", { className: "text-center p-12 text-gray-400 italic" }, /* @__PURE__ */ React37__default.createElement("p", { className: "m-0" }, emptyMessage)));
|
|
2025
|
-
}
|
|
2026
|
-
var BackButton = ({ href, className = "" }) => {
|
|
2027
|
-
const router = useRouter();
|
|
2028
|
-
const handleClick = () => {
|
|
2029
|
-
if (href) {
|
|
2030
|
-
router.push(href);
|
|
2031
|
-
} else {
|
|
2032
|
-
router.back();
|
|
2033
|
-
}
|
|
2034
|
-
};
|
|
2035
|
-
return /* @__PURE__ */ React37__default.createElement(
|
|
2036
|
-
"button",
|
|
2037
|
-
{
|
|
2038
|
-
onClick: handleClick,
|
|
2039
|
-
className: cn(
|
|
2040
|
-
"inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors",
|
|
2041
|
-
className
|
|
2042
|
-
)
|
|
2043
|
-
},
|
|
2044
|
-
/* @__PURE__ */ React37__default.createElement(
|
|
2045
|
-
"svg",
|
|
2046
|
-
{
|
|
2047
|
-
className: "w-5 h-5 mr-2",
|
|
2048
|
-
fill: "none",
|
|
2049
|
-
stroke: "currentColor",
|
|
2050
|
-
viewBox: "0 0 24 24"
|
|
2051
|
-
},
|
|
2052
|
-
/* @__PURE__ */ React37__default.createElement(
|
|
2053
|
-
"path",
|
|
2054
|
-
{
|
|
2055
|
-
strokeLinecap: "round",
|
|
2056
|
-
strokeLinejoin: "round",
|
|
2057
|
-
strokeWidth: 2,
|
|
2058
|
-
d: "M10 19l-7-7m0 0l7-7m-7 7h18"
|
|
2059
|
-
}
|
|
2060
|
-
)
|
|
2061
|
-
),
|
|
2062
|
-
"\u8FD4\u56DE"
|
|
2063
|
-
);
|
|
2064
|
-
};
|
|
2065
|
-
function getColorValue(bgClass) {
|
|
2066
|
-
const colorMap = {
|
|
2067
|
-
"bg-blue-500": "#3b82f6",
|
|
2068
|
-
"bg-green-500": "#10b981",
|
|
2069
|
-
"bg-red-500": "#ef4444",
|
|
2070
|
-
"bg-purple-500": "#8b5cf6",
|
|
2071
|
-
"bg-slate-500": "#64748b",
|
|
2072
|
-
"bg-emerald-500": "#10b981",
|
|
2073
|
-
"bg-orange-500": "#f97316"
|
|
2074
|
-
};
|
|
2075
|
-
return colorMap[bgClass] || "#3b82f6";
|
|
2076
|
-
}
|
|
2077
|
-
function FilterButtonGroup({
|
|
2078
|
-
label,
|
|
2079
|
-
value,
|
|
2080
|
-
options,
|
|
2081
|
-
onChange,
|
|
2082
|
-
className
|
|
2083
|
-
}) {
|
|
2084
|
-
return /* @__PURE__ */ React37__default.createElement("div", { className: cn("space-y-4", className) }, /* @__PURE__ */ React37__default.createElement("h3", { className: "text-lg font-semibold text-gray-800" }, label), /* @__PURE__ */ React37__default.createElement("div", { className: "flex gap-3" }, options.map((option) => {
|
|
2085
|
-
const isActive = value === option.value;
|
|
2086
|
-
return /* @__PURE__ */ React37__default.createElement(
|
|
2087
|
-
"button",
|
|
2088
|
-
{
|
|
2089
|
-
key: option.value,
|
|
2090
|
-
onClick: () => onChange(option.value),
|
|
2091
|
-
style: isActive ? { backgroundColor: getColorValue(option.activeColor.bg) } : void 0,
|
|
2092
|
-
className: cn(
|
|
2093
|
-
"flex-1 h-12 rounded-lg font-medium text-sm transition-all duration-200 ease-out focus:outline-none focus:ring-2 focus:ring-opacity-50 border",
|
|
2094
|
-
isActive ? "text-white border-transparent shadow-md focus:ring-white" : "bg-white text-gray-700 border-gray-200 shadow-sm hover:bg-gray-50 hover:border-gray-300 hover:shadow focus:ring-blue-300"
|
|
2095
|
-
)
|
|
2096
|
-
},
|
|
2097
|
-
/* @__PURE__ */ React37__default.createElement("div", { className: "flex items-center justify-center space-x-2" }, /* @__PURE__ */ React37__default.createElement("span", { className: "text-lg" }, option.icon), /* @__PURE__ */ React37__default.createElement("span", null, option.label), option.showCount && option.count !== void 0 && /* @__PURE__ */ React37__default.createElement("span", { className: cn(
|
|
2098
|
-
"text-xs font-semibold px-2 py-0.5 rounded-full min-w-[1.25rem] text-center",
|
|
2099
|
-
isActive ? "bg-white/20 text-white" : "bg-gray-100 text-gray-600"
|
|
2100
|
-
) }, option.count))
|
|
2101
|
-
);
|
|
2102
|
-
})));
|
|
2103
|
-
}
|
|
2104
|
-
function SearchResultHint({ searchQuery, resultCount, className }) {
|
|
2105
|
-
if (!searchQuery) return null;
|
|
2106
|
-
return /* @__PURE__ */ React37__default.createElement("div", { className: cn("mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg", className) }, /* @__PURE__ */ React37__default.createElement("p", { className: "text-sm text-blue-700" }, '\u641C\u7D22 "', /* @__PURE__ */ React37__default.createElement("span", { className: "font-medium" }, searchQuery), '" \u627E\u5230 ', resultCount, " \u4E2A\u7ED3\u679C"));
|
|
2107
|
-
}
|
|
2108
681
|
var themeStyles = {
|
|
2109
682
|
light: "",
|
|
2110
683
|
dark: "bg-[#222] text-[#eee] border-[#444]",
|
|
@@ -2127,7 +700,7 @@ var ProfileModal = ({
|
|
|
2127
700
|
}) => {
|
|
2128
701
|
const renderSocialLinks = () => {
|
|
2129
702
|
if (!data.socialLinks || data.socialLinks.length === 0) return null;
|
|
2130
|
-
return /* @__PURE__ */
|
|
703
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "flex gap-3 mt-2" }, data.socialLinks.map((link, index) => /* @__PURE__ */ React12.createElement(
|
|
2131
704
|
"a",
|
|
2132
705
|
{
|
|
2133
706
|
key: index,
|
|
@@ -2146,15 +719,15 @@ var ProfileModal = ({
|
|
|
2146
719
|
}
|
|
2147
720
|
}
|
|
2148
721
|
},
|
|
2149
|
-
link.icon ? /* @__PURE__ */
|
|
722
|
+
link.icon ? /* @__PURE__ */ React12.createElement("span", { className: "text-base" }, link.icon) : /* @__PURE__ */ React12.createElement("span", { className: "text-[10px] font-semibold" }, link.type)
|
|
2150
723
|
)));
|
|
2151
724
|
};
|
|
2152
725
|
const renderContacts = () => {
|
|
2153
726
|
if (!data.contacts || Object.keys(data.contacts).length === 0) return null;
|
|
2154
|
-
return /* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ React12.createElement("div", { className: cn(
|
|
2155
728
|
"mt-4 border-t pt-4",
|
|
2156
729
|
themeName === "dark" ? "border-gray-800" : "border-gray-100"
|
|
2157
|
-
) }, Object.entries(data.contacts).map(([type, value], index) => /* @__PURE__ */
|
|
730
|
+
) }, Object.entries(data.contacts).map(([type, value], index) => /* @__PURE__ */ React12.createElement(
|
|
2158
731
|
"div",
|
|
2159
732
|
{
|
|
2160
733
|
key: index,
|
|
@@ -2164,35 +737,35 @@ var ProfileModal = ({
|
|
|
2164
737
|
),
|
|
2165
738
|
onClick: () => onContactClick && onContactClick(type, value)
|
|
2166
739
|
},
|
|
2167
|
-
/* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ React12.createElement("span", { className: cn(
|
|
2168
741
|
"font-medium w-[70px] shrink-0",
|
|
2169
742
|
themeName === "dark" ? "text-gray-400" : "text-gray-500"
|
|
2170
743
|
) }, type, ":"),
|
|
2171
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ React12.createElement("span", { className: themeName === "dark" ? "text-gray-200" : "text-gray-800" }, value)
|
|
2172
745
|
)));
|
|
2173
746
|
};
|
|
2174
|
-
return /* @__PURE__ */
|
|
747
|
+
return /* @__PURE__ */ React12.createElement(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose() }, /* @__PURE__ */ React12.createElement(DialogContent, { className: cn(
|
|
2175
748
|
"sm:max-w-[500px] p-0 overflow-hidden border-none shadow-2xl",
|
|
2176
749
|
themeStyles[themeName] || "",
|
|
2177
750
|
className
|
|
2178
|
-
) }, /* @__PURE__ */
|
|
751
|
+
) }, /* @__PURE__ */ React12.createElement("div", { className: "p-6" }, /* @__PURE__ */ React12.createElement("div", { className: "flex gap-5 mb-5" }, showAvatar && /* @__PURE__ */ React12.createElement(
|
|
2179
752
|
"div",
|
|
2180
753
|
{
|
|
2181
754
|
className: "shrink-0",
|
|
2182
755
|
onClick: onAvatarClick,
|
|
2183
756
|
style: { cursor: onAvatarClick ? "pointer" : "default" }
|
|
2184
757
|
},
|
|
2185
|
-
/* @__PURE__ */
|
|
2186
|
-
), /* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ React12.createElement(Avatar, { className: "border-2 border-primary/10 shadow-sm", style: { width: avatarSize, height: avatarSize } }, data.avatar && /* @__PURE__ */ React12.createElement(AvatarImage, { src: data.avatar, alt: data.name, className: "object-cover" }), /* @__PURE__ */ React12.createElement(AvatarFallback, { className: "text-xl" }, data.name.substring(0, 2).toUpperCase()))
|
|
759
|
+
), /* @__PURE__ */ React12.createElement("div", { className: "flex-1 min-w-0 flex flex-col justify-center" }, /* @__PURE__ */ React12.createElement("h2", { className: cn(
|
|
2187
760
|
"text-2xl font-bold m-0 mb-1",
|
|
2188
761
|
themeName === "dark" ? "text-white" : "text-gray-900"
|
|
2189
|
-
) }, data.name), data.title && /* @__PURE__ */
|
|
762
|
+
) }, data.name), data.title && /* @__PURE__ */ React12.createElement("div", { className: cn(
|
|
2190
763
|
"text-sm mb-2",
|
|
2191
764
|
themeName === "dark" ? "text-gray-400" : "text-gray-500"
|
|
2192
|
-
) }, data.title), showSocial && renderSocialLinks())), showBio && data.bio && /* @__PURE__ */
|
|
765
|
+
) }, data.title), showSocial && renderSocialLinks())), showBio && data.bio && /* @__PURE__ */ React12.createElement("div", { className: cn(
|
|
2193
766
|
"mb-5 leading-relaxed text-sm",
|
|
2194
767
|
themeName === "dark" ? "text-gray-300" : "text-gray-600"
|
|
2195
|
-
) }, /* @__PURE__ */
|
|
768
|
+
) }, /* @__PURE__ */ React12.createElement("p", null, data.bio)), showContacts && renderContacts(), data.customContent && /* @__PURE__ */ React12.createElement("div", { className: "mt-5" }, data.customContent))));
|
|
2196
769
|
};
|
|
2197
770
|
var ProfileModal_default = ProfileModal;
|
|
2198
771
|
var BadgeList = ({
|
|
@@ -2200,13 +773,13 @@ var BadgeList = ({
|
|
|
2200
773
|
className = ""
|
|
2201
774
|
}) => {
|
|
2202
775
|
if (!badges || badges.length === 0) return null;
|
|
2203
|
-
return /* @__PURE__ */
|
|
776
|
+
return /* @__PURE__ */ React12.createElement("div", { className: cn("flex flex-wrap gap-2 mt-4", className) }, badges.map((badge, index) => /* @__PURE__ */ React12.createElement(
|
|
2204
777
|
Badge,
|
|
2205
778
|
{
|
|
2206
779
|
key: index,
|
|
2207
780
|
variant: badge.type === "default" ? "default" : badge.type
|
|
2208
781
|
},
|
|
2209
|
-
badge.icon && /* @__PURE__ */
|
|
782
|
+
badge.icon && /* @__PURE__ */ React12.createElement("span", { className: "mr-1" }, badge.icon),
|
|
2210
783
|
badge.label
|
|
2211
784
|
)));
|
|
2212
785
|
};
|
|
@@ -2257,7 +830,7 @@ var exampleProfileData = {
|
|
|
2257
830
|
{ label: "\u7C89\u4E1D", value: 1024 },
|
|
2258
831
|
{ label: "\u8BC4\u5206", value: "4.9" }
|
|
2259
832
|
],
|
|
2260
|
-
customContent: /* @__PURE__ */
|
|
833
|
+
customContent: /* @__PURE__ */ React12.createElement("div", { className: "mt-5 border-t border-gray-100 pt-4" }, /* @__PURE__ */ React12.createElement("h3", { className: "text-sm font-semibold mb-2" }, "\u4E13\u4E1A\u6280\u80FD"), /* @__PURE__ */ React12.createElement("p", { className: "text-sm text-gray-600 leading-relaxed" }, "\u7CBE\u901AReact\u3001Vue\u3001Angular\u7B49\u524D\u7AEF\u6846\u67B6\uFF0C\u719F\u6089TypeScript\u3001JavaScript\u3001CSS3\u3001HTML5\u7B49\u524D\u7AEF\u6280\u672F\u3002 \u6709\u4E30\u5BCC\u7684\u5927\u578B\u9879\u76EE\u5F00\u53D1\u7ECF\u9A8C\uFF0C\u80FD\u72EC\u7ACB\u8D1F\u8D23\u524D\u7AEF\u67B6\u6784\u8BBE\u8BA1\u3002"))
|
|
2261
834
|
};
|
|
2262
835
|
var ProfileButton = ({
|
|
2263
836
|
data = exampleProfileData,
|
|
@@ -2277,7 +850,7 @@ var ProfileButton = ({
|
|
|
2277
850
|
window.open(`tel:${value}`);
|
|
2278
851
|
}
|
|
2279
852
|
};
|
|
2280
|
-
return /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(
|
|
2281
854
|
Button,
|
|
2282
855
|
{
|
|
2283
856
|
variant,
|
|
@@ -2286,7 +859,7 @@ var ProfileButton = ({
|
|
|
2286
859
|
className
|
|
2287
860
|
},
|
|
2288
861
|
buttonText
|
|
2289
|
-
), /* @__PURE__ */
|
|
862
|
+
), /* @__PURE__ */ React12.createElement(
|
|
2290
863
|
ProfileModal_default,
|
|
2291
864
|
{
|
|
2292
865
|
isOpen: isModalOpen,
|
|
@@ -2297,8 +870,8 @@ var ProfileButton = ({
|
|
|
2297
870
|
onSocialLinkClick: (url) => window.open(url, "_blank")
|
|
2298
871
|
},
|
|
2299
872
|
data.customContent,
|
|
2300
|
-
data.badges && /* @__PURE__ */
|
|
2301
|
-
data.stats && /* @__PURE__ */
|
|
873
|
+
data.badges && /* @__PURE__ */ React12.createElement(BadgeList, { badges: data.badges }),
|
|
874
|
+
data.stats && /* @__PURE__ */ React12.createElement(StatList, { stats: data.stats })
|
|
2302
875
|
));
|
|
2303
876
|
};
|
|
2304
877
|
var AutoOpenModal = ({
|
|
@@ -2328,7 +901,7 @@ var AutoOpenModal = ({
|
|
|
2328
901
|
window.open(`tel:${value}`);
|
|
2329
902
|
}
|
|
2330
903
|
};
|
|
2331
|
-
return /* @__PURE__ */
|
|
904
|
+
return /* @__PURE__ */ React12.createElement(
|
|
2332
905
|
ProfileModal_default,
|
|
2333
906
|
{
|
|
2334
907
|
isOpen: isModalOpen,
|
|
@@ -2338,8 +911,8 @@ var AutoOpenModal = ({
|
|
|
2338
911
|
onContactClick: handleContactClick,
|
|
2339
912
|
onSocialLinkClick: (url) => window.open(url, "_blank")
|
|
2340
913
|
},
|
|
2341
|
-
data.badges && /* @__PURE__ */
|
|
2342
|
-
data.stats && /* @__PURE__ */
|
|
914
|
+
data.badges && /* @__PURE__ */ React12.createElement(BadgeList, { badges: data.badges }),
|
|
915
|
+
data.stats && /* @__PURE__ */ React12.createElement(StatList, { stats: data.stats })
|
|
2343
916
|
);
|
|
2344
917
|
};
|
|
2345
918
|
var sizeMap = {
|
|
@@ -2363,7 +936,7 @@ var EnhancedAvatar = ({
|
|
|
2363
936
|
}) => {
|
|
2364
937
|
const sizeClass = typeof size === "string" ? sizeMap[size] : "";
|
|
2365
938
|
const customSizeStyle = typeof size === "number" ? { width: size, height: size } : {};
|
|
2366
|
-
return /* @__PURE__ */
|
|
939
|
+
return /* @__PURE__ */ React12.createElement("div", { className: cn("relative inline-block", className), onClick }, /* @__PURE__ */ React12.createElement(Avatar, { className: cn(sizeClass, onClick && "cursor-pointer hover:ring-2 hover:ring-blue-500 transition-all"), style: customSizeStyle }, src && /* @__PURE__ */ React12.createElement(AvatarImage, { src, alt: name || "Avatar", className: "object-cover" }), /* @__PURE__ */ React12.createElement(AvatarFallback, { className: "bg-primary/10 text-primary-foreground" }, name ? name.substring(0, 2).toUpperCase() : "??")), mood && /* @__PURE__ */ React12.createElement(
|
|
2367
940
|
"div",
|
|
2368
941
|
{
|
|
2369
942
|
className: cn(
|
|
@@ -2372,13 +945,13 @@ var EnhancedAvatar = ({
|
|
|
2372
945
|
typeof size === "number" ? size > 60 ? "h-4 w-4" : "h-3 w-3" : size === "large" ? "h-4 w-4" : "h-3 w-3"
|
|
2373
946
|
)
|
|
2374
947
|
}
|
|
2375
|
-
), statusText && /* @__PURE__ */
|
|
948
|
+
), statusText && /* @__PURE__ */ React12.createElement("div", { className: "absolute -bottom-6 left-1/2 transform -translate-x-1/2 whitespace-nowrap" }, /* @__PURE__ */ React12.createElement("span", { className: "text-xs text-muted-foreground" }, statusText)));
|
|
2376
949
|
};
|
|
2377
950
|
var About = ({
|
|
2378
951
|
timelineConfig,
|
|
2379
952
|
collisionBallsConfig
|
|
2380
953
|
}) => {
|
|
2381
|
-
return /* @__PURE__ */
|
|
954
|
+
return /* @__PURE__ */ React12.createElement("section", { id: "about", className: "py-16 bg-white" }, /* @__PURE__ */ React12.createElement("div", { className: "container mx-auto px-4" }, /* @__PURE__ */ React12.createElement("h2", { className: "text-3xl font-bold text-center mb-12" }, "\u5173\u4E8E\u6211"), /* @__PURE__ */ React12.createElement("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-12" }, /* @__PURE__ */ React12.createElement("div", { className: "bg-white rounded-lg shadow-lg p-6" }, /* @__PURE__ */ React12.createElement("h3", { className: "text-2xl font-semibold mb-6" }, "\u4E2A\u4EBA\u7ECF\u5386"), /* @__PURE__ */ React12.createElement(Timeline, { items: timelineConfig.items })), /* @__PURE__ */ React12.createElement("div", { className: "bg-white rounded-lg shadow-lg p-6" }, /* @__PURE__ */ React12.createElement("h3", { className: "text-2xl font-semibold mb-6" }, "\u6280\u80FD\u5C55\u793A"), /* @__PURE__ */ React12.createElement("div", { style: { height: "400px", position: "relative" } }, /* @__PURE__ */ React12.createElement(CollisionBalls, { collisionBallsConfig }))))));
|
|
2382
955
|
};
|
|
2383
956
|
var About_default = About;
|
|
2384
957
|
var Contact = () => {
|
|
@@ -2410,7 +983,7 @@ var Contact = () => {
|
|
|
2410
983
|
setIsSubmitting(false);
|
|
2411
984
|
}
|
|
2412
985
|
};
|
|
2413
|
-
return /* @__PURE__ */
|
|
986
|
+
return /* @__PURE__ */ React12.createElement("section", { id: "contact", className: "py-16 bg-gray-50" }, /* @__PURE__ */ React12.createElement("div", { className: "max-w-4xl mx-auto px-4 sm:px-6 lg:px-8" }, /* @__PURE__ */ React12.createElement("div", { className: "text-center mb-12" }, /* @__PURE__ */ React12.createElement("h2", { className: "text-3xl font-bold text-gray-900 sm:text-4xl" }, "\u8054\u7CFB\u6211"), /* @__PURE__ */ React12.createElement("p", { className: "mt-4 text-lg text-gray-600" }, "\u6709\u4EFB\u4F55\u95EE\u9898\u6216\u5EFA\u8BAE\uFF1F\u8BF7\u968F\u65F6\u8054\u7CFB\u6211")), /* @__PURE__ */ React12.createElement("div", { className: "bg-white rounded-lg shadow-xl p-6 sm:p-8" }, /* @__PURE__ */ React12.createElement("form", { onSubmit: handleSubmit, className: "space-y-6" }, /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("label", { htmlFor: "name", className: "block text-sm font-medium text-gray-700" }, "\u59D3\u540D"), /* @__PURE__ */ React12.createElement(
|
|
2414
987
|
"input",
|
|
2415
988
|
{
|
|
2416
989
|
type: "text",
|
|
@@ -2422,7 +995,7 @@ var Contact = () => {
|
|
|
2422
995
|
className: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
|
|
2423
996
|
placeholder: "\u8BF7\u8F93\u5165\u60A8\u7684\u59D3\u540D"
|
|
2424
997
|
}
|
|
2425
|
-
)), /* @__PURE__ */
|
|
998
|
+
)), /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700" }, "\u90AE\u7BB1"), /* @__PURE__ */ React12.createElement(
|
|
2426
999
|
"input",
|
|
2427
1000
|
{
|
|
2428
1001
|
type: "email",
|
|
@@ -2434,7 +1007,7 @@ var Contact = () => {
|
|
|
2434
1007
|
className: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
|
|
2435
1008
|
placeholder: "\u8BF7\u8F93\u5165\u60A8\u7684\u90AE\u7BB1"
|
|
2436
1009
|
}
|
|
2437
|
-
)), /* @__PURE__ */
|
|
1010
|
+
)), /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("label", { htmlFor: "message", className: "block text-sm font-medium text-gray-700" }, "\u6D88\u606F"), /* @__PURE__ */ React12.createElement(
|
|
2438
1011
|
"textarea",
|
|
2439
1012
|
{
|
|
2440
1013
|
name: "message",
|
|
@@ -2446,7 +1019,7 @@ var Contact = () => {
|
|
|
2446
1019
|
className: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
|
|
2447
1020
|
placeholder: "\u8BF7\u8F93\u5165\u60A8\u7684\u6D88\u606F"
|
|
2448
1021
|
}
|
|
2449
|
-
)), /* @__PURE__ */
|
|
1022
|
+
)), /* @__PURE__ */ React12.createElement("div", { className: "flex items-center justify-end" }, /* @__PURE__ */ React12.createElement(
|
|
2450
1023
|
"button",
|
|
2451
1024
|
{
|
|
2452
1025
|
type: "submit",
|
|
@@ -2455,7 +1028,7 @@ var Contact = () => {
|
|
|
2455
1028
|
${isSubmitting ? "bg-blue-400 cursor-not-allowed" : "bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"}`
|
|
2456
1029
|
},
|
|
2457
1030
|
isSubmitting ? "\u53D1\u9001\u4E2D..." : "\u53D1\u9001\u6D88\u606F"
|
|
2458
|
-
)), submitStatus === "success" && /* @__PURE__ */
|
|
1031
|
+
)), submitStatus === "success" && /* @__PURE__ */ React12.createElement("div", { className: "rounded-md bg-green-50 p-4" }, /* @__PURE__ */ React12.createElement("div", { className: "flex" }, /* @__PURE__ */ React12.createElement("div", { className: "flex-shrink-0" }, /* @__PURE__ */ React12.createElement("svg", { className: "h-5 w-5 text-green-400", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React12.createElement("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }))), /* @__PURE__ */ React12.createElement("div", { className: "ml-3" }, /* @__PURE__ */ React12.createElement("p", { className: "text-sm font-medium text-green-800" }, "\u6D88\u606F\u5DF2\u6210\u529F\u53D1\u9001\uFF01")))), submitStatus === "error" && /* @__PURE__ */ React12.createElement("div", { className: "rounded-md bg-red-50 p-4" }, /* @__PURE__ */ React12.createElement("div", { className: "flex" }, /* @__PURE__ */ React12.createElement("div", { className: "flex-shrink-0" }, /* @__PURE__ */ React12.createElement("svg", { className: "h-5 w-5 text-red-400", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React12.createElement("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }))), /* @__PURE__ */ React12.createElement("div", { className: "ml-3" }, /* @__PURE__ */ React12.createElement("p", { className: "text-sm font-medium text-red-800" }, "\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")))))), /* @__PURE__ */ React12.createElement("div", { className: "mt-12 grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3" }, /* @__PURE__ */ React12.createElement("div", { className: "bg-white rounded-lg shadow-lg p-6 text-center" }, /* @__PURE__ */ React12.createElement("div", { className: "text-blue-600 mb-4" }, /* @__PURE__ */ React12.createElement("svg", { className: "h-8 w-8 mx-auto", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }))), /* @__PURE__ */ React12.createElement("h3", { className: "text-lg font-medium text-gray-900" }, "\u90AE\u7BB1"), /* @__PURE__ */ React12.createElement("p", { className: "mt-2 text-gray-600" }, "your.email@example.com")), /* @__PURE__ */ React12.createElement("div", { className: "bg-white rounded-lg shadow-lg p-6 text-center" }, /* @__PURE__ */ React12.createElement("div", { className: "text-blue-600 mb-4" }, /* @__PURE__ */ React12.createElement("svg", { className: "h-8 w-8 mx-auto", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }))), /* @__PURE__ */ React12.createElement("h3", { className: "text-lg font-medium text-gray-900" }, "\u7535\u8BDD"), /* @__PURE__ */ React12.createElement("p", { className: "mt-2 text-gray-600" }, "+86 123 4567 8900")), /* @__PURE__ */ React12.createElement("div", { className: "bg-white rounded-lg shadow-lg p-6 text-center" }, /* @__PURE__ */ React12.createElement("div", { className: "text-blue-600 mb-4" }, /* @__PURE__ */ React12.createElement("svg", { className: "h-8 w-8 mx-auto", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }))), /* @__PURE__ */ React12.createElement("h3", { className: "text-lg font-medium text-gray-900" }, "\u5730\u5740"), /* @__PURE__ */ React12.createElement("p", { className: "mt-2 text-gray-600" }, "\u4E2D\u56FD\uFF0C\u5317\u4EAC")))));
|
|
2459
1032
|
};
|
|
2460
1033
|
var Contact_default = Contact;
|
|
2461
1034
|
var Home = ({ homeConfig, className }) => {
|
|
@@ -2475,13 +1048,13 @@ var Home = ({ homeConfig, className }) => {
|
|
|
2475
1048
|
setCurrentIndex(0);
|
|
2476
1049
|
};
|
|
2477
1050
|
}, [currentIndex, title]);
|
|
2478
|
-
return /* @__PURE__ */
|
|
1051
|
+
return /* @__PURE__ */ React12.createElement(
|
|
2479
1052
|
"section",
|
|
2480
1053
|
{
|
|
2481
1054
|
id: "home",
|
|
2482
1055
|
className: cn("min-h-screen flex items-center justify-center py-16 bg-gradient-to-b from-white to-gray-50", className)
|
|
2483
1056
|
},
|
|
2484
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ React12.createElement("div", { className: "container mx-auto px-4" }, /* @__PURE__ */ React12.createElement("div", { className: "flex flex-col md:flex-row items-center gap-12" }, /* @__PURE__ */ React12.createElement("div", { className: "flex-1 text-center md:text-left" }, /* @__PURE__ */ React12.createElement("h1", { className: "text-4xl md:text-6xl font-bold mb-6 text-gray-900" }, /* @__PURE__ */ React12.createElement("span", { className: "inline-block" }, displayText), /* @__PURE__ */ React12.createElement("span", { className: "animate-pulse ml-1 text-blue-500" }, "|")), /* @__PURE__ */ React12.createElement("p", { className: "text-xl md:text-2xl text-gray-600 mb-8" }, subtitle), /* @__PURE__ */ React12.createElement("div", { className: "flex flex-wrap gap-4 justify-center md:justify-start" }, buttons.map((button) => /* @__PURE__ */ React12.createElement(
|
|
2485
1058
|
"a",
|
|
2486
1059
|
{
|
|
2487
1060
|
key: button.link,
|
|
@@ -2489,7 +1062,7 @@ var Home = ({ homeConfig, className }) => {
|
|
|
2489
1062
|
className: "px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-all duration-300 shadow-md hover:shadow-lg font-medium"
|
|
2490
1063
|
},
|
|
2491
1064
|
button.text
|
|
2492
|
-
)))), /* @__PURE__ */
|
|
1065
|
+
)))), /* @__PURE__ */ React12.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React12.createElement("div", { className: "relative group" }, /* @__PURE__ */ React12.createElement("div", { className: "absolute -inset-1 bg-gradient-to-r from-blue-600 to-purple-600 rounded-lg blur opacity-25 group-hover:opacity-50 transition duration-1000 group-hover:duration-200" }), /* @__PURE__ */ React12.createElement(
|
|
2493
1066
|
"img",
|
|
2494
1067
|
{
|
|
2495
1068
|
src: imageSrc,
|
|
@@ -2524,13 +1097,13 @@ var ExperimentCard = ({
|
|
|
2524
1097
|
return dateString;
|
|
2525
1098
|
}
|
|
2526
1099
|
};
|
|
2527
|
-
return /* @__PURE__ */
|
|
1100
|
+
return /* @__PURE__ */ React12.createElement(Link, { href, className: cn("block group", className) }, /* @__PURE__ */ React12.createElement("div", { className: "w-full h-full bg-white rounded-2xl overflow-hidden shadow-md hover:shadow-2xl transition-all duration-300 transform group-hover:-translate-y-1 border border-gray-100 hover:border-gray-200" }, /* @__PURE__ */ React12.createElement("div", { className: "p-6" }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-start justify-between mb-4" }, /* @__PURE__ */ React12.createElement("h3", { className: "text-xl font-semibold text-gray-900 flex-1 pr-4 leading-tight" }, title), /* @__PURE__ */ React12.createElement("div", { className: "flex flex-col gap-2 flex-shrink-0" }, /* @__PURE__ */ React12.createElement("span", { className: cn(
|
|
2528
1101
|
"px-3 py-1.5 text-xs font-medium rounded-full shadow-sm",
|
|
2529
1102
|
category === "utility" ? "bg-gradient-to-r from-green-50 to-green-100 text-green-700 border border-green-200" : "bg-gradient-to-r from-purple-50 to-purple-100 text-purple-700 border border-purple-200"
|
|
2530
|
-
) }, category === "utility" ? "\u{1F527} \u5B9E\u7528\u5DE5\u5177" : "\u{1F3AE} \u4F11\u95F2\u5A31\u4E50"), /* @__PURE__ */
|
|
1103
|
+
) }, category === "utility" ? "\u{1F527} \u5B9E\u7528\u5DE5\u5177" : "\u{1F3AE} \u4F11\u95F2\u5A31\u4E50"), /* @__PURE__ */ React12.createElement("span", { className: cn(
|
|
2531
1104
|
"px-3 py-1.5 text-xs font-medium rounded-full shadow-sm border",
|
|
2532
1105
|
isCompleted ? "bg-gradient-to-r from-emerald-50 to-emerald-100 text-emerald-700 border border-emerald-200" : "bg-gradient-to-r from-orange-50 to-orange-100 text-orange-700 border border-orange-200"
|
|
2533
|
-
) }, isCompleted ? "\u2705 \u5DF2\u5B8C\u6210" : "\u{1F6A7} \u8FDB\u884C\u4E2D"))), /* @__PURE__ */
|
|
1106
|
+
) }, isCompleted ? "\u2705 \u5DF2\u5B8C\u6210" : "\u{1F6A7} \u8FDB\u884C\u4E2D"))), /* @__PURE__ */ React12.createElement("p", { className: "text-gray-600 mb-4" }, description), updatedAt && /* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-1 mb-3 text-xs text-gray-500" }, /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" }, /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" })), /* @__PURE__ */ React12.createElement("span", null, "\u66F4\u65B0\u4E8E: ", formatDate(updatedAt)), createdAt && createdAt !== updatedAt && /* @__PURE__ */ React12.createElement("span", { className: "ml-2 text-gray-400" }, "\u521B\u5EFA\u4E8E: ", formatDate(createdAt))), /* @__PURE__ */ React12.createElement("div", { className: "flex flex-wrap gap-2" }, tags.map((tag) => /* @__PURE__ */ React12.createElement(
|
|
2534
1107
|
"span",
|
|
2535
1108
|
{
|
|
2536
1109
|
key: tag,
|
|
@@ -2552,7 +1125,7 @@ var ProjectCarousel = ({ projects, className }) => {
|
|
|
2552
1125
|
(prevIndex) => prevIndex === 0 ? projects.length - 1 : prevIndex - 1
|
|
2553
1126
|
);
|
|
2554
1127
|
};
|
|
2555
|
-
return /* @__PURE__ */
|
|
1128
|
+
return /* @__PURE__ */ React12.createElement("section", { id: "projects", className: cn("py-16 bg-gray-50", className) }, /* @__PURE__ */ React12.createElement("div", { className: "container mx-auto px-4" }, /* @__PURE__ */ React12.createElement("h2", { className: "text-3xl font-bold text-center mb-12 text-gray-900" }, "\u9879\u76EE\u5C55\u793A"), /* @__PURE__ */ React12.createElement("div", { className: "relative max-w-4xl mx-auto" }, /* @__PURE__ */ React12.createElement("div", { className: "relative h-[400px] overflow-hidden rounded-lg shadow-xl" }, projects.map((project, index) => /* @__PURE__ */ React12.createElement(
|
|
2556
1129
|
"div",
|
|
2557
1130
|
{
|
|
2558
1131
|
key: project.id,
|
|
@@ -2561,7 +1134,7 @@ var ProjectCarousel = ({ projects, className }) => {
|
|
|
2561
1134
|
index === currentIndex ? "translate-x-0 opacity-100" : index < currentIndex ? "-translate-x-full opacity-0" : "translate-x-full opacity-0"
|
|
2562
1135
|
)
|
|
2563
1136
|
},
|
|
2564
|
-
/* @__PURE__ */
|
|
1137
|
+
/* @__PURE__ */ React12.createElement(
|
|
2565
1138
|
ExperimentCard,
|
|
2566
1139
|
{
|
|
2567
1140
|
href: project.link || "#",
|
|
@@ -2571,13 +1144,13 @@ var ProjectCarousel = ({ projects, className }) => {
|
|
|
2571
1144
|
category: "utility"
|
|
2572
1145
|
}
|
|
2573
1146
|
)
|
|
2574
|
-
))), /* @__PURE__ */
|
|
1147
|
+
))), /* @__PURE__ */ React12.createElement(
|
|
2575
1148
|
"button",
|
|
2576
1149
|
{
|
|
2577
1150
|
onClick: prevSlide,
|
|
2578
1151
|
className: "absolute left-4 top-1/2 -translate-y-1/2 p-2 rounded-full bg-white/80 hover:bg-white shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-all z-10"
|
|
2579
1152
|
},
|
|
2580
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ React12.createElement(
|
|
2581
1154
|
"svg",
|
|
2582
1155
|
{
|
|
2583
1156
|
className: "w-6 h-6 text-gray-600",
|
|
@@ -2585,7 +1158,7 @@ var ProjectCarousel = ({ projects, className }) => {
|
|
|
2585
1158
|
stroke: "currentColor",
|
|
2586
1159
|
viewBox: "0 0 24 24"
|
|
2587
1160
|
},
|
|
2588
|
-
/* @__PURE__ */
|
|
1161
|
+
/* @__PURE__ */ React12.createElement(
|
|
2589
1162
|
"path",
|
|
2590
1163
|
{
|
|
2591
1164
|
strokeLinecap: "round",
|
|
@@ -2595,13 +1168,13 @@ var ProjectCarousel = ({ projects, className }) => {
|
|
|
2595
1168
|
}
|
|
2596
1169
|
)
|
|
2597
1170
|
)
|
|
2598
|
-
), /* @__PURE__ */
|
|
1171
|
+
), /* @__PURE__ */ React12.createElement(
|
|
2599
1172
|
"button",
|
|
2600
1173
|
{
|
|
2601
1174
|
onClick: nextSlide,
|
|
2602
1175
|
className: "absolute right-4 top-1/2 -translate-y-1/2 p-2 rounded-full bg-white/80 hover:bg-white shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-all z-10"
|
|
2603
1176
|
},
|
|
2604
|
-
/* @__PURE__ */
|
|
1177
|
+
/* @__PURE__ */ React12.createElement(
|
|
2605
1178
|
"svg",
|
|
2606
1179
|
{
|
|
2607
1180
|
className: "w-6 h-6 text-gray-600",
|
|
@@ -2609,7 +1182,7 @@ var ProjectCarousel = ({ projects, className }) => {
|
|
|
2609
1182
|
stroke: "currentColor",
|
|
2610
1183
|
viewBox: "0 0 24 24"
|
|
2611
1184
|
},
|
|
2612
|
-
/* @__PURE__ */
|
|
1185
|
+
/* @__PURE__ */ React12.createElement(
|
|
2613
1186
|
"path",
|
|
2614
1187
|
{
|
|
2615
1188
|
strokeLinecap: "round",
|
|
@@ -2619,7 +1192,7 @@ var ProjectCarousel = ({ projects, className }) => {
|
|
|
2619
1192
|
}
|
|
2620
1193
|
)
|
|
2621
1194
|
)
|
|
2622
|
-
), /* @__PURE__ */
|
|
1195
|
+
), /* @__PURE__ */ React12.createElement("div", { className: "absolute bottom-4 left-1/2 transform -translate-x-1/2 flex space-x-2 z-10" }, projects.map((_, index) => /* @__PURE__ */ React12.createElement(
|
|
2623
1196
|
"button",
|
|
2624
1197
|
{
|
|
2625
1198
|
key: index,
|
|
@@ -2652,7 +1225,7 @@ var NavigationItemComponent = ({
|
|
|
2652
1225
|
const stateClasses = isActive ? "bg-blue-500 text-white shadow-lg" : item.isExternal ? "text-gray-700 hover:bg-purple-50 hover:text-purple-600 border border-purple-200" : "text-gray-700 hover:bg-blue-50 hover:text-blue-600";
|
|
2653
1226
|
return `${baseClasses} ${directionClasses} ${stateClasses}`;
|
|
2654
1227
|
};
|
|
2655
|
-
return /* @__PURE__ */
|
|
1228
|
+
return /* @__PURE__ */ React12.createElement(
|
|
2656
1229
|
"a",
|
|
2657
1230
|
{
|
|
2658
1231
|
href: item.href,
|
|
@@ -2661,9 +1234,9 @@ var NavigationItemComponent = ({
|
|
|
2661
1234
|
rel: item.isExternal ? "noopener noreferrer" : void 0,
|
|
2662
1235
|
className: getItemClasses()
|
|
2663
1236
|
},
|
|
2664
|
-
item.icon && /* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2666
|
-
item.isExternal && /* @__PURE__ */
|
|
1237
|
+
item.icon && /* @__PURE__ */ React12.createElement("span", { className: "flex-shrink-0" }, item.icon),
|
|
1238
|
+
/* @__PURE__ */ React12.createElement("span", { className: `font-medium ${direction === "vertical" ? "text-sm" : "text-xs"}` }, item.label),
|
|
1239
|
+
item.isExternal && /* @__PURE__ */ React12.createElement(
|
|
2667
1240
|
"svg",
|
|
2668
1241
|
{
|
|
2669
1242
|
className: "w-3 h-3 opacity-60 group-hover:opacity-100 transition-opacity",
|
|
@@ -2671,7 +1244,7 @@ var NavigationItemComponent = ({
|
|
|
2671
1244
|
stroke: "currentColor",
|
|
2672
1245
|
viewBox: "0 0 24 24"
|
|
2673
1246
|
},
|
|
2674
|
-
/* @__PURE__ */
|
|
1247
|
+
/* @__PURE__ */ React12.createElement(
|
|
2675
1248
|
"path",
|
|
2676
1249
|
{
|
|
2677
1250
|
strokeLinecap: "round",
|
|
@@ -2681,7 +1254,7 @@ var NavigationItemComponent = ({
|
|
|
2681
1254
|
}
|
|
2682
1255
|
)
|
|
2683
1256
|
),
|
|
2684
|
-
direction === "vertical" && isActive && /* @__PURE__ */
|
|
1257
|
+
direction === "vertical" && isActive && /* @__PURE__ */ React12.createElement("div", { className: "absolute left-1 top-1/2 transform -translate-y-1/2 w-1 h-6 bg-white rounded-full" })
|
|
2685
1258
|
);
|
|
2686
1259
|
};
|
|
2687
1260
|
var NavigationItem_default = NavigationItemComponent;
|
|
@@ -2741,14 +1314,14 @@ var Navigation = ({
|
|
|
2741
1314
|
onItemClick?.(item);
|
|
2742
1315
|
};
|
|
2743
1316
|
if (!isOpen) return null;
|
|
2744
|
-
return /* @__PURE__ */
|
|
1317
|
+
return /* @__PURE__ */ React12.createElement("nav", { className: `${getContainerClasses()} ${className}` }, /* @__PURE__ */ React12.createElement("div", { className: getContentClasses() }, logo && /* @__PURE__ */ React12.createElement("div", { className: "flex items-center justify-center mb-4" }, /* @__PURE__ */ React12.createElement(
|
|
2745
1318
|
"img",
|
|
2746
1319
|
{
|
|
2747
1320
|
src: logo.src,
|
|
2748
1321
|
alt: logo.alt || "Logo",
|
|
2749
1322
|
className: "h-8 w-auto"
|
|
2750
1323
|
}
|
|
2751
|
-
)), direction === "vertical" && /* @__PURE__ */
|
|
1324
|
+
)), direction === "vertical" && /* @__PURE__ */ React12.createElement("div", { className: "h-12 flex-shrink-0" }), /* @__PURE__ */ React12.createElement("div", { className: getItemsListClasses() }, items.map((item) => /* @__PURE__ */ React12.createElement(
|
|
2752
1325
|
NavigationItem_default,
|
|
2753
1326
|
{
|
|
2754
1327
|
key: item.id,
|
|
@@ -2757,14 +1330,14 @@ var Navigation = ({
|
|
|
2757
1330
|
isActive: activeItemId === item.id,
|
|
2758
1331
|
onClick: handleItemClick
|
|
2759
1332
|
}
|
|
2760
|
-
))), avatar && direction === "vertical" && /* @__PURE__ */
|
|
1333
|
+
))), avatar && direction === "vertical" && /* @__PURE__ */ React12.createElement("div", { className: "flex items-center justify-center mt-auto pt-4" }, /* @__PURE__ */ React12.createElement(
|
|
2761
1334
|
"img",
|
|
2762
1335
|
{
|
|
2763
1336
|
src: avatar.src,
|
|
2764
1337
|
alt: avatar.alt || "Avatar",
|
|
2765
1338
|
className: "w-10 h-10 rounded-full border-2 border-gray-200"
|
|
2766
1339
|
}
|
|
2767
|
-
)), avatar && direction === "horizontal" && /* @__PURE__ */
|
|
1340
|
+
)), avatar && direction === "horizontal" && /* @__PURE__ */ React12.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ React12.createElement(
|
|
2768
1341
|
"img",
|
|
2769
1342
|
{
|
|
2770
1343
|
src: avatar.src,
|
|
@@ -2793,7 +1366,7 @@ var NavigationToggle = ({
|
|
|
2793
1366
|
return "top-4 left-4";
|
|
2794
1367
|
}
|
|
2795
1368
|
};
|
|
2796
|
-
return /* @__PURE__ */
|
|
1369
|
+
return /* @__PURE__ */ React12.createElement(
|
|
2797
1370
|
"button",
|
|
2798
1371
|
{
|
|
2799
1372
|
onClick,
|
|
@@ -2809,7 +1382,7 @@ var NavigationToggle = ({
|
|
|
2809
1382
|
`,
|
|
2810
1383
|
"aria-label": isOpen ? "\u5173\u95ED\u5BFC\u822A\u680F" : "\u6253\u5F00\u5BFC\u822A\u680F"
|
|
2811
1384
|
},
|
|
2812
|
-
/* @__PURE__ */
|
|
1385
|
+
/* @__PURE__ */ React12.createElement("div", { className: "w-5 h-5 flex flex-col justify-center items-center" }, /* @__PURE__ */ React12.createElement(
|
|
2813
1386
|
"span",
|
|
2814
1387
|
{
|
|
2815
1388
|
className: `
|
|
@@ -2818,7 +1391,7 @@ var NavigationToggle = ({
|
|
|
2818
1391
|
${isOpen ? "rotate-45 translate-y-0.5" : ""}
|
|
2819
1392
|
`
|
|
2820
1393
|
}
|
|
2821
|
-
), /* @__PURE__ */
|
|
1394
|
+
), /* @__PURE__ */ React12.createElement(
|
|
2822
1395
|
"span",
|
|
2823
1396
|
{
|
|
2824
1397
|
className: `
|
|
@@ -2827,7 +1400,7 @@ var NavigationToggle = ({
|
|
|
2827
1400
|
${isOpen ? "opacity-0 scale-0" : "opacity-100 scale-100"}
|
|
2828
1401
|
`
|
|
2829
1402
|
}
|
|
2830
|
-
), /* @__PURE__ */
|
|
1403
|
+
), /* @__PURE__ */ React12.createElement(
|
|
2831
1404
|
"span",
|
|
2832
1405
|
{
|
|
2833
1406
|
className: `
|
|
@@ -2976,7 +1549,7 @@ var FloatingMenu = ({
|
|
|
2976
1549
|
}, [mounted]);
|
|
2977
1550
|
if (!mounted) return null;
|
|
2978
1551
|
return createPortal(
|
|
2979
|
-
/* @__PURE__ */
|
|
1552
|
+
/* @__PURE__ */ React12.createElement(
|
|
2980
1553
|
"div",
|
|
2981
1554
|
{
|
|
2982
1555
|
ref: containerRef,
|
|
@@ -2987,7 +1560,7 @@ var FloatingMenu = ({
|
|
|
2987
1560
|
zIndex
|
|
2988
1561
|
}
|
|
2989
1562
|
},
|
|
2990
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ React12.createElement(
|
|
2991
1564
|
"div",
|
|
2992
1565
|
{
|
|
2993
1566
|
className: `
|
|
@@ -3005,7 +1578,7 @@ var FloatingMenu = ({
|
|
|
3005
1578
|
},
|
|
3006
1579
|
trigger
|
|
3007
1580
|
),
|
|
3008
|
-
isMenuOpen && /* @__PURE__ */
|
|
1581
|
+
isMenuOpen && /* @__PURE__ */ React12.createElement(
|
|
3009
1582
|
"div",
|
|
3010
1583
|
{
|
|
3011
1584
|
className: `
|
|
@@ -3052,40 +1625,632 @@ var FloatingMenuExample = () => {
|
|
|
3052
1625
|
const handleMenuItemClick = (id) => {
|
|
3053
1626
|
console.log(`\u70B9\u51FB\u4E86\u83DC\u5355\u9879: ${id}`);
|
|
3054
1627
|
};
|
|
3055
|
-
return /* @__PURE__ */
|
|
1628
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "w-full h-screen bg-gray-100 relative p-8" }, /* @__PURE__ */ React12.createElement("div", { className: "max-w-2xl mx-auto bg-white rounded-2xl shadow-sm p-8 mt-12" }, /* @__PURE__ */ React12.createElement("h1", { className: "text-3xl font-bold mb-4 text-gray-900" }, "\u60AC\u6D6E\u83DC\u5355\u793A\u4F8B"), /* @__PURE__ */ React12.createElement("p", { className: "text-gray-600 leading-relaxed mb-6" }, "\u8FD9\u662F\u4E00\u4E2A\u53EF\u62D6\u62FD\u7684\u60AC\u6D6E\u83DC\u5355\u7EC4\u4EF6\u793A\u4F8B\u3002\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u62D6\u52A8\u4E0B\u65B9\u7684 ", /* @__PURE__ */ React12.createElement("span", { className: "font-bold text-blue-600" }, "\u84DD\u8272\u6309\u94AE"), " \u5230\u5904\u79FB\u52A8\u3002"), /* @__PURE__ */ React12.createElement("div", { className: "bg-blue-50 border-l-4 border-blue-500 p-4 mb-6" }, /* @__PURE__ */ React12.createElement("p", { className: "text-sm text-blue-700" }, /* @__PURE__ */ React12.createElement("strong", null, "\u667A\u80FD\u5B9A\u4F4D\uFF1A"), " \u83DC\u5355\u4F1A\u6839\u636E\u6309\u94AE\u5728\u5C4F\u5E55\u4E0A\u7684\u4F4D\u7F6E\u81EA\u52A8\u8C03\u6574\u5F39\u51FA\u65B9\u5411\uFF08\u5411\u5DE6\u6216\u5411\u53F3\uFF09\u3002"))), /* @__PURE__ */ React12.createElement(
|
|
3056
1629
|
FloatingMenu_default,
|
|
3057
1630
|
{
|
|
3058
|
-
trigger: /* @__PURE__ */
|
|
3059
|
-
menu: /* @__PURE__ */
|
|
1631
|
+
trigger: /* @__PURE__ */ React12.createElement("div", { className: "w-12 h-12 bg-blue-600 rounded-full flex items-center justify-center text-white shadow-lg cursor-pointer" }, /* @__PURE__ */ React12.createElement("span", { className: "text-xl" }, "\u2795")),
|
|
1632
|
+
menu: /* @__PURE__ */ React12.createElement("div", { className: "w-48 bg-white rounded-xl shadow-xl border border-gray-100 overflow-hidden" }, /* @__PURE__ */ React12.createElement("div", { className: "px-4 py-3 border-b border-gray-100" }, /* @__PURE__ */ React12.createElement("h3", { className: "text-sm font-bold text-gray-900" }, "\u5FEB\u6377\u83DC\u5355")), /* @__PURE__ */ React12.createElement("ul", { className: "py-1" }, menuItems.map((item) => /* @__PURE__ */ React12.createElement(
|
|
3060
1633
|
"li",
|
|
3061
1634
|
{
|
|
3062
1635
|
key: item.id,
|
|
3063
1636
|
className: "flex items-center gap-3 px-4 py-2.5 hover:bg-blue-50 text-gray-700 hover:text-blue-600 cursor-pointer transition-colors text-sm",
|
|
3064
1637
|
onClick: () => handleMenuItemClick(item.id)
|
|
3065
1638
|
},
|
|
3066
|
-
/* @__PURE__ */
|
|
3067
|
-
/* @__PURE__ */
|
|
1639
|
+
/* @__PURE__ */ React12.createElement("span", { className: "text-lg" }, item.icon),
|
|
1640
|
+
/* @__PURE__ */ React12.createElement("span", { className: "font-medium" }, item.label)
|
|
3068
1641
|
)))),
|
|
3069
1642
|
initialPosition: { x: 100, y: 100 }
|
|
3070
1643
|
}
|
|
3071
|
-
), windowWidth > 0 && /* @__PURE__ */
|
|
1644
|
+
), windowWidth > 0 && /* @__PURE__ */ React12.createElement(
|
|
3072
1645
|
FloatingMenu_default,
|
|
3073
1646
|
{
|
|
3074
|
-
trigger: /* @__PURE__ */
|
|
3075
|
-
menu: /* @__PURE__ */
|
|
1647
|
+
trigger: /* @__PURE__ */ React12.createElement("div", { className: "w-12 h-12 bg-purple-600 rounded-full flex items-center justify-center text-white shadow-lg cursor-pointer" }, /* @__PURE__ */ React12.createElement("span", { className: "text-xl" }, "\u{1F50D}")),
|
|
1648
|
+
menu: /* @__PURE__ */ React12.createElement("div", { className: "w-64 bg-white rounded-xl shadow-xl border border-gray-100 p-4" }, /* @__PURE__ */ React12.createElement("h3", { className: "text-sm font-bold text-gray-900 mb-3" }, "\u5FEB\u901F\u641C\u7D22"), /* @__PURE__ */ React12.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React12.createElement(
|
|
3076
1649
|
"input",
|
|
3077
1650
|
{
|
|
3078
1651
|
type: "text",
|
|
3079
1652
|
placeholder: "\u8F93\u5165\u5173\u952E\u5B57...",
|
|
3080
1653
|
className: "w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent outline-none"
|
|
3081
1654
|
}
|
|
3082
|
-
), /* @__PURE__ */
|
|
1655
|
+
), /* @__PURE__ */ React12.createElement("button", { className: "w-full bg-purple-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-purple-700 transition-colors" }, "\u641C\u7D22"))),
|
|
3083
1656
|
initialPosition: { x: windowWidth - 100, y: 100 }
|
|
3084
1657
|
}
|
|
3085
1658
|
));
|
|
3086
1659
|
};
|
|
3087
1660
|
var FloatingMenuExample_default = FloatingMenuExample;
|
|
3088
1661
|
|
|
3089
|
-
|
|
1662
|
+
// src/testField/utils/index.ts
|
|
1663
|
+
function filterExperiments(experiments, config) {
|
|
1664
|
+
const {
|
|
1665
|
+
viewMode = "all",
|
|
1666
|
+
searchQuery = "",
|
|
1667
|
+
completionFilter = "all"
|
|
1668
|
+
} = config;
|
|
1669
|
+
return experiments.filter((experiment) => {
|
|
1670
|
+
const matchesViewMode = viewMode === "all" || experiment.category === viewMode;
|
|
1671
|
+
const query = searchQuery.toLowerCase();
|
|
1672
|
+
const matchesSearch = !query || experiment.title.toLowerCase().includes(query) || experiment.description.toLowerCase().includes(query) || experiment.tags.some((tag) => tag.toLowerCase().includes(query));
|
|
1673
|
+
const matchesCompletion = (() => {
|
|
1674
|
+
switch (completionFilter) {
|
|
1675
|
+
case "completed":
|
|
1676
|
+
return experiment.isCompleted === true;
|
|
1677
|
+
case "incomplete":
|
|
1678
|
+
return experiment.isCompleted !== true;
|
|
1679
|
+
case "all":
|
|
1680
|
+
default:
|
|
1681
|
+
return true;
|
|
1682
|
+
}
|
|
1683
|
+
})();
|
|
1684
|
+
return matchesViewMode && matchesSearch && matchesCompletion;
|
|
1685
|
+
});
|
|
1686
|
+
}
|
|
1687
|
+
function sortExperiments(experiments, sortBy = "title", sortOrder = "asc") {
|
|
1688
|
+
return [...experiments].sort((a, b) => {
|
|
1689
|
+
let comparison = 0;
|
|
1690
|
+
switch (sortBy) {
|
|
1691
|
+
case "title":
|
|
1692
|
+
comparison = a.title.localeCompare(b.title);
|
|
1693
|
+
break;
|
|
1694
|
+
case "category":
|
|
1695
|
+
comparison = a.category.localeCompare(b.category);
|
|
1696
|
+
break;
|
|
1697
|
+
case "completion":
|
|
1698
|
+
const aCompleted = a.isCompleted ? 1 : 0;
|
|
1699
|
+
const bCompleted = b.isCompleted ? 1 : 0;
|
|
1700
|
+
comparison = bCompleted - aCompleted;
|
|
1701
|
+
break;
|
|
1702
|
+
case "createdAt":
|
|
1703
|
+
if (!a.createdAt && !b.createdAt) {
|
|
1704
|
+
comparison = 0;
|
|
1705
|
+
} else if (!a.createdAt) {
|
|
1706
|
+
comparison = 1;
|
|
1707
|
+
} else if (!b.createdAt) {
|
|
1708
|
+
comparison = -1;
|
|
1709
|
+
} else {
|
|
1710
|
+
comparison = new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime();
|
|
1711
|
+
}
|
|
1712
|
+
break;
|
|
1713
|
+
case "updatedAt":
|
|
1714
|
+
if (!a.updatedAt && !b.updatedAt) {
|
|
1715
|
+
comparison = 0;
|
|
1716
|
+
} else if (!a.updatedAt) {
|
|
1717
|
+
comparison = 1;
|
|
1718
|
+
} else if (!b.updatedAt) {
|
|
1719
|
+
comparison = -1;
|
|
1720
|
+
} else {
|
|
1721
|
+
comparison = new Date(a.updatedAt).getTime() - new Date(b.updatedAt).getTime();
|
|
1722
|
+
}
|
|
1723
|
+
break;
|
|
1724
|
+
default:
|
|
1725
|
+
comparison = 0;
|
|
1726
|
+
}
|
|
1727
|
+
if (comparison === 0) {
|
|
1728
|
+
comparison = a.id.localeCompare(b.id);
|
|
1729
|
+
}
|
|
1730
|
+
return sortOrder === "asc" ? comparison : -comparison;
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
function getAllTags(experiments) {
|
|
1734
|
+
const allTags = experiments.flatMap((experiment) => experiment.tags);
|
|
1735
|
+
return Array.from(new Set(allTags)).sort();
|
|
1736
|
+
}
|
|
1737
|
+
function getExperimentCounts(experiments) {
|
|
1738
|
+
const counts = {
|
|
1739
|
+
all: experiments.length,
|
|
1740
|
+
utility: 0,
|
|
1741
|
+
leisure: 0,
|
|
1742
|
+
completed: 0,
|
|
1743
|
+
inProgress: 0
|
|
1744
|
+
};
|
|
1745
|
+
experiments.forEach((experiment) => {
|
|
1746
|
+
if (experiment.category === "utility") {
|
|
1747
|
+
counts.utility++;
|
|
1748
|
+
} else if (experiment.category === "leisure") {
|
|
1749
|
+
counts.leisure++;
|
|
1750
|
+
}
|
|
1751
|
+
if (experiment.isCompleted) {
|
|
1752
|
+
counts.completed++;
|
|
1753
|
+
} else {
|
|
1754
|
+
counts.inProgress++;
|
|
1755
|
+
}
|
|
1756
|
+
});
|
|
1757
|
+
return counts;
|
|
1758
|
+
}
|
|
1759
|
+
function validateExperiment(experiment) {
|
|
1760
|
+
return !!(experiment.id && experiment.title && experiment.description && experiment.path && experiment.category && Array.isArray(experiment.tags));
|
|
1761
|
+
}
|
|
1762
|
+
function getCategoryDisplayName(category) {
|
|
1763
|
+
switch (category) {
|
|
1764
|
+
case "utility":
|
|
1765
|
+
return "\u5B9E\u7528\u5DE5\u5177";
|
|
1766
|
+
case "leisure":
|
|
1767
|
+
return "\u4F11\u95F2\u5A31\u4E50";
|
|
1768
|
+
case "all":
|
|
1769
|
+
default:
|
|
1770
|
+
return "\u5168\u90E8";
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
function getCategoryColor(category) {
|
|
1774
|
+
switch (category) {
|
|
1775
|
+
case "utility":
|
|
1776
|
+
return "bg-blue-100 text-blue-800 border-blue-200";
|
|
1777
|
+
case "leisure":
|
|
1778
|
+
return "bg-purple-100 text-purple-800 border-purple-200";
|
|
1779
|
+
default:
|
|
1780
|
+
return "bg-gray-100 text-gray-800 border-gray-200";
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
function getCompletionFilterDisplayName(filter) {
|
|
1784
|
+
switch (filter) {
|
|
1785
|
+
case "completed":
|
|
1786
|
+
return "\u5DF2\u5B8C\u6210";
|
|
1787
|
+
case "incomplete":
|
|
1788
|
+
return "\u8FDB\u884C\u4E2D";
|
|
1789
|
+
case "all":
|
|
1790
|
+
default:
|
|
1791
|
+
return "\u5168\u90E8\u72B6\u6001";
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
function getCompletionStatusColor(isCompleted) {
|
|
1795
|
+
if (isCompleted) {
|
|
1796
|
+
return "bg-green-100 text-green-800 border-green-200";
|
|
1797
|
+
}
|
|
1798
|
+
return "bg-yellow-100 text-yellow-800 border-yellow-200";
|
|
1799
|
+
}
|
|
1800
|
+
function getCompletionStatusText(isCompleted) {
|
|
1801
|
+
return isCompleted ? "\u5DF2\u5B8C\u6210" : "\u8FDB\u884C\u4E2D";
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
// src/testField/components/CategoryFilter.tsx
|
|
1805
|
+
var CategoryFilter = ({
|
|
1806
|
+
viewMode,
|
|
1807
|
+
onViewModeChange,
|
|
1808
|
+
counts,
|
|
1809
|
+
className
|
|
1810
|
+
}) => {
|
|
1811
|
+
const options = [
|
|
1812
|
+
{
|
|
1813
|
+
value: "all",
|
|
1814
|
+
label: getCategoryDisplayName("all"),
|
|
1815
|
+
icon: "\u{1F4CA}",
|
|
1816
|
+
activeColor: {
|
|
1817
|
+
bg: "bg-blue-500",
|
|
1818
|
+
shadow: "shadow-blue-200"
|
|
1819
|
+
},
|
|
1820
|
+
showCount: false
|
|
1821
|
+
},
|
|
1822
|
+
{
|
|
1823
|
+
value: "utility",
|
|
1824
|
+
label: getCategoryDisplayName("utility"),
|
|
1825
|
+
icon: "\u{1F527}",
|
|
1826
|
+
activeColor: {
|
|
1827
|
+
bg: "bg-green-500",
|
|
1828
|
+
shadow: "shadow-green-200"
|
|
1829
|
+
},
|
|
1830
|
+
count: counts.utility,
|
|
1831
|
+
showCount: true
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
value: "leisure",
|
|
1835
|
+
label: getCategoryDisplayName("leisure"),
|
|
1836
|
+
icon: "\u{1F3AE}",
|
|
1837
|
+
activeColor: {
|
|
1838
|
+
bg: "bg-purple-500",
|
|
1839
|
+
shadow: "shadow-purple-200"
|
|
1840
|
+
},
|
|
1841
|
+
count: counts.leisure,
|
|
1842
|
+
showCount: true
|
|
1843
|
+
}
|
|
1844
|
+
];
|
|
1845
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1846
|
+
FilterButtonGroup,
|
|
1847
|
+
{
|
|
1848
|
+
label: "\u9879\u76EE\u7C7B\u522B",
|
|
1849
|
+
value: viewMode,
|
|
1850
|
+
options,
|
|
1851
|
+
onChange: onViewModeChange,
|
|
1852
|
+
className
|
|
1853
|
+
}
|
|
1854
|
+
);
|
|
1855
|
+
};
|
|
1856
|
+
var CompletionFilterComponent = ({
|
|
1857
|
+
completionFilter,
|
|
1858
|
+
onCompletionFilterChange,
|
|
1859
|
+
counts,
|
|
1860
|
+
className
|
|
1861
|
+
}) => {
|
|
1862
|
+
const options = [
|
|
1863
|
+
{
|
|
1864
|
+
value: "all",
|
|
1865
|
+
label: getCompletionFilterDisplayName("all"),
|
|
1866
|
+
icon: "\u{1F4CA}",
|
|
1867
|
+
activeColor: {
|
|
1868
|
+
bg: "bg-slate-500",
|
|
1869
|
+
shadow: "shadow-slate-200"
|
|
1870
|
+
},
|
|
1871
|
+
count: counts.all,
|
|
1872
|
+
showCount: true
|
|
1873
|
+
},
|
|
1874
|
+
{
|
|
1875
|
+
value: "completed",
|
|
1876
|
+
label: getCompletionFilterDisplayName("completed"),
|
|
1877
|
+
icon: "\u2705",
|
|
1878
|
+
activeColor: {
|
|
1879
|
+
bg: "bg-emerald-500",
|
|
1880
|
+
shadow: "shadow-emerald-200"
|
|
1881
|
+
},
|
|
1882
|
+
count: counts.completed,
|
|
1883
|
+
showCount: true
|
|
1884
|
+
},
|
|
1885
|
+
{
|
|
1886
|
+
value: "incomplete",
|
|
1887
|
+
label: getCompletionFilterDisplayName("incomplete"),
|
|
1888
|
+
icon: "\u{1F6A7}",
|
|
1889
|
+
activeColor: {
|
|
1890
|
+
bg: "bg-orange-500",
|
|
1891
|
+
shadow: "shadow-orange-200"
|
|
1892
|
+
},
|
|
1893
|
+
count: counts.inProgress,
|
|
1894
|
+
showCount: true
|
|
1895
|
+
}
|
|
1896
|
+
];
|
|
1897
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1898
|
+
FilterButtonGroup,
|
|
1899
|
+
{
|
|
1900
|
+
label: "\u5B8C\u6210\u72B6\u6001",
|
|
1901
|
+
value: completionFilter,
|
|
1902
|
+
options,
|
|
1903
|
+
onChange: onCompletionFilterChange,
|
|
1904
|
+
className
|
|
1905
|
+
}
|
|
1906
|
+
);
|
|
1907
|
+
};
|
|
1908
|
+
var PageHeader = ({ counts, className }) => {
|
|
1909
|
+
return /* @__PURE__ */ React12.createElement("div", { className }, /* @__PURE__ */ React12.createElement("div", { className: "mb-8" }, /* @__PURE__ */ React12.createElement(BackButton, null)), /* @__PURE__ */ React12.createElement("div", { className: "mb-8" }, /* @__PURE__ */ React12.createElement("h1", { className: "text-3xl font-bold text-gray-900" }, "\u5B9E\u9A8C\u7530"), /* @__PURE__ */ React12.createElement("p", { className: "mt-2 text-sm text-gray-600" }, "\u5728\u8FD9\u91CC\uFF0C\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u5404\u79CD\u5B9E\u9A8C\u6027\u7684\u529F\u80FD\u548C\u9879\u76EE"), /* @__PURE__ */ React12.createElement("div", { className: "mt-4 flex flex-wrap gap-4 text-sm text-gray-500" }, /* @__PURE__ */ React12.createElement("span", null, "\u603B\u8BA1: ", counts.all, " \u4E2A\u9879\u76EE"), /* @__PURE__ */ React12.createElement("span", null, "\u5B9E\u7528\u5DE5\u5177: ", counts.utility, " \u4E2A"), /* @__PURE__ */ React12.createElement("span", null, "\u4F11\u95F2\u5A31\u4E50: ", counts.leisure, " \u4E2A"), /* @__PURE__ */ React12.createElement("span", null, "\u5DF2\u5B8C\u6210: ", counts.completed, " \u4E2A"))));
|
|
1910
|
+
};
|
|
1911
|
+
function defaultExperimentRenderer(item) {
|
|
1912
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1913
|
+
ExperimentCard,
|
|
1914
|
+
{
|
|
1915
|
+
href: item.path,
|
|
1916
|
+
title: item.title,
|
|
1917
|
+
description: item.description,
|
|
1918
|
+
tags: item.tags,
|
|
1919
|
+
category: item.category,
|
|
1920
|
+
isCompleted: item.isCompleted,
|
|
1921
|
+
updatedAt: item.updatedAt,
|
|
1922
|
+
createdAt: item.createdAt
|
|
1923
|
+
}
|
|
1924
|
+
);
|
|
1925
|
+
}
|
|
1926
|
+
function ExperimentGrid({
|
|
1927
|
+
items,
|
|
1928
|
+
renderItem,
|
|
1929
|
+
columns = { sm: 1, md: 2, lg: 3, xl: 4 },
|
|
1930
|
+
gap = "md",
|
|
1931
|
+
className = ""
|
|
1932
|
+
}) {
|
|
1933
|
+
const itemRenderer = renderItem || ((item) => defaultExperimentRenderer(item));
|
|
1934
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1935
|
+
Grid,
|
|
1936
|
+
{
|
|
1937
|
+
items,
|
|
1938
|
+
renderItem: itemRenderer,
|
|
1939
|
+
columns,
|
|
1940
|
+
gap,
|
|
1941
|
+
className
|
|
1942
|
+
}
|
|
1943
|
+
);
|
|
1944
|
+
}
|
|
1945
|
+
function ExperimentItemGrid({
|
|
1946
|
+
experiments,
|
|
1947
|
+
...props
|
|
1948
|
+
}) {
|
|
1949
|
+
return /* @__PURE__ */ React12.createElement(ExperimentGrid, { items: experiments, ...props });
|
|
1950
|
+
}
|
|
1951
|
+
var EmptyState = ({ searchQuery, onClearSearch, className }) => {
|
|
1952
|
+
return /* @__PURE__ */ React12.createElement("div", { className: `text-center py-12 ${className}` }, /* @__PURE__ */ React12.createElement(
|
|
1953
|
+
"svg",
|
|
1954
|
+
{
|
|
1955
|
+
className: "mx-auto h-12 w-12 text-gray-400",
|
|
1956
|
+
fill: "none",
|
|
1957
|
+
stroke: "currentColor",
|
|
1958
|
+
viewBox: "0 0 24 24"
|
|
1959
|
+
},
|
|
1960
|
+
/* @__PURE__ */ React12.createElement(
|
|
1961
|
+
"path",
|
|
1962
|
+
{
|
|
1963
|
+
strokeLinecap: "round",
|
|
1964
|
+
strokeLinejoin: "round",
|
|
1965
|
+
strokeWidth: 2,
|
|
1966
|
+
d: "M9.172 16.172a4 4 0 015.656 0M9 12h6m-6-4h6m2 5.291A7.962 7.962 0 0112 15c-2.34 0-4.47.904-6.06 2.384"
|
|
1967
|
+
}
|
|
1968
|
+
)
|
|
1969
|
+
), /* @__PURE__ */ React12.createElement("h3", { className: "mt-2 text-sm font-medium text-gray-900" }, "\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5B9E\u9A8C\u9879\u76EE"), /* @__PURE__ */ React12.createElement("p", { className: "mt-1 text-sm text-gray-500" }, searchQuery ? "\u5C1D\u8BD5\u8C03\u6574\u641C\u7D22\u5173\u952E\u8BCD\u6216\u7B5B\u9009\u6761\u4EF6" : "\u5F53\u524D\u5206\u7C7B\u4E0B\u6682\u65E0\u5B9E\u9A8C\u9879\u76EE"), searchQuery && /* @__PURE__ */ React12.createElement("div", { className: "mt-4" }, /* @__PURE__ */ React12.createElement(
|
|
1970
|
+
"button",
|
|
1971
|
+
{
|
|
1972
|
+
onClick: onClearSearch,
|
|
1973
|
+
className: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-blue-700 bg-blue-100 hover:bg-blue-200"
|
|
1974
|
+
},
|
|
1975
|
+
"\u6E05\u9664\u641C\u7D22"
|
|
1976
|
+
)));
|
|
1977
|
+
};
|
|
1978
|
+
var SortControl = ({
|
|
1979
|
+
sortBy,
|
|
1980
|
+
sortOrder,
|
|
1981
|
+
onSortByChange,
|
|
1982
|
+
onSortOrderChange
|
|
1983
|
+
}) => {
|
|
1984
|
+
const sortOptions = [
|
|
1985
|
+
{ value: "title", label: "\u540D\u79F0" },
|
|
1986
|
+
{ value: "updatedAt", label: "\u66F4\u65B0\u65F6\u95F4" },
|
|
1987
|
+
{ value: "createdAt", label: "\u521B\u5EFA\u65F6\u95F4" },
|
|
1988
|
+
{ value: "category", label: "\u7C7B\u522B" },
|
|
1989
|
+
{ value: "completion", label: "\u5B8C\u6210\u72B6\u6001" }
|
|
1990
|
+
];
|
|
1991
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2 sm:gap-4 p-4 bg-white rounded-lg shadow-sm border border-gray-100" }, /* @__PURE__ */ React12.createElement("div", { className: "text-sm font-medium text-gray-700" }, "\u6392\u5E8F\u65B9\u5F0F\uFF1A"), /* @__PURE__ */ React12.createElement("div", { className: "flex flex-wrap gap-2" }, sortOptions.map((option) => /* @__PURE__ */ React12.createElement(
|
|
1992
|
+
"button",
|
|
1993
|
+
{
|
|
1994
|
+
key: option.value,
|
|
1995
|
+
className: `px-3 py-1.5 text-sm rounded-full transition-colors ${sortBy === option.value ? "bg-blue-100 text-blue-700 font-medium" : "bg-gray-100 text-gray-600 hover:bg-gray-200"}`,
|
|
1996
|
+
onClick: () => onSortByChange(option.value)
|
|
1997
|
+
},
|
|
1998
|
+
option.label
|
|
1999
|
+
))), /* @__PURE__ */ React12.createElement("div", { className: "ml-auto flex items-center" }, /* @__PURE__ */ React12.createElement(
|
|
2000
|
+
"button",
|
|
2001
|
+
{
|
|
2002
|
+
className: "flex items-center gap-1 px-3 py-1.5 text-sm rounded-full bg-gray-100 hover:bg-gray-200",
|
|
2003
|
+
onClick: () => onSortOrderChange(sortOrder === "asc" ? "desc" : "asc")
|
|
2004
|
+
},
|
|
2005
|
+
sortOrder === "asc" ? /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" }, /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12" })), /* @__PURE__ */ React12.createElement("span", null, "\u5347\u5E8F")) : /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" }, /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4" })), /* @__PURE__ */ React12.createElement("span", null, "\u964D\u5E8F"))
|
|
2006
|
+
)));
|
|
2007
|
+
};
|
|
2008
|
+
var SortModeToggle = ({ sortMode, onSortModeChange }) => {
|
|
2009
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "flex flex-col sm:flex-row sm:items-center gap-3 bg-white p-4 rounded-lg shadow-sm border border-gray-100" }, /* @__PURE__ */ React12.createElement("span", { className: "text-sm font-medium text-gray-700" }, "\u6392\u5E8F\u6A21\u5F0F\uFF1A"), /* @__PURE__ */ React12.createElement("div", { className: "flex w-full sm:w-auto p-1 bg-gray-100 rounded-lg" }, /* @__PURE__ */ React12.createElement(
|
|
2010
|
+
"button",
|
|
2011
|
+
{
|
|
2012
|
+
className: `flex-1 sm:flex-initial px-3 py-1.5 text-sm rounded-md transition-colors ${sortMode === "auto" ? "bg-white text-blue-700 font-medium shadow-sm" : "text-gray-600 hover:bg-gray-200"}`,
|
|
2013
|
+
onClick: () => onSortModeChange("auto")
|
|
2014
|
+
},
|
|
2015
|
+
/* @__PURE__ */ React12.createElement("div", { className: "flex items-center justify-center sm:justify-start space-x-1" }, /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" }, /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4" })), /* @__PURE__ */ React12.createElement("span", null, "\u81EA\u52A8\u6392\u5E8F"))
|
|
2016
|
+
), /* @__PURE__ */ React12.createElement(
|
|
2017
|
+
"button",
|
|
2018
|
+
{
|
|
2019
|
+
className: `flex-1 sm:flex-initial px-3 py-1.5 text-sm rounded-md transition-colors ${sortMode === "manual" ? "bg-white text-blue-700 font-medium shadow-sm" : "text-gray-600 hover:bg-gray-200"}`,
|
|
2020
|
+
onClick: () => onSortModeChange("manual")
|
|
2021
|
+
},
|
|
2022
|
+
/* @__PURE__ */ React12.createElement("div", { className: "flex items-center justify-center sm:justify-start space-x-1" }, /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" }, /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 11.5V14m0-2.5v-6a1.5 1.5 0 113 0m-3 6a1.5 1.5 0 00-3 0v2a7.5 7.5 0 0015 0v-5a1.5 1.5 0 013 0m-6-3V11m0-5.5v-1a1.5 1.5 0 013 0v1m0 0V11m0-5.5a1.5 1.5 0 013 0v3m0 0V11" })), /* @__PURE__ */ React12.createElement("span", null, "\u624B\u52A8\u6392\u5E8F"))
|
|
2023
|
+
)));
|
|
2024
|
+
};
|
|
2025
|
+
var SortableExperimentItem = ({
|
|
2026
|
+
item,
|
|
2027
|
+
onMoveUp,
|
|
2028
|
+
onMoveDown,
|
|
2029
|
+
isFirst,
|
|
2030
|
+
isLast
|
|
2031
|
+
}) => {
|
|
2032
|
+
const {
|
|
2033
|
+
attributes,
|
|
2034
|
+
listeners,
|
|
2035
|
+
setNodeRef,
|
|
2036
|
+
transform,
|
|
2037
|
+
transition,
|
|
2038
|
+
isDragging
|
|
2039
|
+
} = useSortable({ id: item.id });
|
|
2040
|
+
const style = {
|
|
2041
|
+
transform: CSS.Transform.toString(transform),
|
|
2042
|
+
transition,
|
|
2043
|
+
zIndex: isDragging ? 100 : 1,
|
|
2044
|
+
opacity: isDragging ? 0.8 : 1,
|
|
2045
|
+
position: "relative"
|
|
2046
|
+
};
|
|
2047
|
+
return /* @__PURE__ */ React12.createElement(
|
|
2048
|
+
"div",
|
|
2049
|
+
{
|
|
2050
|
+
ref: setNodeRef,
|
|
2051
|
+
style,
|
|
2052
|
+
className: "relative group"
|
|
2053
|
+
},
|
|
2054
|
+
/* @__PURE__ */ React12.createElement(
|
|
2055
|
+
"div",
|
|
2056
|
+
{
|
|
2057
|
+
...attributes,
|
|
2058
|
+
...listeners,
|
|
2059
|
+
className: "absolute right-2 top-2 w-8 h-8 bg-white/80 hover:bg-white rounded-full flex items-center justify-center shadow-md z-10\n hidden sm:flex\n opacity-0 group-hover:opacity-100 transition-opacity\n cursor-grab active:cursor-grabbing\n touch-action-none",
|
|
2060
|
+
onClick: (e) => e.stopPropagation(),
|
|
2061
|
+
"aria-label": "\u62D6\u52A8\u6392\u5E8F"
|
|
2062
|
+
},
|
|
2063
|
+
/* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-5 w-5 text-gray-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" }, /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 8h16M4 16h16" })),
|
|
2064
|
+
/* @__PURE__ */ React12.createElement("span", { className: "absolute top-full mt-1 left-1/2 transform -translate-x-1/2 text-xs bg-gray-800 text-white px-2 py-1 rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity" }, "\u62D6\u52A8\u6392\u5E8F")
|
|
2065
|
+
),
|
|
2066
|
+
/* @__PURE__ */ React12.createElement("div", { className: "absolute right-2 top-2 flex flex-col gap-2 sm:hidden z-10" }, /* @__PURE__ */ React12.createElement(
|
|
2067
|
+
"button",
|
|
2068
|
+
{
|
|
2069
|
+
onClick: (e) => {
|
|
2070
|
+
e.stopPropagation();
|
|
2071
|
+
onMoveUp?.();
|
|
2072
|
+
},
|
|
2073
|
+
disabled: isFirst,
|
|
2074
|
+
className: `w-8 h-8 rounded-full flex items-center justify-center shadow-md
|
|
2075
|
+
${isFirst ? "bg-gray-200 cursor-not-allowed" : "bg-white/80 hover:bg-white active:bg-gray-100"}`,
|
|
2076
|
+
"aria-label": "\u5411\u4E0A\u79FB\u52A8"
|
|
2077
|
+
},
|
|
2078
|
+
/* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: `h-5 w-5 ${isFirst ? "text-gray-400" : "text-gray-500"}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" }, /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 15l7-7 7 7" }))
|
|
2079
|
+
), /* @__PURE__ */ React12.createElement(
|
|
2080
|
+
"button",
|
|
2081
|
+
{
|
|
2082
|
+
onClick: (e) => {
|
|
2083
|
+
e.stopPropagation();
|
|
2084
|
+
onMoveDown?.();
|
|
2085
|
+
},
|
|
2086
|
+
disabled: isLast,
|
|
2087
|
+
className: `w-8 h-8 rounded-full flex items-center justify-center shadow-md
|
|
2088
|
+
${isLast ? "bg-gray-200 cursor-not-allowed" : "bg-white/80 hover:bg-white active:bg-gray-100"}`,
|
|
2089
|
+
"aria-label": "\u5411\u4E0B\u79FB\u52A8"
|
|
2090
|
+
},
|
|
2091
|
+
/* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: `h-5 w-5 ${isLast ? "text-gray-400" : "text-gray-500"}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" }, /* @__PURE__ */ React12.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }))
|
|
2092
|
+
)),
|
|
2093
|
+
/* @__PURE__ */ React12.createElement("div", { className: `transition-all ${isDragging ? "scale-105 shadow-xl" : ""}` }, /* @__PURE__ */ React12.createElement(
|
|
2094
|
+
ExperimentCard,
|
|
2095
|
+
{
|
|
2096
|
+
href: item.path,
|
|
2097
|
+
title: item.title,
|
|
2098
|
+
description: item.description,
|
|
2099
|
+
tags: item.tags,
|
|
2100
|
+
category: item.category,
|
|
2101
|
+
isCompleted: item.isCompleted,
|
|
2102
|
+
updatedAt: item.updatedAt,
|
|
2103
|
+
createdAt: item.createdAt
|
|
2104
|
+
}
|
|
2105
|
+
))
|
|
2106
|
+
);
|
|
2107
|
+
};
|
|
2108
|
+
|
|
2109
|
+
// src/testField/components/DraggableExperimentGrid.tsx
|
|
2110
|
+
var DraggableExperimentGrid = ({
|
|
2111
|
+
items: initialItems,
|
|
2112
|
+
onOrderChange,
|
|
2113
|
+
className = ""
|
|
2114
|
+
}) => {
|
|
2115
|
+
const [items, setItems] = useState(initialItems);
|
|
2116
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
2117
|
+
const sensors = useSensors(
|
|
2118
|
+
useSensor(PointerSensor, {
|
|
2119
|
+
activationConstraint: {
|
|
2120
|
+
distance: 8
|
|
2121
|
+
// 需要拖动8px才激活,避免意外触发
|
|
2122
|
+
}
|
|
2123
|
+
}),
|
|
2124
|
+
useSensor(TouchSensor, {
|
|
2125
|
+
activationConstraint: {
|
|
2126
|
+
delay: 250,
|
|
2127
|
+
// 触摸需要按住250ms才激活,避免与点击冲突
|
|
2128
|
+
tolerance: 5
|
|
2129
|
+
// 允许的移动容差
|
|
2130
|
+
}
|
|
2131
|
+
}),
|
|
2132
|
+
useSensor(KeyboardSensor, {
|
|
2133
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
2134
|
+
})
|
|
2135
|
+
);
|
|
2136
|
+
function handleDragStart() {
|
|
2137
|
+
setIsDragging(true);
|
|
2138
|
+
}
|
|
2139
|
+
function handleDragEnd(event) {
|
|
2140
|
+
setIsDragging(false);
|
|
2141
|
+
const { active, over } = event;
|
|
2142
|
+
if (over && active.id !== over.id) {
|
|
2143
|
+
setItems((currentItems) => {
|
|
2144
|
+
const oldIndex = currentItems.findIndex((item) => item.id === active.id);
|
|
2145
|
+
const newIndex = currentItems.findIndex((item) => item.id === over.id);
|
|
2146
|
+
const newItems = arrayMove(currentItems, oldIndex, newIndex);
|
|
2147
|
+
if (onOrderChange) {
|
|
2148
|
+
onOrderChange(newItems);
|
|
2149
|
+
}
|
|
2150
|
+
return newItems;
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
const handleMoveUp = (index) => {
|
|
2155
|
+
if (index > 0) {
|
|
2156
|
+
setItems((currentItems) => {
|
|
2157
|
+
const newItems = arrayMove(currentItems, index, index - 1);
|
|
2158
|
+
onOrderChange?.(newItems);
|
|
2159
|
+
return newItems;
|
|
2160
|
+
});
|
|
2161
|
+
}
|
|
2162
|
+
};
|
|
2163
|
+
const handleMoveDown = (index) => {
|
|
2164
|
+
if (index < items.length - 1) {
|
|
2165
|
+
setItems((currentItems) => {
|
|
2166
|
+
const newItems = arrayMove(currentItems, index, index + 1);
|
|
2167
|
+
onOrderChange?.(newItems);
|
|
2168
|
+
return newItems;
|
|
2169
|
+
});
|
|
2170
|
+
}
|
|
2171
|
+
};
|
|
2172
|
+
React12.useEffect(() => {
|
|
2173
|
+
setItems(initialItems);
|
|
2174
|
+
}, [initialItems]);
|
|
2175
|
+
return /* @__PURE__ */ React12.createElement("div", { className: `relative ${className}` }, /* @__PURE__ */ React12.createElement("div", { className: "mb-4 px-4 py-3 bg-blue-50 text-blue-700 rounded-lg border border-blue-200 text-sm" }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-start sm:items-center" }, /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-5 w-5 mr-2 flex-shrink-0 mt-0.5 sm:mt-0", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React12.createElement("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" })), /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("p", { className: "mb-1" }, "\u62D6\u62FD\u5361\u7247\u53EF\u4EE5\u81EA\u5B9A\u4E49\u6392\u5E8F\u3002\u70B9\u51FB\u5361\u7247\u53EF\u4EE5\u8BBF\u95EE\u5BF9\u5E94\u7684\u5B9E\u9A8C\u9879\u76EE\u3002"), /* @__PURE__ */ React12.createElement("p", { className: "text-xs text-blue-600 sm:hidden" }, "\u70B9\u51FB\u5361\u7247\u53F3\u4E0A\u89D2\u7684\u4E0A\u4E0B\u7BAD\u5934\u6309\u94AE\u8C03\u6574\u987A\u5E8F"), /* @__PURE__ */ React12.createElement("p", { className: "text-xs text-blue-600 hidden sm:block" }, "\u957F\u6309\u5361\u7247\u53F3\u4E0A\u89D2\u7684\u62D6\u52A8\u56FE\u6807\u8FDB\u884C\u6392\u5E8F")))), /* @__PURE__ */ React12.createElement(
|
|
2176
|
+
DndContext,
|
|
2177
|
+
{
|
|
2178
|
+
sensors,
|
|
2179
|
+
collisionDetection: closestCenter,
|
|
2180
|
+
onDragStart: handleDragStart,
|
|
2181
|
+
onDragEnd: handleDragEnd
|
|
2182
|
+
},
|
|
2183
|
+
/* @__PURE__ */ React12.createElement(
|
|
2184
|
+
SortableContext,
|
|
2185
|
+
{
|
|
2186
|
+
items: items.map((item) => item.id),
|
|
2187
|
+
strategy: rectSortingStrategy
|
|
2188
|
+
},
|
|
2189
|
+
/* @__PURE__ */ React12.createElement("div", { className: `
|
|
2190
|
+
grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-6
|
|
2191
|
+
${isDragging ? "cursor-grabbing" : ""}
|
|
2192
|
+
` }, items.map((item, index) => /* @__PURE__ */ React12.createElement(
|
|
2193
|
+
SortableExperimentItem,
|
|
2194
|
+
{
|
|
2195
|
+
key: item.id,
|
|
2196
|
+
item,
|
|
2197
|
+
onMoveUp: () => handleMoveUp(index),
|
|
2198
|
+
onMoveDown: () => handleMoveDown(index),
|
|
2199
|
+
isFirst: index === 0,
|
|
2200
|
+
isLast: index === items.length - 1
|
|
2201
|
+
}
|
|
2202
|
+
)))
|
|
2203
|
+
)
|
|
2204
|
+
));
|
|
2205
|
+
};
|
|
2206
|
+
var PermissionGuard = ({
|
|
2207
|
+
apiClient,
|
|
2208
|
+
children,
|
|
2209
|
+
fallback
|
|
2210
|
+
}) => {
|
|
2211
|
+
const { user, isLoggedIn } = useAuth(apiClient);
|
|
2212
|
+
const hasPermission = () => {
|
|
2213
|
+
if (!isLoggedIn || !user) {
|
|
2214
|
+
return false;
|
|
2215
|
+
}
|
|
2216
|
+
return true;
|
|
2217
|
+
};
|
|
2218
|
+
if (!hasPermission()) {
|
|
2219
|
+
return fallback || /* @__PURE__ */ React12.createElement("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center" }, /* @__PURE__ */ React12.createElement("div", { className: "max-w-md w-full bg-white rounded-lg shadow-lg p-8 text-center" }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-center justify-center mb-4" }, /* @__PURE__ */ React12.createElement(Shield, { className: "w-12 h-12 text-red-500" })), /* @__PURE__ */ React12.createElement("h2", { className: "text-xl font-semibold text-gray-900 mb-2" }, "\u9700\u8981\u767B\u5F55"), /* @__PURE__ */ React12.createElement("p", { className: "text-gray-600 mb-4" }, "\u8BF7\u5148\u767B\u5F55\u4EE5\u8BBF\u95EE\u5B9E\u9A8C\u7530\u529F\u80FD\u3002"), /* @__PURE__ */ React12.createElement("div", { className: "flex items-center justify-center text-sm text-gray-500 mb-4" }, /* @__PURE__ */ React12.createElement(AlertTriangle, { className: "w-4 h-4 mr-1" }), "\u5B9E\u9A8C\u7530\u5BF9\u6240\u6709\u6CE8\u518C\u7528\u6237\u5F00\u653E"), /* @__PURE__ */ React12.createElement(
|
|
2220
|
+
"button",
|
|
2221
|
+
{
|
|
2222
|
+
onClick: () => window.history.back(),
|
|
2223
|
+
className: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-green-600 hover:bg-green-700"
|
|
2224
|
+
},
|
|
2225
|
+
"\u8FD4\u56DE\u4E0A\u4E00\u9875"
|
|
2226
|
+
)));
|
|
2227
|
+
}
|
|
2228
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, children);
|
|
2229
|
+
};
|
|
2230
|
+
var UserInfoBar = ({ apiClient }) => {
|
|
2231
|
+
const { user, logout, isLoggedIn } = useAuth(apiClient);
|
|
2232
|
+
const handleLogout = async () => {
|
|
2233
|
+
try {
|
|
2234
|
+
await logout();
|
|
2235
|
+
window.location.href = "/";
|
|
2236
|
+
} catch (error) {
|
|
2237
|
+
console.error("\u767B\u51FA\u5931\u8D25:", error);
|
|
2238
|
+
}
|
|
2239
|
+
};
|
|
2240
|
+
if (!isLoggedIn || !user) {
|
|
2241
|
+
return null;
|
|
2242
|
+
}
|
|
2243
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "bg-white border-b border-gray-200 px-4 py-3" }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-center space-x-3" }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-center space-x-2" }, /* @__PURE__ */ React12.createElement(User, { className: "w-5 h-5 text-gray-600" }), /* @__PURE__ */ React12.createElement("span", { className: "text-sm font-medium text-gray-900" }, user.name || user.email || "\u7528\u6237"), user.role && /* @__PURE__ */ React12.createElement("span", { className: "inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800" }, user.role))), /* @__PURE__ */ React12.createElement("div", { className: "flex items-center space-x-2" }, /* @__PURE__ */ React12.createElement("div", { className: "flex items-center space-x-1 text-sm text-gray-500" }, /* @__PURE__ */ React12.createElement(FlaskConical, { className: "w-4 h-4" }), /* @__PURE__ */ React12.createElement("span", null, "\u5B9E\u9A8C\u7530")), /* @__PURE__ */ React12.createElement(
|
|
2244
|
+
"button",
|
|
2245
|
+
{
|
|
2246
|
+
onClick: handleLogout,
|
|
2247
|
+
className: "inline-flex items-center px-3 py-1.5 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500"
|
|
2248
|
+
},
|
|
2249
|
+
/* @__PURE__ */ React12.createElement(LogOut, { className: "w-4 h-4 mr-1" }),
|
|
2250
|
+
"\u767B\u51FA"
|
|
2251
|
+
))));
|
|
2252
|
+
};
|
|
2253
|
+
|
|
2254
|
+
export { About_default as About, AutoOpenModal, BackgroundRemover, CategoryFilter, CompletionFilterComponent, Contact_default as Contact, DraggableExperimentGrid, EmptyState, EnhancedAvatar, ExperimentCard, ExperimentGrid, ExperimentItemGrid, FloatingMenu_default as FloatingMenu, FloatingMenuExample_default as FloatingMenuExample, Home_default as Home, Navigation_default as Navigation, NavigationItem_default as NavigationItem, NavigationToggle_default as NavigationToggle, OCRScanner, PageHeader, PermissionGuard, ProfileButton, ProfileModal, ProjectCarousel, SentimentAnalyzer, SmartAssistant, SortControl, SortModeToggle, SortableExperimentItem, UserInfoBar, filterExperiments, getAllTags, getCategoryColor, getCategoryDisplayName, getCompletionFilterDisplayName, getCompletionStatusColor, getCompletionStatusText, getExperimentCounts, sortExperiments, useBackgroundRemoval, useOCR, useSentimentAnalysis, useTextGeneration, validateExperiment };
|
|
3090
2255
|
//# sourceMappingURL=index.mjs.map
|
|
3091
2256
|
//# sourceMappingURL=index.mjs.map
|