@cupcodev/ui 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +110 -37
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +210 -137
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/styles/base.css +0 -4
- package/styles/global.css +0 -4
package/dist/index.js
CHANGED
|
@@ -2275,7 +2275,7 @@ ModalDescription.displayName = DialogPrimitive.Description.displayName;
|
|
|
2275
2275
|
|
|
2276
2276
|
// src/components/cupcode/NavbarCupcode.tsx
|
|
2277
2277
|
import * as React10 from "react";
|
|
2278
|
-
import { Menu
|
|
2278
|
+
import { Menu } from "lucide-react";
|
|
2279
2279
|
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2280
2280
|
var NavbarCupcode = ({
|
|
2281
2281
|
logo,
|
|
@@ -2284,9 +2284,54 @@ var NavbarCupcode = ({
|
|
|
2284
2284
|
className
|
|
2285
2285
|
}) => {
|
|
2286
2286
|
const [isOpen, setIsOpen] = React10.useState(false);
|
|
2287
|
+
const navRef = React10.useRef(null);
|
|
2288
|
+
const mobileMenuId = React10.useId();
|
|
2289
|
+
React10.useEffect(() => {
|
|
2290
|
+
if (!isOpen) return;
|
|
2291
|
+
const handlePointerDown = (event) => {
|
|
2292
|
+
var _a65;
|
|
2293
|
+
const target = event.target;
|
|
2294
|
+
if (!(target instanceof Node)) return;
|
|
2295
|
+
if (!((_a65 = navRef.current) == null ? void 0 : _a65.contains(target))) {
|
|
2296
|
+
setIsOpen(false);
|
|
2297
|
+
}
|
|
2298
|
+
};
|
|
2299
|
+
const handleEscape = (event) => {
|
|
2300
|
+
if (event.key === "Escape") {
|
|
2301
|
+
setIsOpen(false);
|
|
2302
|
+
}
|
|
2303
|
+
};
|
|
2304
|
+
document.addEventListener("pointerdown", handlePointerDown);
|
|
2305
|
+
document.addEventListener("keydown", handleEscape);
|
|
2306
|
+
return () => {
|
|
2307
|
+
document.removeEventListener("pointerdown", handlePointerDown);
|
|
2308
|
+
document.removeEventListener("keydown", handleEscape);
|
|
2309
|
+
};
|
|
2310
|
+
}, [isOpen]);
|
|
2311
|
+
React10.useEffect(() => {
|
|
2312
|
+
if (!isOpen) return;
|
|
2313
|
+
const { style } = document.body;
|
|
2314
|
+
const previousOverflow = style.overflow;
|
|
2315
|
+
style.overflow = "hidden";
|
|
2316
|
+
return () => {
|
|
2317
|
+
style.overflow = previousOverflow;
|
|
2318
|
+
};
|
|
2319
|
+
}, [isOpen]);
|
|
2320
|
+
React10.useEffect(() => {
|
|
2321
|
+
const handleResize = () => {
|
|
2322
|
+
if (window.innerWidth >= 768) {
|
|
2323
|
+
setIsOpen(false);
|
|
2324
|
+
}
|
|
2325
|
+
};
|
|
2326
|
+
window.addEventListener("resize", handleResize);
|
|
2327
|
+
return () => {
|
|
2328
|
+
window.removeEventListener("resize", handleResize);
|
|
2329
|
+
};
|
|
2330
|
+
}, []);
|
|
2287
2331
|
return /* @__PURE__ */ jsx21(
|
|
2288
2332
|
"nav",
|
|
2289
2333
|
{
|
|
2334
|
+
ref: navRef,
|
|
2290
2335
|
className: cn(
|
|
2291
2336
|
"fixed top-0 left-0 right-0 z-[200] pointer-events-auto",
|
|
2292
2337
|
"glass border-b border-border",
|
|
@@ -2345,45 +2390,56 @@ var NavbarCupcode = ({
|
|
|
2345
2390
|
/* @__PURE__ */ jsx21(
|
|
2346
2391
|
"button",
|
|
2347
2392
|
{
|
|
2393
|
+
type: "button",
|
|
2348
2394
|
onClick: () => setIsOpen(!isOpen),
|
|
2349
|
-
|
|
2350
|
-
|
|
2395
|
+
"aria-controls": mobileMenuId,
|
|
2396
|
+
"aria-expanded": isOpen,
|
|
2397
|
+
"aria-label": isOpen ? "Fechar menu de navega\xE7\xE3o" : "Abrir menu de navega\xE7\xE3o",
|
|
2398
|
+
className: "md:hidden inline-flex h-10 w-10 items-center justify-center rounded-lg transition-colors hover:bg-primary/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
2399
|
+
children: /* @__PURE__ */ jsx21(Menu, { className: cn("h-6 w-6 text-foreground", isOpen && "text-primary") })
|
|
2351
2400
|
}
|
|
2352
2401
|
)
|
|
2353
2402
|
] }),
|
|
2354
|
-
isOpen && /* @__PURE__ */ jsxs17(
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2403
|
+
isOpen && /* @__PURE__ */ jsxs17(
|
|
2404
|
+
"div",
|
|
2405
|
+
{
|
|
2406
|
+
id: mobileMenuId,
|
|
2407
|
+
className: "md:hidden max-h-[calc(100dvh-4rem)] space-y-3 overflow-y-auto border-t border-border/60 py-4 animate-slide-up",
|
|
2408
|
+
children: [
|
|
2409
|
+
items.map((item, index) => {
|
|
2410
|
+
const key = `${item.label}-${index}`;
|
|
2411
|
+
const isActive = item.isActive;
|
|
2412
|
+
const classes = cn(
|
|
2413
|
+
"flex min-h-11 items-center gap-2 rounded-lg px-4 py-2.5 text-sm font-semibold text-foreground transition-colors hover:bg-primary/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
2414
|
+
isActive && "text-primary"
|
|
2415
|
+
);
|
|
2416
|
+
const handleClick = (event) => {
|
|
2417
|
+
var _a65;
|
|
2418
|
+
(_a65 = item.onClick) == null ? void 0 : _a65.call(item, event);
|
|
2419
|
+
setIsOpen(false);
|
|
2420
|
+
};
|
|
2421
|
+
if (item.href.startsWith("#")) {
|
|
2422
|
+
return /* @__PURE__ */ jsxs17("a", { href: item.href, className: classes, onClick: handleClick, children: [
|
|
2423
|
+
item.icon && /* @__PURE__ */ jsx21("span", { children: item.icon }),
|
|
2424
|
+
item.label
|
|
2425
|
+
] }, key);
|
|
2426
|
+
}
|
|
2427
|
+
return /* @__PURE__ */ jsxs17("a", { href: item.href, className: classes, onClick: handleClick, children: [
|
|
2428
|
+
item.icon && /* @__PURE__ */ jsx21("span", { children: item.icon }),
|
|
2429
|
+
item.label
|
|
2430
|
+
] }, key);
|
|
2431
|
+
}),
|
|
2432
|
+
actions && /* @__PURE__ */ jsx21("div", { className: "px-4 pb-[max(env(safe-area-inset-bottom),0.5rem)] pt-2", children: actions })
|
|
2433
|
+
]
|
|
2434
|
+
}
|
|
2435
|
+
)
|
|
2380
2436
|
] })
|
|
2381
2437
|
}
|
|
2382
2438
|
);
|
|
2383
2439
|
};
|
|
2384
2440
|
|
|
2385
2441
|
// src/components/cupcode/MainNavbar.tsx
|
|
2386
|
-
import { useCallback as useCallback6, useEffect as
|
|
2442
|
+
import { useCallback as useCallback6, useEffect as useEffect16, useMemo as useMemo8, useRef as useRef12, useState as useState13 } from "react";
|
|
2387
2443
|
|
|
2388
2444
|
// src/components/cupcode/TelescupImage.tsx
|
|
2389
2445
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
@@ -2471,13 +2527,13 @@ import {
|
|
|
2471
2527
|
UserRound,
|
|
2472
2528
|
UsersRound,
|
|
2473
2529
|
Volume2,
|
|
2474
|
-
X as
|
|
2530
|
+
X as X4
|
|
2475
2531
|
} from "lucide-react";
|
|
2476
2532
|
import {
|
|
2477
2533
|
useCallback as useCallback5,
|
|
2478
|
-
useEffect as
|
|
2534
|
+
useEffect as useEffect14,
|
|
2479
2535
|
useMemo as useMemo7,
|
|
2480
|
-
useRef as
|
|
2536
|
+
useRef as useRef11,
|
|
2481
2537
|
useState as useState11
|
|
2482
2538
|
} from "react";
|
|
2483
2539
|
|
|
@@ -2818,7 +2874,7 @@ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
|
2818
2874
|
// src/components/ui/dialog.tsx
|
|
2819
2875
|
import * as React16 from "react";
|
|
2820
2876
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
2821
|
-
import { X as
|
|
2877
|
+
import { X as X3 } from "lucide-react";
|
|
2822
2878
|
import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2823
2879
|
var Dialog = DialogPrimitive2.Root;
|
|
2824
2880
|
var DialogTrigger = DialogPrimitive2.Trigger;
|
|
@@ -2850,7 +2906,7 @@ var DialogContent = React16.forwardRef(({ className, children, ...props }, ref)
|
|
|
2850
2906
|
children: [
|
|
2851
2907
|
children,
|
|
2852
2908
|
/* @__PURE__ */ jsxs21(DialogPrimitive2.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
|
|
2853
|
-
/* @__PURE__ */ jsx28(
|
|
2909
|
+
/* @__PURE__ */ jsx28(X3, { className: "h-4 w-4" }),
|
|
2854
2910
|
/* @__PURE__ */ jsx28("span", { className: "sr-only", children: "Close" })
|
|
2855
2911
|
] })
|
|
2856
2912
|
]
|
|
@@ -3017,7 +3073,7 @@ function useToast() {
|
|
|
3017
3073
|
}
|
|
3018
3074
|
|
|
3019
3075
|
// src/components/cupcode/TelescupUpload.tsx
|
|
3020
|
-
import React27, { useCallback as useCallback4, useEffect as
|
|
3076
|
+
import React27, { useCallback as useCallback4, useEffect as useEffect13, useMemo as useMemo6, useState as useState10 } from "react";
|
|
3021
3077
|
|
|
3022
3078
|
// src/lib/telescupClient.ts
|
|
3023
3079
|
var TelescupClientError = class extends Error {
|
|
@@ -4305,7 +4361,7 @@ var createTelescupClient = (config) => ({
|
|
|
4305
4361
|
import React21, { useCallback as useCallback2, useMemo as useMemo3, useState as useState7 } from "react";
|
|
4306
4362
|
|
|
4307
4363
|
// src/hooks/useTelescupAssets.ts
|
|
4308
|
-
import { useCallback, useEffect as
|
|
4364
|
+
import { useCallback, useEffect as useEffect11, useMemo as useMemo2, useRef as useRef8, useState as useState6 } from "react";
|
|
4309
4365
|
var DEFAULT_CACHE_MS = 3e4;
|
|
4310
4366
|
var listCache = /* @__PURE__ */ new Map();
|
|
4311
4367
|
var inFlight = /* @__PURE__ */ new Map();
|
|
@@ -4340,8 +4396,8 @@ function useTelescupAssets(options) {
|
|
|
4340
4396
|
const [isLoading, setIsLoading] = useState6(false);
|
|
4341
4397
|
const [isLoadingMore, setIsLoadingMore] = useState6(false);
|
|
4342
4398
|
const [error, setError] = useState6(null);
|
|
4343
|
-
const aliveRef =
|
|
4344
|
-
const requestSeqRef =
|
|
4399
|
+
const aliveRef = useRef8(true);
|
|
4400
|
+
const requestSeqRef = useRef8(0);
|
|
4345
4401
|
const fetchFirst = useCallback(
|
|
4346
4402
|
async (skipCache = false) => {
|
|
4347
4403
|
if (!enabled) return;
|
|
@@ -4420,7 +4476,7 @@ function useTelescupAssets(options) {
|
|
|
4420
4476
|
if (aliveRef.current && requestSeq === requestSeqRef.current) setIsLoadingMore(false);
|
|
4421
4477
|
}
|
|
4422
4478
|
}, [cacheKey, filters, isLoading, isLoadingMore, pageSize, resolvedClient, state.facets, state.items, state.nextCursor, state.total]);
|
|
4423
|
-
|
|
4479
|
+
useEffect11(() => {
|
|
4424
4480
|
aliveRef.current = true;
|
|
4425
4481
|
setState({ items: [] });
|
|
4426
4482
|
setIsLoadingMore(false);
|
|
@@ -4782,10 +4838,10 @@ var TelescupAssetPicker = ({
|
|
|
4782
4838
|
};
|
|
4783
4839
|
|
|
4784
4840
|
// src/components/cupcode/TelescupUploader.tsx
|
|
4785
|
-
import { useMemo as useMemo5, useRef as
|
|
4841
|
+
import { useMemo as useMemo5, useRef as useRef10, useState as useState9 } from "react";
|
|
4786
4842
|
|
|
4787
4843
|
// src/hooks/useTelescupUploadQueue.tsx
|
|
4788
|
-
import { useCallback as useCallback3, useEffect as
|
|
4844
|
+
import { useCallback as useCallback3, useEffect as useEffect12, useMemo as useMemo4, useRef as useRef9, useState as useState8 } from "react";
|
|
4789
4845
|
var DEFAULT_CONCURRENCY = 3;
|
|
4790
4846
|
var TELESCUP_UPLOAD_MODE = getRuntimeEnvOr("VITE_TELESCUP_UPLOAD_MODE", "standard").trim().toLowerCase();
|
|
4791
4847
|
var makeId = () => Math.random().toString(36).slice(2, 10);
|
|
@@ -4841,9 +4897,9 @@ function useTelescupUploadQueue(options) {
|
|
|
4841
4897
|
onItemError
|
|
4842
4898
|
} = options;
|
|
4843
4899
|
const [queue, setQueue] = useState8([]);
|
|
4844
|
-
const queueRef =
|
|
4845
|
-
const activeRef =
|
|
4846
|
-
|
|
4900
|
+
const queueRef = useRef9(queue);
|
|
4901
|
+
const activeRef = useRef9(0);
|
|
4902
|
+
useEffect12(() => {
|
|
4847
4903
|
queueRef.current = queue;
|
|
4848
4904
|
}, [queue]);
|
|
4849
4905
|
const enqueueFiles = useCallback3(
|
|
@@ -4972,7 +5028,7 @@ function useTelescupUploadQueue(options) {
|
|
|
4972
5028
|
};
|
|
4973
5029
|
void run();
|
|
4974
5030
|
}, [client, conflictPolicy, concurrency, folderId, onItemComplete, onItemError, updateItem]);
|
|
4975
|
-
|
|
5031
|
+
useEffect12(() => {
|
|
4976
5032
|
processQueue();
|
|
4977
5033
|
}, [processQueue, queue]);
|
|
4978
5034
|
const removeItem = useCallback3((id) => {
|
|
@@ -5050,7 +5106,7 @@ var TelescupUploader = ({
|
|
|
5050
5106
|
onAssetUploaded
|
|
5051
5107
|
}) => {
|
|
5052
5108
|
var _a65;
|
|
5053
|
-
const inputRef =
|
|
5109
|
+
const inputRef = useRef10(null);
|
|
5054
5110
|
const [dragActive, setDragActive] = useState9(false);
|
|
5055
5111
|
const {
|
|
5056
5112
|
queue,
|
|
@@ -5432,7 +5488,7 @@ var TelescupMetaEditor = ({
|
|
|
5432
5488
|
const [drafts, setDrafts] = useState10({});
|
|
5433
5489
|
const [saving, setSaving] = useState10(false);
|
|
5434
5490
|
const [aiLoading, setAiLoading] = useState10(false);
|
|
5435
|
-
|
|
5491
|
+
useEffect13(() => {
|
|
5436
5492
|
if (!assets.length) {
|
|
5437
5493
|
setActiveAssetId("");
|
|
5438
5494
|
return;
|
|
@@ -5660,7 +5716,7 @@ var TelescupUpload = ({
|
|
|
5660
5716
|
const [stagedSelection, setStagedSelection] = useState10(null);
|
|
5661
5717
|
const [assetRevision, setAssetRevision] = useState10(0);
|
|
5662
5718
|
const assetMapRef = React27.useRef(/* @__PURE__ */ new Map());
|
|
5663
|
-
|
|
5719
|
+
useEffect13(() => {
|
|
5664
5720
|
if (value) {
|
|
5665
5721
|
setInternalSelection(value);
|
|
5666
5722
|
}
|
|
@@ -5709,7 +5765,7 @@ var TelescupUpload = ({
|
|
|
5709
5765
|
if (!isControlled) setInternalOpen(false);
|
|
5710
5766
|
onClose == null ? void 0 : onClose();
|
|
5711
5767
|
}, [isControlled, onClose]);
|
|
5712
|
-
|
|
5768
|
+
useEffect13(() => {
|
|
5713
5769
|
if (isOpen) return;
|
|
5714
5770
|
setStagedSelection(null);
|
|
5715
5771
|
}, [isOpen]);
|
|
@@ -6555,21 +6611,21 @@ var UserMenuCupcode = ({
|
|
|
6555
6611
|
const [pendingLatestMessagesCount, setPendingLatestMessagesCount] = useState11(0);
|
|
6556
6612
|
const [activeReactionPicker, setActiveReactionPicker] = useState11(null);
|
|
6557
6613
|
const [internalStatus, setInternalStatus] = useState11(defaultStatus);
|
|
6558
|
-
const emojiPickerRef =
|
|
6559
|
-
const reactionPickerRef =
|
|
6560
|
-
const chatMessagesPaneRef =
|
|
6561
|
-
const pendingReadRequestsRef =
|
|
6562
|
-
const seenIncomingMessageIdsRef =
|
|
6563
|
-
const hasBootstrappedIncomingMessagesRef =
|
|
6564
|
-
const wasFocusModeActiveRef =
|
|
6565
|
-
const previousChatUnreadCountRef =
|
|
6566
|
-
const chatIndicatorHideTimeoutRef =
|
|
6567
|
-
const chatIndicatorIntroTimeoutRef =
|
|
6568
|
-
const chatBadgePulseTimeoutRef =
|
|
6569
|
-
const activeConversationIdRef =
|
|
6570
|
-
const activeConversationMessageIdsRef =
|
|
6571
|
-
const shouldAutoScrollToBottomRef =
|
|
6572
|
-
const autoScrollArmTimeoutRef =
|
|
6614
|
+
const emojiPickerRef = useRef11(null);
|
|
6615
|
+
const reactionPickerRef = useRef11(null);
|
|
6616
|
+
const chatMessagesPaneRef = useRef11(null);
|
|
6617
|
+
const pendingReadRequestsRef = useRef11(/* @__PURE__ */ new Set());
|
|
6618
|
+
const seenIncomingMessageIdsRef = useRef11(/* @__PURE__ */ new Set());
|
|
6619
|
+
const hasBootstrappedIncomingMessagesRef = useRef11(false);
|
|
6620
|
+
const wasFocusModeActiveRef = useRef11(false);
|
|
6621
|
+
const previousChatUnreadCountRef = useRef11(0);
|
|
6622
|
+
const chatIndicatorHideTimeoutRef = useRef11(null);
|
|
6623
|
+
const chatIndicatorIntroTimeoutRef = useRef11(null);
|
|
6624
|
+
const chatBadgePulseTimeoutRef = useRef11(null);
|
|
6625
|
+
const activeConversationIdRef = useRef11(null);
|
|
6626
|
+
const activeConversationMessageIdsRef = useRef11(/* @__PURE__ */ new Set());
|
|
6627
|
+
const shouldAutoScrollToBottomRef = useRef11(false);
|
|
6628
|
+
const autoScrollArmTimeoutRef = useRef11(null);
|
|
6573
6629
|
const isChatMessagesControlled = typeof chatMessages !== "undefined";
|
|
6574
6630
|
const isChatReactionsControlled = typeof chatReactions !== "undefined";
|
|
6575
6631
|
const initials = useMemo7(() => buildInitials(displayName, email), [displayName, email]);
|
|
@@ -6808,7 +6864,7 @@ var UserMenuCupcode = ({
|
|
|
6808
6864
|
});
|
|
6809
6865
|
return unreadByUser;
|
|
6810
6866
|
}, [conversationMetaByUserId]);
|
|
6811
|
-
|
|
6867
|
+
useEffect14(() => {
|
|
6812
6868
|
if (!normalizedNotificationFeed.length) return;
|
|
6813
6869
|
setNotificationReadMap((current) => {
|
|
6814
6870
|
let changed = false;
|
|
@@ -6955,37 +7011,37 @@ var UserMenuCupcode = ({
|
|
|
6955
7011
|
});
|
|
6956
7012
|
return normalized;
|
|
6957
7013
|
}, [resolvedAllChatReactions, resolvedCurrentChatUserId]);
|
|
6958
|
-
|
|
7014
|
+
useEffect14(() => {
|
|
6959
7015
|
if (!isChatMessagesControlled) return;
|
|
6960
7016
|
setInternalChatMessages(chatMessages != null ? chatMessages : []);
|
|
6961
7017
|
}, [chatMessages, isChatMessagesControlled]);
|
|
6962
|
-
|
|
7018
|
+
useEffect14(() => {
|
|
6963
7019
|
if (!isChatReactionsControlled) return;
|
|
6964
7020
|
setInternalChatReactions(chatReactions != null ? chatReactions : []);
|
|
6965
7021
|
}, [chatReactions, isChatReactionsControlled]);
|
|
6966
|
-
|
|
7022
|
+
useEffect14(() => {
|
|
6967
7023
|
setProfileAvatarUrl(avatarUrl);
|
|
6968
7024
|
}, [avatarUrl]);
|
|
6969
|
-
|
|
7025
|
+
useEffect14(() => {
|
|
6970
7026
|
if (!isLanguageControlled) return;
|
|
6971
7027
|
setInternalLanguage(normalizeLanguage(language));
|
|
6972
7028
|
}, [isLanguageControlled, language]);
|
|
6973
|
-
|
|
7029
|
+
useEffect14(() => {
|
|
6974
7030
|
persistChatSettings(chatSettings);
|
|
6975
7031
|
}, [chatSettings]);
|
|
6976
|
-
|
|
7032
|
+
useEffect14(() => {
|
|
6977
7033
|
persistExperienceSettings(experienceSettings);
|
|
6978
7034
|
}, [experienceSettings]);
|
|
6979
|
-
|
|
7035
|
+
useEffect14(() => {
|
|
6980
7036
|
persistIntegrationConnections(integrationConnections);
|
|
6981
7037
|
}, [integrationConnections]);
|
|
6982
|
-
|
|
7038
|
+
useEffect14(() => {
|
|
6983
7039
|
applyThemePreference(experienceSettings.theme);
|
|
6984
7040
|
}, [experienceSettings.theme]);
|
|
6985
|
-
|
|
7041
|
+
useEffect14(() => {
|
|
6986
7042
|
applyAccessibilityAttributes(experienceSettings);
|
|
6987
7043
|
}, [experienceSettings]);
|
|
6988
|
-
|
|
7044
|
+
useEffect14(() => {
|
|
6989
7045
|
if (experienceSettings.theme !== "system" || typeof window === "undefined") return;
|
|
6990
7046
|
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
6991
7047
|
const onSystemThemeChange = () => applyThemePreference("system");
|
|
@@ -6996,13 +7052,13 @@ var UserMenuCupcode = ({
|
|
|
6996
7052
|
media.addListener(onSystemThemeChange);
|
|
6997
7053
|
return () => media.removeListener(onSystemThemeChange);
|
|
6998
7054
|
}, [experienceSettings.theme]);
|
|
6999
|
-
|
|
7055
|
+
useEffect14(() => {
|
|
7000
7056
|
persistNotificationPreferences(notificationPreferences);
|
|
7001
7057
|
}, [notificationPreferences]);
|
|
7002
|
-
|
|
7058
|
+
useEffect14(() => {
|
|
7003
7059
|
setNotificationPermission(resolveNotificationPermission());
|
|
7004
7060
|
}, []);
|
|
7005
|
-
|
|
7061
|
+
useEffect14(() => {
|
|
7006
7062
|
if (typeof window === "undefined") return;
|
|
7007
7063
|
const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
7008
7064
|
const syncPreference = () => setPrefersReducedMotion(mediaQuery.matches);
|
|
@@ -7014,7 +7070,7 @@ var UserMenuCupcode = ({
|
|
|
7014
7070
|
mediaQuery.addListener(syncPreference);
|
|
7015
7071
|
return () => mediaQuery.removeListener(syncPreference);
|
|
7016
7072
|
}, []);
|
|
7017
|
-
|
|
7073
|
+
useEffect14(() => {
|
|
7018
7074
|
const previousCount = previousChatUnreadCountRef.current;
|
|
7019
7075
|
const nextCount = visibleChatUnreadCount;
|
|
7020
7076
|
const hadUnread = previousCount > 0;
|
|
@@ -7064,7 +7120,7 @@ var UserMenuCupcode = ({
|
|
|
7064
7120
|
}
|
|
7065
7121
|
previousChatUnreadCountRef.current = nextCount;
|
|
7066
7122
|
}, [prefersReducedMotion, visibleChatUnreadCount]);
|
|
7067
|
-
|
|
7123
|
+
useEffect14(() => {
|
|
7068
7124
|
return () => {
|
|
7069
7125
|
if (chatIndicatorHideTimeoutRef.current) window.clearTimeout(chatIndicatorHideTimeoutRef.current);
|
|
7070
7126
|
if (chatIndicatorIntroTimeoutRef.current) window.clearTimeout(chatIndicatorIntroTimeoutRef.current);
|
|
@@ -7072,7 +7128,7 @@ var UserMenuCupcode = ({
|
|
|
7072
7128
|
if (autoScrollArmTimeoutRef.current) window.clearTimeout(autoScrollArmTimeoutRef.current);
|
|
7073
7129
|
};
|
|
7074
7130
|
}, []);
|
|
7075
|
-
|
|
7131
|
+
useEffect14(() => {
|
|
7076
7132
|
if (!isAuthenticated) {
|
|
7077
7133
|
seenIncomingMessageIdsRef.current.clear();
|
|
7078
7134
|
hasBootstrappedIncomingMessagesRef.current = false;
|
|
@@ -7106,15 +7162,15 @@ var UserMenuCupcode = ({
|
|
|
7106
7162
|
}
|
|
7107
7163
|
}
|
|
7108
7164
|
}, [isAuthenticated]);
|
|
7109
|
-
|
|
7165
|
+
useEffect14(() => {
|
|
7110
7166
|
if (activeTab === "notifications") return;
|
|
7111
7167
|
if (!isNotificationsPreferencesBackVisible) return;
|
|
7112
7168
|
setIsNotificationsPreferencesBackVisible(false);
|
|
7113
7169
|
}, [activeTab, isNotificationsPreferencesBackVisible]);
|
|
7114
|
-
|
|
7170
|
+
useEffect14(() => {
|
|
7115
7171
|
setIsNotificationsExpanded(false);
|
|
7116
7172
|
}, [activeTab, notificationReadFilter, notificationTypeFilter, notificationPreferences.grouping]);
|
|
7117
|
-
|
|
7173
|
+
useEffect14(() => {
|
|
7118
7174
|
if (!notificationPreferences.focusUntil) return;
|
|
7119
7175
|
const deadline = new Date(notificationPreferences.focusUntil).getTime();
|
|
7120
7176
|
if (Number.isNaN(deadline) || deadline <= Date.now()) {
|
|
@@ -7128,7 +7184,7 @@ var UserMenuCupcode = ({
|
|
|
7128
7184
|
window.clearTimeout(timer);
|
|
7129
7185
|
};
|
|
7130
7186
|
}, [notificationPreferences.focusUntil]);
|
|
7131
|
-
|
|
7187
|
+
useEffect14(() => {
|
|
7132
7188
|
const wasFocusModeActive = wasFocusModeActiveRef.current;
|
|
7133
7189
|
if (wasFocusModeActive && !isFocusModeActive && suppressedFocusNotifications.length) {
|
|
7134
7190
|
const byType = suppressedFocusNotifications.reduce((acc, notification) => {
|
|
@@ -7158,7 +7214,7 @@ var UserMenuCupcode = ({
|
|
|
7158
7214
|
}
|
|
7159
7215
|
wasFocusModeActiveRef.current = isFocusModeActive;
|
|
7160
7216
|
}, [isFocusModeActive, suppressedFocusNotifications]);
|
|
7161
|
-
|
|
7217
|
+
useEffect14(() => {
|
|
7162
7218
|
if (!chatUsersList.length) {
|
|
7163
7219
|
setActiveChatUserId("");
|
|
7164
7220
|
return;
|
|
@@ -7169,18 +7225,18 @@ var UserMenuCupcode = ({
|
|
|
7169
7225
|
return (_b5 = (_a66 = filteredAndSortedChatUsers[0]) == null ? void 0 : _a66.id) != null ? _b5 : chatUsersList[0].id;
|
|
7170
7226
|
});
|
|
7171
7227
|
}, [chatUsersList, filteredAndSortedChatUsers]);
|
|
7172
|
-
|
|
7228
|
+
useEffect14(() => {
|
|
7173
7229
|
if (activeTab === "chat" && open) return;
|
|
7174
7230
|
setIsChatSidebarExpanded(false);
|
|
7175
7231
|
setIsChatSidebarPinned(false);
|
|
7176
7232
|
}, [activeTab, open]);
|
|
7177
|
-
|
|
7233
|
+
useEffect14(() => {
|
|
7178
7234
|
if (!(chatOpenRequest == null ? void 0 : chatOpenRequest.userId)) return;
|
|
7179
7235
|
setOpen(true);
|
|
7180
7236
|
setActiveTab("chat");
|
|
7181
7237
|
setActiveChatUserId(chatOpenRequest.userId);
|
|
7182
7238
|
}, [chatOpenRequest == null ? void 0 : chatOpenRequest.at, chatOpenRequest == null ? void 0 : chatOpenRequest.userId]);
|
|
7183
|
-
|
|
7239
|
+
useEffect14(() => {
|
|
7184
7240
|
if (!showEmojiPicker && !activeReactionPickerMessageId) return;
|
|
7185
7241
|
const onPointerDown = (event) => {
|
|
7186
7242
|
const target = event.target;
|
|
@@ -7197,7 +7253,7 @@ var UserMenuCupcode = ({
|
|
|
7197
7253
|
document.removeEventListener("mousedown", onPointerDown);
|
|
7198
7254
|
};
|
|
7199
7255
|
}, [activeReactionPickerMessageId, showEmojiPicker]);
|
|
7200
|
-
|
|
7256
|
+
useEffect14(() => {
|
|
7201
7257
|
if (!activeReactionPickerMessageId) return;
|
|
7202
7258
|
const closePicker = () => setActiveReactionPicker(null);
|
|
7203
7259
|
window.addEventListener("resize", closePicker);
|
|
@@ -7207,7 +7263,7 @@ var UserMenuCupcode = ({
|
|
|
7207
7263
|
document.removeEventListener("scroll", closePicker, true);
|
|
7208
7264
|
};
|
|
7209
7265
|
}, [activeReactionPickerMessageId]);
|
|
7210
|
-
|
|
7266
|
+
useEffect14(() => {
|
|
7211
7267
|
var _a66;
|
|
7212
7268
|
if (!hasBootstrappedIncomingMessagesRef.current && isChatLoading) return;
|
|
7213
7269
|
const knownIncomingIds = seenIncomingMessageIdsRef.current;
|
|
@@ -7378,7 +7434,7 @@ var UserMenuCupcode = ({
|
|
|
7378
7434
|
});
|
|
7379
7435
|
return items;
|
|
7380
7436
|
}, [activeChatMessages]);
|
|
7381
|
-
|
|
7437
|
+
useEffect14(() => {
|
|
7382
7438
|
var _a66;
|
|
7383
7439
|
const conversationId = (_a66 = activeChatUser == null ? void 0 : activeChatUser.id) != null ? _a66 : null;
|
|
7384
7440
|
if (!conversationId) {
|
|
@@ -7437,31 +7493,31 @@ var UserMenuCupcode = ({
|
|
|
7437
7493
|
if (!replyToMessageId) return null;
|
|
7438
7494
|
return (_a66 = activeChatMessagesMap.get(replyToMessageId)) != null ? _a66 : null;
|
|
7439
7495
|
}, [activeChatMessagesMap, replyToMessageId]);
|
|
7440
|
-
|
|
7496
|
+
useEffect14(() => {
|
|
7441
7497
|
if (!replyToMessageId) return;
|
|
7442
7498
|
if (!activeChatMessagesMap.has(replyToMessageId)) {
|
|
7443
7499
|
setReplyToMessageId(null);
|
|
7444
7500
|
}
|
|
7445
7501
|
}, [activeChatMessagesMap, replyToMessageId]);
|
|
7446
|
-
|
|
7502
|
+
useEffect14(() => {
|
|
7447
7503
|
if (!activeReactionPickerMessageId) return;
|
|
7448
7504
|
if (!activeChatMessagesMap.has(activeReactionPickerMessageId)) {
|
|
7449
7505
|
setActiveReactionPicker(null);
|
|
7450
7506
|
}
|
|
7451
7507
|
}, [activeChatMessagesMap, activeReactionPickerMessageId]);
|
|
7452
|
-
|
|
7508
|
+
useEffect14(() => {
|
|
7453
7509
|
if (!editingMessageId) return;
|
|
7454
7510
|
if (!activeChatMessagesMap.has(editingMessageId)) {
|
|
7455
7511
|
setEditingMessageId(null);
|
|
7456
7512
|
setEditingDraft("");
|
|
7457
7513
|
}
|
|
7458
7514
|
}, [activeChatMessagesMap, editingMessageId]);
|
|
7459
|
-
|
|
7515
|
+
useEffect14(() => {
|
|
7460
7516
|
if (!activeChatUser) {
|
|
7461
7517
|
setIsChatLogsDialogOpen(false);
|
|
7462
7518
|
}
|
|
7463
7519
|
}, [activeChatUser]);
|
|
7464
|
-
|
|
7520
|
+
useEffect14(() => {
|
|
7465
7521
|
var _a66;
|
|
7466
7522
|
if (!open || activeTab !== "chat" || !activeChatUser || activeChatUser.isGroup) return;
|
|
7467
7523
|
const unreadCount = (_a66 = resolvedChatUnreadByUser[activeChatUser.id]) != null ? _a66 : 0;
|
|
@@ -8158,7 +8214,7 @@ var UserMenuCupcode = ({
|
|
|
8158
8214
|
!hasTelescupAvatarSupport ? /* @__PURE__ */ jsx42("p", { className: "text-center text-xs text-muted-foreground", children: "Telescup indispon\xEDvel neste ambiente." }) : null
|
|
8159
8215
|
] }),
|
|
8160
8216
|
/* @__PURE__ */ jsxs27(DialogPrimitive3.Close, { className: "absolute right-3 top-3 inline-flex h-8 w-8 items-center justify-center rounded-full border border-border/70 bg-background/70 text-muted-foreground transition-all hover:bg-background hover:text-foreground", children: [
|
|
8161
|
-
/* @__PURE__ */ jsx42(
|
|
8217
|
+
/* @__PURE__ */ jsx42(X4, { className: "h-4 w-4" }),
|
|
8162
8218
|
/* @__PURE__ */ jsx42("span", { className: "sr-only", children: "Fechar" })
|
|
8163
8219
|
] })
|
|
8164
8220
|
] })
|
|
@@ -8373,7 +8429,7 @@ var UserMenuCupcode = ({
|
|
|
8373
8429
|
onClick: () => setIsNotificationsPreferencesBackVisible(false),
|
|
8374
8430
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-border/70 px-2 text-xs font-semibold text-foreground transition-all hover:bg-muted/45",
|
|
8375
8431
|
children: [
|
|
8376
|
-
/* @__PURE__ */ jsx42(
|
|
8432
|
+
/* @__PURE__ */ jsx42(X4, { className: "h-3 w-3" }),
|
|
8377
8433
|
"Voltar"
|
|
8378
8434
|
]
|
|
8379
8435
|
}
|
|
@@ -9063,7 +9119,7 @@ var UserMenuCupcode = ({
|
|
|
9063
9119
|
onClick: () => setReplyToMessageId(null),
|
|
9064
9120
|
className: "inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md border border-transparent text-muted-foreground transition-all hover:border-border/70 hover:bg-background/45 hover:text-foreground",
|
|
9065
9121
|
"aria-label": "Cancelar resposta",
|
|
9066
|
-
children: /* @__PURE__ */ jsx42(
|
|
9122
|
+
children: /* @__PURE__ */ jsx42(X4, { className: "h-3 w-3" })
|
|
9067
9123
|
}
|
|
9068
9124
|
)
|
|
9069
9125
|
] }) : null,
|
|
@@ -9777,7 +9833,7 @@ var UserMenuCupcode = ({
|
|
|
9777
9833
|
type: "button",
|
|
9778
9834
|
onClick: () => openChatPanel(),
|
|
9779
9835
|
className: cn(
|
|
9780
|
-
"relative z-0 inline-flex h-9 min-w-[2.55rem] origin-right items-center justify-center rounded-[12px] border border-border/70 bg-background/80 px-2.5 text-foreground shadow-[0_10px_22px_-18px_rgba(0,0,0,0.75)] transition-[transform,opacity] duration
|
|
9836
|
+
"relative z-0 inline-flex h-9 min-w-[2.55rem] origin-right items-center justify-center rounded-[12px] border border-border/70 bg-background/80 px-2.5 text-foreground shadow-[0_10px_22px_-18px_rgba(0,0,0,0.75)] transition-[transform,opacity] [transition-duration:260ms] will-change-transform",
|
|
9781
9837
|
prefersReducedMotion ? isChatIndicatorVisible ? "opacity-100" : "opacity-0" : isChatIndicatorVisible ? "translate-x-0 opacity-100" : "translate-x-[10px] opacity-0"
|
|
9782
9838
|
),
|
|
9783
9839
|
style: {
|
|
@@ -9790,7 +9846,7 @@ var UserMenuCupcode = ({
|
|
|
9790
9846
|
"span",
|
|
9791
9847
|
{
|
|
9792
9848
|
className: cn(
|
|
9793
|
-
"relative inline-flex transition-[transform,opacity] duration
|
|
9849
|
+
"relative inline-flex transition-[transform,opacity] [transition-duration:220ms]",
|
|
9794
9850
|
prefersReducedMotion ? isChatIndicatorVisible ? "scale-100 opacity-100" : "scale-100 opacity-0" : isChatIndicatorVisible ? isChatIndicatorIntroAnimating ? "scale-[1.08] opacity-100" : "scale-100 opacity-100" : "scale-[0.84] opacity-0"
|
|
9795
9851
|
),
|
|
9796
9852
|
style: {
|
|
@@ -9803,7 +9859,7 @@ var UserMenuCupcode = ({
|
|
|
9803
9859
|
"span",
|
|
9804
9860
|
{
|
|
9805
9861
|
className: cn(
|
|
9806
|
-
"absolute -right-1 -top-1 inline-flex h-4 min-w-[1rem] items-center justify-center rounded-full border border-background bg-destructive px-1 text-[9px] font-bold text-destructive-foreground transition-[transform,opacity] duration
|
|
9862
|
+
"absolute -right-1 -top-1 inline-flex h-4 min-w-[1rem] items-center justify-center rounded-full border border-background bg-destructive px-1 text-[9px] font-bold text-destructive-foreground transition-[transform,opacity] [transition-duration:180ms]",
|
|
9807
9863
|
prefersReducedMotion ? isChatIndicatorVisible ? "scale-100 opacity-100" : "scale-100 opacity-0" : isChatIndicatorVisible ? isChatBadgePulsing ? "scale-[1.14] opacity-100" : "scale-100 opacity-100" : "scale-[0.72] opacity-0"
|
|
9808
9864
|
),
|
|
9809
9865
|
style: {
|
|
@@ -9844,7 +9900,7 @@ var UserMenuCupcode = ({
|
|
|
9844
9900
|
/* @__PURE__ */ jsx42(DialogPrimitive3.Title, { className: "sr-only", children: "Menu do usu\xE1rio" }),
|
|
9845
9901
|
/* @__PURE__ */ jsx42(DialogPrimitive3.Description, { className: "sr-only", children: "Painel lateral com perfil, notifica\xE7\xF5es, chat e configura\xE7\xF5es." }),
|
|
9846
9902
|
/* @__PURE__ */ jsxs27(DialogPrimitive3.Close, { className: "absolute right-3 top-3 z-10 flex h-10 w-10 items-center justify-center rounded-full border border-border/70 bg-background/40 text-foreground transition-all hover:bg-muted/60 sm:-right-[58px]", children: [
|
|
9847
|
-
/* @__PURE__ */ jsx42(
|
|
9903
|
+
/* @__PURE__ */ jsx42(X4, { className: "h-5 w-5" }),
|
|
9848
9904
|
/* @__PURE__ */ jsx42("span", { className: "sr-only", children: "Fechar menu" })
|
|
9849
9905
|
] }),
|
|
9850
9906
|
/* @__PURE__ */ jsxs27("div", { className: "relative flex h-full flex-col p-3 sm:p-4", children: [
|
|
@@ -22453,8 +22509,8 @@ var MainNavbar = ({
|
|
|
22453
22509
|
const [accountsLanguage, setAccountsLanguage] = useState13("pt-BR");
|
|
22454
22510
|
const [accountsRecentActivity, setAccountsRecentActivity] = useState13([]);
|
|
22455
22511
|
const [isAccountsActivityLoading, setIsAccountsActivityLoading] = useState13(false);
|
|
22456
|
-
const chatMessagesRef =
|
|
22457
|
-
const chatFeatureFlagsRef =
|
|
22512
|
+
const chatMessagesRef = useRef12([]);
|
|
22513
|
+
const chatFeatureFlagsRef = useRef12(readStoredChatFeatureFlags());
|
|
22458
22514
|
const updateChatFeatureFlags = useCallback6((partial) => {
|
|
22459
22515
|
const nextFlags = {
|
|
22460
22516
|
...chatFeatureFlagsRef.current,
|
|
@@ -22484,7 +22540,7 @@ var MainNavbar = ({
|
|
|
22484
22540
|
const resolvedProfileAvatarUrl = (_b5 = (_a65 = resolveChatAvatarUrl(persistedProfileAvatarValue)) != null ? _a65 : authUser == null ? void 0 : authUser.picture) != null ? _b5 : void 0;
|
|
22485
22541
|
const effectiveCurrentUserId = resolvedSenderId != null ? resolvedSenderId : currentUserId;
|
|
22486
22542
|
const isAuthenticated = authStatus === "authenticated";
|
|
22487
|
-
|
|
22543
|
+
useEffect16(() => {
|
|
22488
22544
|
if (!isAuthenticated) {
|
|
22489
22545
|
setResolvedSenderId(null);
|
|
22490
22546
|
setPersistedProfileAvatarValue(void 0);
|
|
@@ -22563,7 +22619,7 @@ var MainNavbar = ({
|
|
|
22563
22619
|
canceled = true;
|
|
22564
22620
|
};
|
|
22565
22621
|
}, [authEmail, currentUserId, isAuthenticated]);
|
|
22566
|
-
|
|
22622
|
+
useEffect16(() => {
|
|
22567
22623
|
if (!isAuthenticated) return;
|
|
22568
22624
|
if (typeof window === "undefined") return;
|
|
22569
22625
|
const controller = new AbortController();
|
|
@@ -22639,10 +22695,10 @@ var MainNavbar = ({
|
|
|
22639
22695
|
controller.abort();
|
|
22640
22696
|
};
|
|
22641
22697
|
}, [getAccessToken, isAuthenticated, currentUserId]);
|
|
22642
|
-
|
|
22698
|
+
useEffect16(() => {
|
|
22643
22699
|
chatMessagesRef.current = chatMessages;
|
|
22644
22700
|
}, [chatMessages]);
|
|
22645
|
-
|
|
22701
|
+
useEffect16(() => {
|
|
22646
22702
|
if (!isAuthenticated) {
|
|
22647
22703
|
setChatUsers([]);
|
|
22648
22704
|
setChatMessages([]);
|
|
@@ -23015,7 +23071,7 @@ var MainNavbar = ({
|
|
|
23015
23071
|
canceled = true;
|
|
23016
23072
|
};
|
|
23017
23073
|
}, [effectiveCurrentUserId, isAuthenticated, isChatSuperAdmin, updateChatFeatureFlags]);
|
|
23018
|
-
|
|
23074
|
+
useEffect16(() => {
|
|
23019
23075
|
if (!isAuthenticated || !effectiveCurrentUserId) return;
|
|
23020
23076
|
const supabase = getSupabase();
|
|
23021
23077
|
if (!supabase) return;
|
|
@@ -23894,15 +23950,15 @@ var MainNavbar = ({
|
|
|
23894
23950
|
};
|
|
23895
23951
|
|
|
23896
23952
|
// src/components/cupcode/ParticleSystem.tsx
|
|
23897
|
-
import { useEffect as
|
|
23953
|
+
import { useEffect as useEffect17, useRef as useRef13 } from "react";
|
|
23898
23954
|
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
23899
23955
|
function ParticleSystem({
|
|
23900
23956
|
count: count2 = 50,
|
|
23901
23957
|
variant = "stars",
|
|
23902
23958
|
className
|
|
23903
23959
|
}) {
|
|
23904
|
-
const canvasRef =
|
|
23905
|
-
|
|
23960
|
+
const canvasRef = useRef13(null);
|
|
23961
|
+
useEffect17(() => {
|
|
23906
23962
|
const canvas = canvasRef.current;
|
|
23907
23963
|
if (!canvas) return;
|
|
23908
23964
|
const ctx = canvas.getContext("2d");
|
|
@@ -24549,7 +24605,7 @@ function Timeline({ items, variant = "vertical", className }) {
|
|
|
24549
24605
|
}
|
|
24550
24606
|
|
|
24551
24607
|
// src/components/cupcode/ToastCupcode.tsx
|
|
24552
|
-
import { X as
|
|
24608
|
+
import { X as X5, CheckCircle, AlertCircle, Info as Info2, AlertTriangle as AlertTriangle2 } from "lucide-react";
|
|
24553
24609
|
import { jsx as jsx56, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
24554
24610
|
var variantStyles2 = {
|
|
24555
24611
|
success: {
|
|
@@ -24608,7 +24664,7 @@ var ToastCupcode = ({
|
|
|
24608
24664
|
{
|
|
24609
24665
|
onClick: onClose,
|
|
24610
24666
|
className: "shrink-0 rounded-md p-1 hover:bg-cupcode-ink/10 transition-colors",
|
|
24611
|
-
children: /* @__PURE__ */ jsx56(
|
|
24667
|
+
children: /* @__PURE__ */ jsx56(X5, { className: "h-4 w-4 text-cupcode-ink/50" })
|
|
24612
24668
|
}
|
|
24613
24669
|
)
|
|
24614
24670
|
] })
|
|
@@ -25986,7 +26042,7 @@ Separator5.displayName = SeparatorPrimitive.Root.displayName;
|
|
|
25986
26042
|
// src/components/ui/sheet.tsx
|
|
25987
26043
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
25988
26044
|
import { cva as cva6 } from "class-variance-authority";
|
|
25989
|
-
import { X as
|
|
26045
|
+
import { X as X6 } from "lucide-react";
|
|
25990
26046
|
import * as React56 from "react";
|
|
25991
26047
|
import { jsx as jsx79, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
25992
26048
|
var Sheet = SheetPrimitive.Root;
|
|
@@ -26022,14 +26078,31 @@ var sheetVariants = cva6(
|
|
|
26022
26078
|
}
|
|
26023
26079
|
);
|
|
26024
26080
|
var SheetContent = React56.forwardRef(
|
|
26025
|
-
({
|
|
26081
|
+
({
|
|
26082
|
+
side = "right",
|
|
26083
|
+
className,
|
|
26084
|
+
children,
|
|
26085
|
+
showCloseButton = false,
|
|
26086
|
+
closeButtonClassName,
|
|
26087
|
+
closeButtonLabel = "Close",
|
|
26088
|
+
...props
|
|
26089
|
+
}, ref) => /* @__PURE__ */ jsxs47(SheetPortal, { children: [
|
|
26026
26090
|
/* @__PURE__ */ jsx79(SheetOverlay, {}),
|
|
26027
26091
|
/* @__PURE__ */ jsxs47(SheetPrimitive.Content, { ref, className: cn(sheetVariants({ side }), className), ...props, children: [
|
|
26028
26092
|
children,
|
|
26029
|
-
/* @__PURE__ */ jsxs47(
|
|
26030
|
-
|
|
26031
|
-
|
|
26032
|
-
|
|
26093
|
+
showCloseButton ? /* @__PURE__ */ jsxs47(
|
|
26094
|
+
SheetPrimitive.Close,
|
|
26095
|
+
{
|
|
26096
|
+
className: cn(
|
|
26097
|
+
"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",
|
|
26098
|
+
closeButtonClassName
|
|
26099
|
+
),
|
|
26100
|
+
children: [
|
|
26101
|
+
/* @__PURE__ */ jsx79(X6, { className: "h-4 w-4" }),
|
|
26102
|
+
/* @__PURE__ */ jsx79("span", { className: "sr-only", children: closeButtonLabel })
|
|
26103
|
+
]
|
|
26104
|
+
}
|
|
26105
|
+
) : null
|
|
26033
26106
|
] })
|
|
26034
26107
|
] })
|
|
26035
26108
|
);
|
|
@@ -26160,7 +26233,7 @@ var Sidebar = React58.forwardRef(({ side = "left", variant = "sidebar", collapsi
|
|
|
26160
26233
|
{
|
|
26161
26234
|
"data-sidebar": "sidebar",
|
|
26162
26235
|
"data-mobile": "true",
|
|
26163
|
-
className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground
|
|
26236
|
+
className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground",
|
|
26164
26237
|
style: {
|
|
26165
26238
|
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
26166
26239
|
},
|
|
@@ -26632,7 +26705,7 @@ TableCaption.displayName = "TableCaption";
|
|
|
26632
26705
|
import * as React61 from "react";
|
|
26633
26706
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
26634
26707
|
import { cva as cva8 } from "class-variance-authority";
|
|
26635
|
-
import { X as
|
|
26708
|
+
import { X as X7 } from "lucide-react";
|
|
26636
26709
|
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
26637
26710
|
var ToastProvider = ToastPrimitives.Provider;
|
|
26638
26711
|
var ToastViewport = React61.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx83(
|
|
@@ -26691,7 +26764,7 @@ var ToastClose = React61.forwardRef(({ className, onClick, ...props }, ref) => /
|
|
|
26691
26764
|
},
|
|
26692
26765
|
"toast-close": "",
|
|
26693
26766
|
...props,
|
|
26694
|
-
children: /* @__PURE__ */ jsx83(
|
|
26767
|
+
children: /* @__PURE__ */ jsx83(X7, { className: "h-4 w-4" })
|
|
26695
26768
|
}
|
|
26696
26769
|
));
|
|
26697
26770
|
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
@@ -26778,11 +26851,11 @@ var ToggleGroupItem = React63.forwardRef(({ className, children, variant, size,
|
|
|
26778
26851
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
26779
26852
|
|
|
26780
26853
|
// src/hooks/useActiveSection.ts
|
|
26781
|
-
import { useEffect as
|
|
26854
|
+
import { useEffect as useEffect23, useState as useState18 } from "react";
|
|
26782
26855
|
var useActiveSection = (sectionIds, offset = 180) => {
|
|
26783
26856
|
var _a65;
|
|
26784
26857
|
const [activeId, setActiveId] = useState18((_a65 = sectionIds[0]) != null ? _a65 : "");
|
|
26785
|
-
|
|
26858
|
+
useEffect23(() => {
|
|
26786
26859
|
if (!sectionIds.length || typeof window === "undefined") return;
|
|
26787
26860
|
const update = () => {
|
|
26788
26861
|
let nextActive = sectionIds[0];
|
|
@@ -26809,7 +26882,7 @@ var useActiveSection = (sectionIds, offset = 180) => {
|
|
|
26809
26882
|
};
|
|
26810
26883
|
|
|
26811
26884
|
// src/lib/auth.tsx
|
|
26812
|
-
import { createContext as createContext6, useCallback as useCallback9, useContext as useContext7, useEffect as
|
|
26885
|
+
import { createContext as createContext6, useCallback as useCallback9, useContext as useContext7, useEffect as useEffect24, useMemo as useMemo11, useRef as useRef14, useState as useState19 } from "react";
|
|
26813
26886
|
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
26814
26887
|
var STORAGE_KEYS = {
|
|
26815
26888
|
accessToken: "cc_access_token",
|
|
@@ -26912,13 +26985,13 @@ var AuthProvider = ({ children }) => {
|
|
|
26912
26985
|
const [accessToken, setAccessToken] = useState19(null);
|
|
26913
26986
|
const [user, setUser] = useState19(null);
|
|
26914
26987
|
const [presenceStatus, setPresenceStatusState] = useState19(() => readStoredPresence());
|
|
26915
|
-
const presenceStatusRef =
|
|
26916
|
-
const presenceSourceRef =
|
|
26917
|
-
const lastManualPresenceRef =
|
|
26988
|
+
const presenceStatusRef = useRef14(readStoredPresence());
|
|
26989
|
+
const presenceSourceRef = useRef14(readStoredPresenceSource());
|
|
26990
|
+
const lastManualPresenceRef = useRef14(
|
|
26918
26991
|
readStoredPresence() === "offline" ? DEFAULT_PRESENCE_STATUS : readStoredPresence()
|
|
26919
26992
|
);
|
|
26920
|
-
const lastActivityAtRef =
|
|
26921
|
-
const lastActivityBroadcastAtRef =
|
|
26993
|
+
const lastActivityAtRef = useRef14(Date.now());
|
|
26994
|
+
const lastActivityBroadcastAtRef = useRef14(0);
|
|
26922
26995
|
const storePresenceStatus = useCallback9((nextStatus) => {
|
|
26923
26996
|
setPresenceStatusState(nextStatus);
|
|
26924
26997
|
presenceStatusRef.current = nextStatus;
|
|
@@ -27038,7 +27111,7 @@ var AuthProvider = ({ children }) => {
|
|
|
27038
27111
|
});
|
|
27039
27112
|
return true;
|
|
27040
27113
|
}, [startAuthorization]);
|
|
27041
|
-
|
|
27114
|
+
useEffect24(() => {
|
|
27042
27115
|
let cancelled = false;
|
|
27043
27116
|
const initializeAuth = async () => {
|
|
27044
27117
|
var _a65;
|
|
@@ -27075,11 +27148,11 @@ var AuthProvider = ({ children }) => {
|
|
|
27075
27148
|
cancelled = true;
|
|
27076
27149
|
};
|
|
27077
27150
|
}, [attemptSilentLogin]);
|
|
27078
|
-
|
|
27151
|
+
useEffect24(() => {
|
|
27079
27152
|
if (status !== "authenticated") return;
|
|
27080
27153
|
void loadPresenceFromDatabase(user);
|
|
27081
27154
|
}, [loadPresenceFromDatabase, status, user]);
|
|
27082
|
-
|
|
27155
|
+
useEffect24(() => {
|
|
27083
27156
|
var _a65;
|
|
27084
27157
|
if (status !== "authenticated") return;
|
|
27085
27158
|
const initialFromStorage = Number((_a65 = localStorage.getItem(LOCAL_STORAGE_KEYS.lastActivityAt)) != null ? _a65 : "0");
|