@collabchron/notiq 1.1.12 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AICommandBarPlugin-ZEC755KY.mjs +27 -0
- package/dist/{AIDialog-RHRYHSVN.mjs → AIDialog-HJW6PQPR.mjs} +11 -12
- package/dist/{AudioComponent-CKLMLB5T.mjs → AudioComponent-W5XMZPQB.mjs} +10 -6
- package/dist/{DynamicBlockComponent-2LOADZUX.mjs → DynamicBlockComponent-CHRL2GAQ.mjs} +7 -6
- package/dist/{EquationComponent-4NFG55NQ.mjs → EquationComponent-GNQHG53L.mjs} +26 -7
- package/dist/{ExcalidrawComponent-BMSYIPP6.mjs → ExcalidrawComponent-POMYXDSG.mjs} +33 -6
- package/dist/{FileComponent-Y56MX5QD.mjs → FileComponent-EOVCH4V5.mjs} +9 -5
- package/dist/{HintComponet-ET7M2Q7S.mjs → HintComponet-QXL5ESND.mjs} +32 -8
- package/dist/{InlineImageComponent-FVTA4LXZ.mjs → InlineImageComponent-KDN3VGZC.mjs} +8 -3
- package/dist/{StoryBuilderComponent-JN4ZPZOW.mjs → StoryBuilderComponent-CBRFPFTR.mjs} +8 -9
- package/dist/{chunk-6UVNHT3T.mjs → chunk-4SYRK2NH.mjs} +23 -1
- package/dist/chunk-5CJZC5IB.mjs +9086 -0
- package/dist/{chunk-FO7M3X2B.mjs → chunk-6NK5DONB.mjs} +1 -1
- package/dist/{chunk-N6ILV6NF.mjs → chunk-ACW4DLVO.mjs} +21 -7
- package/dist/chunk-BCGD2YXP.mjs +574 -0
- package/dist/{chunk-TC3IISJZ.mjs → chunk-BTR3TPIN.mjs} +18 -5
- package/dist/{chunk-ZYJ7KABY.mjs → chunk-CQCS5YPS.mjs} +3 -5
- package/dist/{chunk-T2UBAZ66.mjs → chunk-D4UBNSUW.mjs} +1 -1
- package/dist/{chunk-KNW2CGIP.mjs → chunk-DBRZIA43.mjs} +4 -1
- package/dist/{chunk-CDAMHK63.mjs → chunk-GJK2L7ZM.mjs} +23 -2
- package/dist/{chunk-ELBTVBTS.mjs → chunk-IKYVBTCJ.mjs} +43 -20
- package/dist/chunk-IXRA5D53.mjs +10447 -0
- package/dist/{chunk-W6VQSFE5.mjs → chunk-J2CEQXG4.mjs} +1 -1
- package/dist/{chunk-43Z4Z2KD.mjs → chunk-JTNLN4JI.mjs} +1 -1
- package/dist/{chunk-OE5JRLCN.mjs → chunk-ONOHG5NB.mjs} +6 -4
- package/dist/{chunk-QNIY45SF.mjs → chunk-OO42URWA.mjs} +27 -6
- package/dist/chunk-PBVRSNGU.mjs +129 -0
- package/dist/chunk-QCS57TIF.mjs +1794 -0
- package/dist/chunk-RNEIJRUS.mjs +60 -0
- package/dist/chunk-TJPTGECP.mjs +1556 -0
- package/dist/{chunk-XYMXGU4T.mjs → chunk-TMYRA2W4.mjs} +1 -1
- package/dist/{chunk-ZFV2HGD3.mjs → chunk-UNEFOZTS.mjs} +1 -1
- package/dist/chunk-X4NI7EQS.mjs +282 -0
- package/dist/{chunk-5D4JF3ZZ.mjs → chunk-XAJ4GACN.mjs} +171 -49
- package/dist/{chunk-7QRJVZQY.mjs → chunk-YVUQRJVV.mjs} +63 -18
- package/dist/components/editor/index.d.ts +1 -1
- package/dist/components/editor/nodes/EquationNode/EquationNode.d.ts +1 -0
- package/dist/components/editor/nodes/Hint/index.d.ts +2 -1
- package/dist/components/editor/plugins/AICommandBarPlugin/index.d.ts +73 -1
- package/dist/components/editor/plugins/DraggableBlockPlugin/index.d.ts +25 -3
- package/dist/components/editor/plugins/InlineCopilotPlugin/index.d.ts +16 -3
- package/dist/components/editor/plugins/LinkWithMetaData/index.d.ts +20 -25
- package/dist/components/editor/plugins/MarkdownPastePlugin/index.d.ts +5 -0
- package/dist/components/editor/plugins/MarkdownTransformers/index.d.ts +2 -0
- package/dist/components/editor/plugins/SlashCommand/index.d.ts +18 -1
- package/dist/components/editor/plugins/SmartTypographyPlugin/index.d.ts +26 -0
- package/dist/components/editor/utils/aiStream.d.ts +27 -0
- package/dist/components/editor/utils/excalidrawDiagramBuilder.d.ts +29 -0
- package/dist/components/editor/utils/markdownTransformers.d.ts +4 -1
- package/dist/components/editor/utils/url.d.ts +16 -4
- package/dist/components/providers/AIContext.d.ts +8 -0
- package/dist/components/ui/equation/equationTypography.d.ts +23 -0
- package/dist/core/extension.d.ts +3 -1
- package/dist/core/extensions/blocks-kit.d.ts +22 -1
- package/dist/core/extensions/copilot-and-collab.d.ts +15 -1
- package/dist/core/react/NotiqContent.d.ts +4 -1
- package/dist/core/react/index.d.ts +1 -0
- package/dist/core/react/node-renderers.d.ts +73 -0
- package/dist/core.js +15429 -13116
- package/dist/core.mjs +47 -39
- package/dist/hooks/instructions-messages.d.ts +13 -4
- package/dist/{image-QPB2CVXP.mjs → image-AL6PHM2A.mjs} +17 -12
- package/dist/index.js +15526 -13194
- package/dist/index.mjs +64 -60
- package/dist/{insert-audio-I3PD6JFS.mjs → insert-audio-CRWR7EO5.mjs} +4 -6
- package/dist/{insert-file-PHR7XL4V.mjs → insert-file-I73AZW3L.mjs} +4 -6
- package/dist/{insert-gif-R5ZO4JHC.mjs → insert-gif-KWRC3ACT.mjs} +1 -1
- package/dist/{insert-image-PLBZELHK.mjs → insert-image-XIY6BGW5.mjs} +4 -3
- package/dist/{insert-poll-6BCIFY5G.mjs → insert-poll-J5YVZNZ4.mjs} +4 -3
- package/dist/{insert-table-ZRJP6X52.mjs → insert-table-OIMJRFFK.mjs} +1 -1
- package/dist/{poll-component-VHMM5KKZ.mjs → poll-component-TVHXIKGQ.mjs} +3 -2
- package/dist/react.js +14747 -12554
- package/dist/react.mjs +40 -38
- package/dist/{stepper-KNITDVLG.mjs → stepper-ILF7YXTO.mjs} +63 -73
- package/dist/styles/notiq.css +1 -1
- package/package.json +2 -2
- package/src/styles/notiq.css +20 -0
- package/dist/AICommandBarPlugin-TADJ3X2Y.mjs +0 -12
- package/dist/CodeActionMenuPlugin-FGH6HZLL.mjs +0 -14
- package/dist/CollaborationPlugin-TIZOQBUT.mjs +0 -405
- package/dist/CollaboratorsBar-AMPIAUOY.mjs +0 -20
- package/dist/CommentsPlugin-SDJJTUGK.mjs +0 -19
- package/dist/ExcalidrawPlugin-QLPGJPSX.mjs +0 -14
- package/dist/ExportPlugin-MJHYKQZJ.mjs +0 -43
- package/dist/FloatingLinkEditorPlugin-MABB34L7.mjs +0 -12
- package/dist/FloatingTextFormatToolbarPlugin-BXCPN3KD.mjs +0 -45
- package/dist/InlineCopilotPlugin-PNS5Y6OO.mjs +0 -360
- package/dist/MobileToolbar-KV5DX4ED.mjs +0 -982
- package/dist/SlashCommand-SPR7G5EI.mjs +0 -39
- package/dist/TableCellActionMenuPlugin-YWBA64J7.mjs +0 -838
- package/dist/TableHoverActionsPlugin-2EIXHEXN.mjs +0 -265
- package/dist/TemplatePlugin-HNTPEXBB.mjs +0 -9
- package/dist/ToolbarPlugin-F52PVNXU.mjs +0 -823
- package/dist/VersionHistoryPlugin-YWGCREKA.mjs +0 -371
- package/dist/background-color-RW5JYLMG.mjs +0 -425
- package/dist/block-format-TODFREE2.mjs +0 -14
- package/dist/chunk-22ZIL6NH.mjs +0 -88
- package/dist/chunk-2LNT36RL.mjs +0 -555
- package/dist/chunk-37LC44W3.mjs +0 -2677
- package/dist/chunk-3IILA3IP.mjs +0 -28
- package/dist/chunk-4DVIYZVB.mjs +0 -193
- package/dist/chunk-4FFTOZGJ.mjs +0 -103
- package/dist/chunk-4UMUPCDK.mjs +0 -68
- package/dist/chunk-6D6QLRYR.mjs +0 -238
- package/dist/chunk-6FQFPPLG.mjs +0 -785
- package/dist/chunk-ACV47ZKE.mjs +0 -201
- package/dist/chunk-BGV62GC2.mjs +0 -26
- package/dist/chunk-C4JWLBYN.mjs +0 -132
- package/dist/chunk-CLRSETYQ.mjs +0 -431
- package/dist/chunk-D3IOUQFR.mjs +0 -441
- package/dist/chunk-EEBA6OAH.mjs +0 -59
- package/dist/chunk-EIZMKFHF.mjs +0 -32
- package/dist/chunk-ENH2IOHI.mjs +0 -1828
- package/dist/chunk-EVPWKNE4.mjs +0 -27
- package/dist/chunk-HOZ4QRFV.mjs +0 -536
- package/dist/chunk-IAFCQV3Z.mjs +0 -349
- package/dist/chunk-J6ZUY5BY.mjs +0 -202
- package/dist/chunk-K5OAFEVY.mjs +0 -191
- package/dist/chunk-KXRLARGI.mjs +0 -26
- package/dist/chunk-LBGM4VVZ.mjs +0 -409
- package/dist/chunk-LLGVCM7M.mjs +0 -809
- package/dist/chunk-LU2XWLOE.mjs +0 -219
- package/dist/chunk-LVRJM45C.mjs +0 -171
- package/dist/chunk-MSAO3YFB.mjs +0 -144
- package/dist/chunk-N3KDPSRI.mjs +0 -496
- package/dist/chunk-OXWTZV3U.mjs +0 -174
- package/dist/chunk-PD5K4AGP.mjs +0 -64
- package/dist/chunk-PFH63ZU4.mjs +0 -33
- package/dist/chunk-R7WFRENU.mjs +0 -262
- package/dist/chunk-RAVYEEIC.mjs +0 -36
- package/dist/chunk-RJQTA6HG.mjs +0 -358
- package/dist/chunk-SAOJHVPE.mjs +0 -153
- package/dist/chunk-SYUCM5G5.mjs +0 -111
- package/dist/chunk-VGAX6YEY.mjs +0 -399
- package/dist/chunk-VNDDDXGH.mjs +0 -682
- package/dist/chunk-WUVIQCX7.mjs +0 -944
- package/dist/chunk-XNJNT6PC.mjs +0 -1701
- package/dist/chunk-XYLTLGY5.mjs +0 -775
- package/dist/chunk-ZKZ7MLSS.mjs +0 -165
- package/dist/color-S55XFDYQ.mjs +0 -13
- package/dist/font-IJKFR4BM.mjs +0 -12
- package/dist/font-size-3HMJHKO2.mjs +0 -15
- package/dist/insert-node-DGCZBGKG.mjs +0 -243
- package/dist/table-dropdown-4VCRSQB6.mjs +0 -391
- package/dist/text-align-TEB4S52S.mjs +0 -121
- package/dist/text-format-T3IY7FBI.mjs +0 -15
package/dist/chunk-VNDDDXGH.mjs
DELETED
|
@@ -1,682 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useVersionHistory
|
|
3
|
-
} from "./chunk-J6ZUY5BY.mjs";
|
|
4
|
-
import {
|
|
5
|
-
useComments
|
|
6
|
-
} from "./chunk-R7WFRENU.mjs";
|
|
7
|
-
import {
|
|
8
|
-
COLLAB_COLORS,
|
|
9
|
-
COLLAB_SERVER_PRESETS,
|
|
10
|
-
useCollab
|
|
11
|
-
} from "./chunk-RJQTA6HG.mjs";
|
|
12
|
-
import {
|
|
13
|
-
Label
|
|
14
|
-
} from "./chunk-PFH63ZU4.mjs";
|
|
15
|
-
import {
|
|
16
|
-
Input
|
|
17
|
-
} from "./chunk-5NRAXWYA.mjs";
|
|
18
|
-
import {
|
|
19
|
-
Button,
|
|
20
|
-
Tooltip,
|
|
21
|
-
TooltipContent,
|
|
22
|
-
TooltipProvider,
|
|
23
|
-
TooltipTrigger
|
|
24
|
-
} from "./chunk-OE5JRLCN.mjs";
|
|
25
|
-
import {
|
|
26
|
-
Popover,
|
|
27
|
-
PopoverContent,
|
|
28
|
-
PopoverTrigger
|
|
29
|
-
} from "./chunk-IIVB6JNE.mjs";
|
|
30
|
-
import {
|
|
31
|
-
cn
|
|
32
|
-
} from "./chunk-JHXDLYEV.mjs";
|
|
33
|
-
import {
|
|
34
|
-
init_react_shim
|
|
35
|
-
} from "./chunk-WYCFGRFJ.mjs";
|
|
36
|
-
|
|
37
|
-
// src/components/editor/plugins/CollaborationPlugin/CollaboratorsBar.tsx
|
|
38
|
-
init_react_shim();
|
|
39
|
-
import React, { useState } from "react";
|
|
40
|
-
import {
|
|
41
|
-
Wifi,
|
|
42
|
-
WifiOff,
|
|
43
|
-
Check,
|
|
44
|
-
Share2,
|
|
45
|
-
Settings2,
|
|
46
|
-
Sparkles,
|
|
47
|
-
HardDrive,
|
|
48
|
-
MessageSquare,
|
|
49
|
-
History,
|
|
50
|
-
ArrowDownUp,
|
|
51
|
-
RefreshCw,
|
|
52
|
-
Database
|
|
53
|
-
} from "lucide-react";
|
|
54
|
-
import { toast } from "sonner";
|
|
55
|
-
import { motion, AnimatePresence } from "framer-motion";
|
|
56
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
57
|
-
var AVATAR_PRESETS = [
|
|
58
|
-
"\u{1F98A}",
|
|
59
|
-
"\u{1F680}",
|
|
60
|
-
"\u{1F4A1}",
|
|
61
|
-
"\u{1F3A8}",
|
|
62
|
-
"\u26A1",
|
|
63
|
-
"\u{1F340}",
|
|
64
|
-
"\u{1F989}",
|
|
65
|
-
"\u{1F48E}",
|
|
66
|
-
"\u{1F431}",
|
|
67
|
-
"\u{1F43C}",
|
|
68
|
-
"\u{1F31F}",
|
|
69
|
-
"\u{1F525}"
|
|
70
|
-
];
|
|
71
|
-
function formatLastSavedRelative(timestamp) {
|
|
72
|
-
if (!timestamp) return "Never";
|
|
73
|
-
const sec = Math.floor((Date.now() - timestamp) / 1e3);
|
|
74
|
-
if (sec < 5) return "Just now";
|
|
75
|
-
if (sec < 60) return `${sec}s ago`;
|
|
76
|
-
const min = Math.floor(sec / 60);
|
|
77
|
-
if (min < 60) return `${min}m ago`;
|
|
78
|
-
return `${Math.floor(min / 60)}h ago`;
|
|
79
|
-
}
|
|
80
|
-
function getInitials(name) {
|
|
81
|
-
const parts = name.trim().split(/\s+/);
|
|
82
|
-
if (parts.length >= 2) {
|
|
83
|
-
return (parts[0][0] + parts[1][0]).toUpperCase();
|
|
84
|
-
}
|
|
85
|
-
return name.slice(0, 2).toUpperCase();
|
|
86
|
-
}
|
|
87
|
-
function CollaboratorsBar({
|
|
88
|
-
className,
|
|
89
|
-
showRoomInfo = true
|
|
90
|
-
}) {
|
|
91
|
-
const {
|
|
92
|
-
enabled,
|
|
93
|
-
toggleEnabled,
|
|
94
|
-
status,
|
|
95
|
-
users,
|
|
96
|
-
docId,
|
|
97
|
-
serverUrl,
|
|
98
|
-
setServerUrl,
|
|
99
|
-
username,
|
|
100
|
-
cursorColor,
|
|
101
|
-
avatar,
|
|
102
|
-
offlineStorageStatus,
|
|
103
|
-
updateUser,
|
|
104
|
-
isOnline,
|
|
105
|
-
pendingUpdatesCount,
|
|
106
|
-
lastSavedTimestamp,
|
|
107
|
-
reconnectCountdown,
|
|
108
|
-
manualReconnect,
|
|
109
|
-
clearLocalPersistence
|
|
110
|
-
} = useCollab();
|
|
111
|
-
const { toggleSidebar, isSidebarOpen, unresolvedCount } = useComments();
|
|
112
|
-
const { toggleDrawer: toggleHistoryDrawer, isDrawerOpen: isHistoryDrawerOpen } = useVersionHistory();
|
|
113
|
-
const [copied, setCopied] = useState(false);
|
|
114
|
-
const [mounted, setMounted] = useState(false);
|
|
115
|
-
const [editingName, setEditingName] = useState(username);
|
|
116
|
-
const [selectedColor, setSelectedColor] = useState(cursorColor);
|
|
117
|
-
const [selectedAvatar, setSelectedAvatar] = useState(avatar || "");
|
|
118
|
-
const [customServer, setCustomServer] = useState(serverUrl);
|
|
119
|
-
React.useEffect(() => {
|
|
120
|
-
setMounted(true);
|
|
121
|
-
}, []);
|
|
122
|
-
React.useEffect(() => {
|
|
123
|
-
setEditingName((prev) => prev !== username ? username : prev);
|
|
124
|
-
}, [username]);
|
|
125
|
-
React.useEffect(() => {
|
|
126
|
-
setSelectedColor((prev) => prev !== cursorColor ? cursorColor : prev);
|
|
127
|
-
}, [cursorColor]);
|
|
128
|
-
React.useEffect(() => {
|
|
129
|
-
setSelectedAvatar((prev) => prev !== (avatar || "") ? avatar || "" : prev);
|
|
130
|
-
}, [avatar]);
|
|
131
|
-
React.useEffect(() => {
|
|
132
|
-
setCustomServer((prev) => prev !== serverUrl ? serverUrl : prev);
|
|
133
|
-
}, [serverUrl]);
|
|
134
|
-
const handleCopyLink = () => {
|
|
135
|
-
if (typeof window === "undefined") return;
|
|
136
|
-
const url = new URL(window.location.href);
|
|
137
|
-
url.searchParams.set("room", docId);
|
|
138
|
-
url.searchParams.set("collab", "true");
|
|
139
|
-
if (serverUrl) {
|
|
140
|
-
url.searchParams.set("server", serverUrl);
|
|
141
|
-
}
|
|
142
|
-
navigator.clipboard.writeText(url.toString()).then(() => {
|
|
143
|
-
setCopied(true);
|
|
144
|
-
toast.success("Collaboration link copied to clipboard!", {
|
|
145
|
-
description: `Invite collaborators to join room: ${docId} on ${serverUrl.includes("localhost") ? "Local server" : "Public Cloud"}`
|
|
146
|
-
});
|
|
147
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
148
|
-
});
|
|
149
|
-
};
|
|
150
|
-
const handleSaveProfile = (e) => {
|
|
151
|
-
e.preventDefault();
|
|
152
|
-
updateUser(editingName, selectedColor, selectedAvatar);
|
|
153
|
-
if (customServer && customServer !== serverUrl) {
|
|
154
|
-
setServerUrl(customServer);
|
|
155
|
-
toast.success("Server endpoint updated", {
|
|
156
|
-
description: `Connected to ${customServer}`
|
|
157
|
-
});
|
|
158
|
-
} else {
|
|
159
|
-
toast.success("Profile updated", {
|
|
160
|
-
description: `Collaborating as ${editingName}`
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
const maxVisibleAvatars = 4;
|
|
165
|
-
const visibleUsers = users.slice(0, maxVisibleAvatars);
|
|
166
|
-
const remainingCount = users.length - maxVisibleAvatars;
|
|
167
|
-
const typingUsers = users.filter((u) => !u.isSelf && u.isTyping);
|
|
168
|
-
if (!mounted) {
|
|
169
|
-
return /* @__PURE__ */ jsxs(
|
|
170
|
-
"div",
|
|
171
|
-
{
|
|
172
|
-
className: cn(
|
|
173
|
-
"inline-flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3 py-1 sm:py-1.5 rounded-full",
|
|
174
|
-
"bg-background/80 backdrop-blur-md border border-border/60 shadow-sm",
|
|
175
|
-
"text-xs font-medium transition-all duration-200 select-none opacity-60",
|
|
176
|
-
className
|
|
177
|
-
),
|
|
178
|
-
children: [
|
|
179
|
-
/* @__PURE__ */ jsx("span", { className: "h-2 w-2 rounded-full bg-slate-400" }),
|
|
180
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs font-medium", children: "Collab" })
|
|
181
|
-
]
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
return /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 150, children: /* @__PURE__ */ jsxs(
|
|
186
|
-
"div",
|
|
187
|
-
{
|
|
188
|
-
className: cn(
|
|
189
|
-
"inline-flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3 py-1 sm:py-1.5 rounded-full",
|
|
190
|
-
"bg-background/80 backdrop-blur-md border border-border/60 shadow-sm",
|
|
191
|
-
"text-xs font-medium transition-all duration-200 select-none",
|
|
192
|
-
className
|
|
193
|
-
),
|
|
194
|
-
children: [
|
|
195
|
-
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
196
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
197
|
-
"button",
|
|
198
|
-
{
|
|
199
|
-
type: "button",
|
|
200
|
-
onClick: () => {
|
|
201
|
-
if (status === "disconnected" || status === "offline") {
|
|
202
|
-
manualReconnect();
|
|
203
|
-
} else {
|
|
204
|
-
toggleEnabled();
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
className: cn(
|
|
208
|
-
"flex items-center gap-1.5 px-2 py-0.5 rounded-full transition-all cursor-pointer select-none",
|
|
209
|
-
status === "connected" && "hover:bg-emerald-500/10",
|
|
210
|
-
status === "connecting" && "bg-amber-500/10 text-amber-600 dark:text-amber-400",
|
|
211
|
-
(status === "disconnected" || status === "offline") && "hover:bg-muted/80 text-muted-foreground"
|
|
212
|
-
),
|
|
213
|
-
"aria-label": status === "connected" ? "Collaboration connected. Click to pause sync" : "Click to reconnect collaboration",
|
|
214
|
-
children: [
|
|
215
|
-
status === "connected" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
216
|
-
/* @__PURE__ */ jsxs("span", { className: "relative flex h-2 w-2", children: [
|
|
217
|
-
/* @__PURE__ */ jsx("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75" }),
|
|
218
|
-
/* @__PURE__ */ jsx("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-emerald-500" })
|
|
219
|
-
] }),
|
|
220
|
-
/* @__PURE__ */ jsx("span", { className: "text-emerald-600 dark:text-emerald-400 font-medium hidden sm:inline", children: "Live" })
|
|
221
|
-
] }),
|
|
222
|
-
status === "connecting" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
223
|
-
/* @__PURE__ */ jsx(RefreshCw, { className: "h-2.5 w-2.5 text-amber-500 animate-spin shrink-0" }),
|
|
224
|
-
/* @__PURE__ */ jsx("span", { className: "text-amber-600 dark:text-amber-400 font-medium text-[11px]", children: reconnectCountdown !== null ? `Retry ${reconnectCountdown}s` : "Connecting..." }),
|
|
225
|
-
pendingUpdatesCount > 0 && /* @__PURE__ */ jsxs("span", { className: "text-[9px] px-1 py-0.2 rounded-full bg-amber-500/20 font-bold font-mono", children: [
|
|
226
|
-
"+",
|
|
227
|
-
pendingUpdatesCount
|
|
228
|
-
] })
|
|
229
|
-
] }),
|
|
230
|
-
status === "disconnected" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
231
|
-
/* @__PURE__ */ jsx("span", { className: "h-2 w-2 rounded-full bg-amber-500/80 shrink-0" }),
|
|
232
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground hover:text-foreground text-[11px]", children: reconnectCountdown !== null ? `Retry in ${reconnectCountdown}s` : "Reconnect" }),
|
|
233
|
-
pendingUpdatesCount > 0 && /* @__PURE__ */ jsxs("span", { className: "text-[9px] px-1 py-0.2 rounded-full bg-amber-500/20 font-bold font-mono", children: [
|
|
234
|
-
"+",
|
|
235
|
-
pendingUpdatesCount
|
|
236
|
-
] })
|
|
237
|
-
] }),
|
|
238
|
-
status === "offline" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
239
|
-
/* @__PURE__ */ jsx(WifiOff, { className: "h-2.5 w-2.5 text-muted-foreground/70 shrink-0" }),
|
|
240
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground hidden sm:inline", children: "Offline" })
|
|
241
|
-
] })
|
|
242
|
-
]
|
|
243
|
-
}
|
|
244
|
-
) }),
|
|
245
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: status === "connected" ? `Connected & synced to ${serverUrl} (Click to pause sync)` : status === "disconnected" ? `Disconnected. Click to reconnect now (${pendingUpdatesCount} offline edits saved)` : !isOnline ? "You are working offline. Edits are saved locally to IndexedDB." : `Status: ${status}` })
|
|
246
|
-
] }),
|
|
247
|
-
offlineStorageStatus === "synced" && /* @__PURE__ */ jsxs(Popover, { children: [
|
|
248
|
-
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
249
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
250
|
-
"button",
|
|
251
|
-
{
|
|
252
|
-
type: "button",
|
|
253
|
-
className: "flex items-center gap-1 text-muted-foreground/80 hover:text-foreground px-1.5 py-0.5 rounded-full hover:bg-muted/80 transition-colors cursor-pointer",
|
|
254
|
-
"aria-label": "Inspect offline storage and sync health",
|
|
255
|
-
children: [
|
|
256
|
-
/* @__PURE__ */ jsx(HardDrive, { className: "h-3 w-3 text-emerald-500" }),
|
|
257
|
-
pendingUpdatesCount > 0 ? /* @__PURE__ */ jsx("span", { className: "text-[10px] font-mono font-bold text-amber-500 hidden sm:inline", children: pendingUpdatesCount }) : /* @__PURE__ */ jsx(Check, { className: "h-2.5 w-2.5 text-emerald-500 hidden sm:inline" })
|
|
258
|
-
]
|
|
259
|
-
}
|
|
260
|
-
) }) }),
|
|
261
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: "Offline Persistence: All changes saved to IndexedDB" })
|
|
262
|
-
] }),
|
|
263
|
-
/* @__PURE__ */ jsxs(PopoverContent, { side: "bottom", align: "end", className: "w-80 p-3.5 space-y-3 text-xs", children: [
|
|
264
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pb-1.5 border-b border-border/70", children: [
|
|
265
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 font-semibold text-foreground", children: [
|
|
266
|
-
/* @__PURE__ */ jsx(Database, { className: "h-4 w-4 text-emerald-500" }),
|
|
267
|
-
/* @__PURE__ */ jsx("span", { children: "Storage & Sync Health" })
|
|
268
|
-
] }),
|
|
269
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-mono px-1.5 py-0.2 rounded-full bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 font-semibold", children: "IndexedDB" })
|
|
270
|
-
] }),
|
|
271
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-2 text-[11px]", children: [
|
|
272
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-2 rounded-lg bg-muted/40 border border-border/50", children: [
|
|
273
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Local Document Cache:" }),
|
|
274
|
-
/* @__PURE__ */ jsxs("span", { className: "font-semibold text-foreground font-mono", children: [
|
|
275
|
-
"#",
|
|
276
|
-
docId
|
|
277
|
-
] })
|
|
278
|
-
] }),
|
|
279
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-2 rounded-lg bg-muted/40 border border-border/50", children: [
|
|
280
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Last Saved Locally:" }),
|
|
281
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: formatLastSavedRelative(lastSavedTimestamp) })
|
|
282
|
-
] }),
|
|
283
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-2 rounded-lg bg-muted/40 border border-border/50", children: [
|
|
284
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Pending Cloud Sync:" }),
|
|
285
|
-
/* @__PURE__ */ jsx(
|
|
286
|
-
"span",
|
|
287
|
-
{
|
|
288
|
-
className: cn(
|
|
289
|
-
"font-semibold",
|
|
290
|
-
pendingUpdatesCount === 0 ? "text-emerald-500" : "text-amber-500"
|
|
291
|
-
),
|
|
292
|
-
children: pendingUpdatesCount === 0 ? "100% Synced" : `${pendingUpdatesCount} offline changes pending`
|
|
293
|
-
}
|
|
294
|
-
)
|
|
295
|
-
] }),
|
|
296
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-2 rounded-lg bg-muted/40 border border-border/50", children: [
|
|
297
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Browser Network:" }),
|
|
298
|
-
/* @__PURE__ */ jsx("span", { className: "flex items-center gap-1 font-medium", children: isOnline ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
299
|
-
/* @__PURE__ */ jsx(Wifi, { className: "h-3 w-3 text-emerald-500" }),
|
|
300
|
-
/* @__PURE__ */ jsx("span", { className: "text-emerald-600 dark:text-emerald-400", children: "Online" })
|
|
301
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
302
|
-
/* @__PURE__ */ jsx(WifiOff, { className: "h-3 w-3 text-red-500" }),
|
|
303
|
-
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "Offline" })
|
|
304
|
-
] }) })
|
|
305
|
-
] })
|
|
306
|
-
] }),
|
|
307
|
-
/* @__PURE__ */ jsxs("div", { className: "pt-1 flex items-center justify-between gap-2", children: [
|
|
308
|
-
/* @__PURE__ */ jsx(
|
|
309
|
-
Button,
|
|
310
|
-
{
|
|
311
|
-
type: "button",
|
|
312
|
-
variant: "outline",
|
|
313
|
-
size: "sm",
|
|
314
|
-
onClick: clearLocalPersistence,
|
|
315
|
-
className: "text-[11px] h-7 px-2 text-destructive hover:text-destructive",
|
|
316
|
-
children: "Clear Cache"
|
|
317
|
-
}
|
|
318
|
-
),
|
|
319
|
-
/* @__PURE__ */ jsxs(
|
|
320
|
-
Button,
|
|
321
|
-
{
|
|
322
|
-
type: "button",
|
|
323
|
-
size: "sm",
|
|
324
|
-
onClick: manualReconnect,
|
|
325
|
-
disabled: status === "connected",
|
|
326
|
-
className: "text-[11px] h-7 px-3 gap-1 cursor-pointer",
|
|
327
|
-
children: [
|
|
328
|
-
/* @__PURE__ */ jsx(RefreshCw, { className: "h-3 w-3" }),
|
|
329
|
-
status === "connected" ? "Connected" : "Sync Now"
|
|
330
|
-
]
|
|
331
|
-
}
|
|
332
|
-
)
|
|
333
|
-
] })
|
|
334
|
-
] })
|
|
335
|
-
] }),
|
|
336
|
-
enabled && showRoomInfo && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
337
|
-
/* @__PURE__ */ jsx("div", { className: "h-3.5 w-px bg-border/70 hidden sm:block" }),
|
|
338
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-muted-foreground", children: [
|
|
339
|
-
/* @__PURE__ */ jsxs(
|
|
340
|
-
"span",
|
|
341
|
-
{
|
|
342
|
-
className: "font-mono text-[11px] truncate max-w-[80px] sm:max-w-[110px] hidden md:inline",
|
|
343
|
-
suppressHydrationWarning: true,
|
|
344
|
-
children: [
|
|
345
|
-
"#",
|
|
346
|
-
docId
|
|
347
|
-
]
|
|
348
|
-
}
|
|
349
|
-
),
|
|
350
|
-
/* @__PURE__ */ jsx(
|
|
351
|
-
"span",
|
|
352
|
-
{
|
|
353
|
-
className: "text-[9px] px-1 py-0.2 rounded font-sans uppercase font-bold tracking-wider bg-muted text-muted-foreground border border-border/50 hidden md:inline-block",
|
|
354
|
-
title: `Active collaboration server: ${serverUrl}`,
|
|
355
|
-
children: serverUrl.includes("localhost") || serverUrl.includes("127.0.0.1") ? "Local" : "Cloud"
|
|
356
|
-
}
|
|
357
|
-
),
|
|
358
|
-
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
359
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
360
|
-
Button,
|
|
361
|
-
{
|
|
362
|
-
variant: "ghost",
|
|
363
|
-
size: "sm",
|
|
364
|
-
onClick: handleCopyLink,
|
|
365
|
-
className: "h-6 w-6 p-0 hover:bg-muted rounded-full",
|
|
366
|
-
"aria-label": "Copy collaboration room link",
|
|
367
|
-
children: copied ? /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 text-emerald-500" }) : /* @__PURE__ */ jsx(Share2, { className: "h-3 w-3" })
|
|
368
|
-
}
|
|
369
|
-
) }),
|
|
370
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: "Copy shareable invite link" })
|
|
371
|
-
] })
|
|
372
|
-
] })
|
|
373
|
-
] }),
|
|
374
|
-
enabled && users.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
375
|
-
/* @__PURE__ */ jsx("div", { className: "h-3.5 w-px bg-border/70" }),
|
|
376
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center -space-x-1.5 overflow-hidden pl-1", children: [
|
|
377
|
-
/* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: visibleUsers.map((user, idx) => /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
378
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
379
|
-
motion.div,
|
|
380
|
-
{
|
|
381
|
-
initial: { scale: 0.7, opacity: 0 },
|
|
382
|
-
animate: { scale: 1, opacity: 1 },
|
|
383
|
-
exit: { scale: 0.7, opacity: 0 },
|
|
384
|
-
transition: { duration: 0.15 },
|
|
385
|
-
className: cn(
|
|
386
|
-
"relative flex items-center justify-center h-6.5 w-6.5 min-w-[26px] min-h-[26px] rounded-full text-[10px] font-bold text-white shadow-sm ring-2 ring-background transition-transform hover:scale-115 hover:z-20 select-none",
|
|
387
|
-
user.isSelf && "ring-emerald-500/60",
|
|
388
|
-
idx >= 2 && "hidden sm:flex"
|
|
389
|
-
),
|
|
390
|
-
style: { backgroundColor: user.color },
|
|
391
|
-
children: [
|
|
392
|
-
user.avatar ? user.avatar.startsWith("http") || user.avatar.startsWith("data:") ? /* @__PURE__ */ jsx(
|
|
393
|
-
"img",
|
|
394
|
-
{
|
|
395
|
-
src: user.avatar,
|
|
396
|
-
alt: user.name,
|
|
397
|
-
className: "h-full w-full rounded-full object-cover"
|
|
398
|
-
}
|
|
399
|
-
) : /* @__PURE__ */ jsx("span", { className: "text-xs leading-none", children: user.avatar }) : getInitials(user.name),
|
|
400
|
-
user.isTyping && /* @__PURE__ */ jsx(
|
|
401
|
-
"span",
|
|
402
|
-
{
|
|
403
|
-
className: "absolute -top-1 -right-1 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-amber-400 ring-1 ring-background",
|
|
404
|
-
title: "Typing...",
|
|
405
|
-
children: /* @__PURE__ */ jsx("span", { className: "h-1 w-1 rounded-full bg-slate-900 animate-ping" })
|
|
406
|
-
}
|
|
407
|
-
),
|
|
408
|
-
user.isSelf && !user.isTyping && /* @__PURE__ */ jsx(
|
|
409
|
-
"span",
|
|
410
|
-
{
|
|
411
|
-
className: "absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full border border-background bg-emerald-500",
|
|
412
|
-
title: "You"
|
|
413
|
-
}
|
|
414
|
-
)
|
|
415
|
-
]
|
|
416
|
-
}
|
|
417
|
-
) }),
|
|
418
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", className: "text-xs", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 font-medium", children: [
|
|
419
|
-
/* @__PURE__ */ jsx(
|
|
420
|
-
"span",
|
|
421
|
-
{
|
|
422
|
-
className: "h-2 w-2 rounded-full",
|
|
423
|
-
style: { backgroundColor: user.color }
|
|
424
|
-
}
|
|
425
|
-
),
|
|
426
|
-
/* @__PURE__ */ jsx("span", { children: user.name }),
|
|
427
|
-
user.isSelf && /* @__PURE__ */ jsx("span", { className: "text-[10px] px-1 py-0.2 rounded bg-muted text-muted-foreground font-mono", children: "You" })
|
|
428
|
-
] }) })
|
|
429
|
-
] }, user.clientId)) }),
|
|
430
|
-
remainingCount > 0 && /* @__PURE__ */ jsxs(
|
|
431
|
-
"div",
|
|
432
|
-
{
|
|
433
|
-
className: "flex items-center justify-center h-6.5 w-6.5 min-w-[26px] min-h-[26px] rounded-full bg-muted text-muted-foreground text-[10px] font-semibold ring-2 ring-background",
|
|
434
|
-
title: `${remainingCount} more collaborators`,
|
|
435
|
-
children: [
|
|
436
|
-
"+",
|
|
437
|
-
remainingCount
|
|
438
|
-
]
|
|
439
|
-
}
|
|
440
|
-
),
|
|
441
|
-
users.length > 1 && /* @__PURE__ */ jsxs("span", { className: "text-[11px] font-semibold text-muted-foreground ml-1.5 hidden sm:inline", title: `${users.length} active collaborators`, children: [
|
|
442
|
-
users.length,
|
|
443
|
-
" online"
|
|
444
|
-
] }),
|
|
445
|
-
typingUsers.length > 0 && /* @__PURE__ */ jsxs(
|
|
446
|
-
motion.div,
|
|
447
|
-
{
|
|
448
|
-
initial: { opacity: 0, scale: 0.9, x: -4 },
|
|
449
|
-
animate: { opacity: 1, scale: 1, x: 0 },
|
|
450
|
-
exit: { opacity: 0, scale: 0.9, x: -4 },
|
|
451
|
-
className: "flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-primary/10 text-primary text-[10px] font-medium ml-1",
|
|
452
|
-
children: [
|
|
453
|
-
/* @__PURE__ */ jsx(
|
|
454
|
-
"span",
|
|
455
|
-
{
|
|
456
|
-
className: "h-1.5 w-1.5 rounded-full animate-ping",
|
|
457
|
-
style: { backgroundColor: typingUsers[0].color }
|
|
458
|
-
}
|
|
459
|
-
),
|
|
460
|
-
/* @__PURE__ */ jsx("span", { className: "truncate max-w-[130px]", children: typingUsers.length === 1 ? `${typingUsers[0].name} is typing...` : `${typingUsers.length} typing...` })
|
|
461
|
-
]
|
|
462
|
-
}
|
|
463
|
-
)
|
|
464
|
-
] })
|
|
465
|
-
] }),
|
|
466
|
-
enabled && /* @__PURE__ */ jsxs(Popover, { children: [
|
|
467
|
-
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
468
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
469
|
-
Button,
|
|
470
|
-
{
|
|
471
|
-
variant: "ghost",
|
|
472
|
-
size: "sm",
|
|
473
|
-
className: "h-6 w-6 p-0 hover:bg-muted rounded-full ml-0.5",
|
|
474
|
-
"aria-label": "Collaborator settings",
|
|
475
|
-
children: /* @__PURE__ */ jsx(Settings2, { className: "h-3 w-3 text-muted-foreground hover:text-foreground transition-colors" })
|
|
476
|
-
}
|
|
477
|
-
) }) }),
|
|
478
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: "Change name & cursor color" })
|
|
479
|
-
] }),
|
|
480
|
-
/* @__PURE__ */ jsx(PopoverContent, { side: "bottom", align: "end", className: "w-72 p-4", children: /* @__PURE__ */ jsxs("form", { onSubmit: handleSaveProfile, className: "space-y-3", children: [
|
|
481
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pb-1 border-b border-border", children: [
|
|
482
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-xs font-semibold", children: [
|
|
483
|
-
/* @__PURE__ */ jsx(Sparkles, { className: "h-3.5 w-3.5 text-blue-500" }),
|
|
484
|
-
/* @__PURE__ */ jsx("span", { children: "Collaborator Profile" })
|
|
485
|
-
] }),
|
|
486
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: "Real-time presence" })
|
|
487
|
-
] }),
|
|
488
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
489
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: "collab-name", className: "text-xs font-medium", children: "Display Name" }),
|
|
490
|
-
/* @__PURE__ */ jsx(
|
|
491
|
-
Input,
|
|
492
|
-
{
|
|
493
|
-
id: "collab-name",
|
|
494
|
-
value: editingName,
|
|
495
|
-
onChange: (e) => setEditingName(e.target.value),
|
|
496
|
-
placeholder: "Enter your name...",
|
|
497
|
-
maxLength: 24,
|
|
498
|
-
className: "h-8 text-xs"
|
|
499
|
-
}
|
|
500
|
-
)
|
|
501
|
-
] }),
|
|
502
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
503
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
504
|
-
/* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Avatar Badge" }),
|
|
505
|
-
selectedAvatar && /* @__PURE__ */ jsx(
|
|
506
|
-
"button",
|
|
507
|
-
{
|
|
508
|
-
type: "button",
|
|
509
|
-
onClick: () => setSelectedAvatar(""),
|
|
510
|
-
className: "text-[10px] text-muted-foreground hover:text-foreground",
|
|
511
|
-
children: "Reset"
|
|
512
|
-
}
|
|
513
|
-
)
|
|
514
|
-
] }),
|
|
515
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-6 gap-1 pt-0.5", children: AVATAR_PRESETS.map((emoji) => /* @__PURE__ */ jsx(
|
|
516
|
-
"button",
|
|
517
|
-
{
|
|
518
|
-
type: "button",
|
|
519
|
-
onClick: () => setSelectedAvatar(emoji),
|
|
520
|
-
className: cn(
|
|
521
|
-
"h-7 rounded-md border text-sm transition-all flex items-center justify-center hover:scale-110",
|
|
522
|
-
selectedAvatar === emoji ? "border-primary bg-primary/10 shadow-xs" : "border-border/60 bg-muted/30 opacity-80 hover:opacity-100"
|
|
523
|
-
),
|
|
524
|
-
children: emoji
|
|
525
|
-
},
|
|
526
|
-
emoji
|
|
527
|
-
)) })
|
|
528
|
-
] }),
|
|
529
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
530
|
-
/* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Cursor Color" }),
|
|
531
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-5 gap-1.5 pt-0.5", children: COLLAB_COLORS.map((col) => /* @__PURE__ */ jsx(
|
|
532
|
-
"button",
|
|
533
|
-
{
|
|
534
|
-
type: "button",
|
|
535
|
-
onClick: () => setSelectedColor(col),
|
|
536
|
-
className: cn(
|
|
537
|
-
"h-6 w-full rounded-md transition-all flex items-center justify-center",
|
|
538
|
-
selectedColor === col ? "ring-2 ring-offset-2 ring-primary scale-105" : "hover:scale-105 opacity-85 hover:opacity-100"
|
|
539
|
-
),
|
|
540
|
-
style: { backgroundColor: col },
|
|
541
|
-
children: selectedColor === col && /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 text-white" })
|
|
542
|
-
},
|
|
543
|
-
col
|
|
544
|
-
)) })
|
|
545
|
-
] }),
|
|
546
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5 pt-1 border-t border-border/60", children: [
|
|
547
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
548
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: "collab-server", className: "text-xs font-medium", children: "Collab Server" }),
|
|
549
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground truncate max-w-[140px]", children: serverUrl.includes("localhost") ? "Local (Self-Hosted)" : "Cloud" })
|
|
550
|
-
] }),
|
|
551
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-1", children: COLLAB_SERVER_PRESETS.map((preset) => {
|
|
552
|
-
const isActive = serverUrl === preset.url;
|
|
553
|
-
return /* @__PURE__ */ jsx(
|
|
554
|
-
"button",
|
|
555
|
-
{
|
|
556
|
-
type: "button",
|
|
557
|
-
onClick: () => {
|
|
558
|
-
setCustomServer(preset.url);
|
|
559
|
-
setServerUrl(preset.url);
|
|
560
|
-
toast.success(`Switched to ${preset.label.split(" ")[0]} server`);
|
|
561
|
-
},
|
|
562
|
-
className: cn(
|
|
563
|
-
"flex-1 text-[10px] py-1 px-1.5 rounded border transition-all text-center",
|
|
564
|
-
isActive ? "bg-primary/10 border-primary/50 text-primary font-medium" : "bg-muted/40 border-border/60 text-muted-foreground hover:bg-muted"
|
|
565
|
-
),
|
|
566
|
-
children: preset.label.includes("Local") ? "Local :4444" : "Public Cloud"
|
|
567
|
-
},
|
|
568
|
-
preset.url
|
|
569
|
-
);
|
|
570
|
-
}) }),
|
|
571
|
-
/* @__PURE__ */ jsx(
|
|
572
|
-
Input,
|
|
573
|
-
{
|
|
574
|
-
id: "collab-server",
|
|
575
|
-
value: customServer,
|
|
576
|
-
onChange: (e) => setCustomServer(e.target.value),
|
|
577
|
-
placeholder: "ws://localhost:4444",
|
|
578
|
-
className: "h-7 text-[11px] font-mono"
|
|
579
|
-
}
|
|
580
|
-
)
|
|
581
|
-
] }),
|
|
582
|
-
/* @__PURE__ */ jsx("div", { className: "pt-2 flex justify-end gap-2", children: /* @__PURE__ */ jsx(
|
|
583
|
-
Button,
|
|
584
|
-
{
|
|
585
|
-
type: "submit",
|
|
586
|
-
size: "sm",
|
|
587
|
-
className: "h-7 px-3 text-xs",
|
|
588
|
-
children: "Save Changes"
|
|
589
|
-
}
|
|
590
|
-
) })
|
|
591
|
-
] }) })
|
|
592
|
-
] }),
|
|
593
|
-
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
594
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
595
|
-
Button,
|
|
596
|
-
{
|
|
597
|
-
variant: "ghost",
|
|
598
|
-
size: "sm",
|
|
599
|
-
onClick: toggleSidebar,
|
|
600
|
-
className: cn(
|
|
601
|
-
"h-6 px-1.5 gap-1 hover:bg-muted rounded-full ml-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
602
|
-
isSidebarOpen && "bg-muted text-foreground"
|
|
603
|
-
),
|
|
604
|
-
"aria-label": "Toggle discussions",
|
|
605
|
-
children: [
|
|
606
|
-
/* @__PURE__ */ jsx(MessageSquare, { className: "h-3 w-3" }),
|
|
607
|
-
unresolvedCount > 0 && /* @__PURE__ */ jsx("span", { className: "h-3.5 min-w-[14px] px-1 rounded-full text-[9px] font-bold bg-primary text-primary-foreground flex items-center justify-center", children: unresolvedCount })
|
|
608
|
-
]
|
|
609
|
-
}
|
|
610
|
-
) }),
|
|
611
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: isSidebarOpen ? "Close comments panel" : `Discussions (${unresolvedCount} open)` })
|
|
612
|
-
] }),
|
|
613
|
-
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
614
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
615
|
-
Button,
|
|
616
|
-
{
|
|
617
|
-
variant: "ghost",
|
|
618
|
-
size: "sm",
|
|
619
|
-
onClick: toggleHistoryDrawer,
|
|
620
|
-
className: cn(
|
|
621
|
-
"h-6 w-6 p-0 hover:bg-muted rounded-full ml-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
622
|
-
isHistoryDrawerOpen && "bg-muted text-foreground"
|
|
623
|
-
),
|
|
624
|
-
"aria-label": "Version history",
|
|
625
|
-
children: /* @__PURE__ */ jsx(History, { className: "h-3 w-3" })
|
|
626
|
-
}
|
|
627
|
-
) }),
|
|
628
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: isHistoryDrawerOpen ? "Close version history" : "Version history (Ctrl+Shift+H)" })
|
|
629
|
-
] }),
|
|
630
|
-
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
631
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
632
|
-
Button,
|
|
633
|
-
{
|
|
634
|
-
variant: "ghost",
|
|
635
|
-
size: "sm",
|
|
636
|
-
onClick: () => {
|
|
637
|
-
if (typeof window !== "undefined") {
|
|
638
|
-
window.dispatchEvent(
|
|
639
|
-
new CustomEvent("notiq:open-import-export", {
|
|
640
|
-
detail: { defaultTab: "export" }
|
|
641
|
-
})
|
|
642
|
-
);
|
|
643
|
-
}
|
|
644
|
-
},
|
|
645
|
-
className: "h-6 w-6 p-0 hover:bg-muted rounded-full ml-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
646
|
-
"aria-label": "Import & Export document",
|
|
647
|
-
children: /* @__PURE__ */ jsx(ArrowDownUp, { className: "h-3 w-3" })
|
|
648
|
-
}
|
|
649
|
-
) }),
|
|
650
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: "Import / Export Hub (Ctrl+Shift+E)" })
|
|
651
|
-
] })
|
|
652
|
-
]
|
|
653
|
-
}
|
|
654
|
-
) });
|
|
655
|
-
}
|
|
656
|
-
function OfflineBanner() {
|
|
657
|
-
const { isOnline, status, manualReconnect, pendingUpdatesCount } = useCollab();
|
|
658
|
-
if (isOnline && status !== "offline") return null;
|
|
659
|
-
return /* @__PURE__ */ jsxs("div", { className: "bg-amber-500/15 border-b border-amber-500/30 text-amber-900 dark:text-amber-200 text-xs py-1.5 px-4 text-center flex items-center justify-center gap-2 font-medium animate-in fade-in duration-200 select-none", children: [
|
|
660
|
-
/* @__PURE__ */ jsx(WifiOff, { className: "h-3.5 w-3.5 text-amber-600 dark:text-amber-400 shrink-0" }),
|
|
661
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
662
|
-
"You are currently offline. Edits are saved locally in IndexedDB",
|
|
663
|
-
pendingUpdatesCount > 0 ? ` (${pendingUpdatesCount} offline edits pending)` : "",
|
|
664
|
-
" and will automatically sync when reconnected."
|
|
665
|
-
] }),
|
|
666
|
-
/* @__PURE__ */ jsx(
|
|
667
|
-
"button",
|
|
668
|
-
{
|
|
669
|
-
type: "button",
|
|
670
|
-
onClick: manualReconnect,
|
|
671
|
-
className: "underline hover:no-underline font-semibold ml-1 cursor-pointer text-foreground hover:text-primary transition-colors",
|
|
672
|
-
children: "Retry Sync"
|
|
673
|
-
}
|
|
674
|
-
)
|
|
675
|
-
] });
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
export {
|
|
679
|
-
AVATAR_PRESETS,
|
|
680
|
-
CollaboratorsBar,
|
|
681
|
-
OfflineBanner
|
|
682
|
-
};
|