strapi-plugin-magic-sessionmanager 4.2.16 → 4.3.1

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.
Files changed (23) hide show
  1. package/dist/_chunks/{Analytics-BC4jdzBT.mjs → Analytics-sX94t6D9.mjs} +2 -2
  2. package/dist/_chunks/{Analytics-D6RGeWO5.js → Analytics-tOOj5T92.js} +2 -2
  3. package/dist/_chunks/{App-CahdcIEB.mjs → App-Cs4KKd3L.mjs} +155 -54
  4. package/dist/_chunks/{App-BkaaNOpt.js → App-D4qVym6y.js} +154 -53
  5. package/dist/_chunks/{License-BFx721o7.mjs → License-CN5YpqIu.mjs} +1 -1
  6. package/dist/_chunks/{License-C8VnKtV1.js → License-kfVcskd3.js} +1 -1
  7. package/dist/_chunks/{OnlineUsersWidget-uJ6DZB_N.js → OnlineUsersWidget-Cg3R7602.js} +1 -1
  8. package/dist/_chunks/{OnlineUsersWidget-r2ZgSnok.mjs → OnlineUsersWidget-ytykP_tA.mjs} +1 -1
  9. package/dist/_chunks/{Settings-jtZRw_VP.js → Settings-DVRIrGho.js} +26 -54
  10. package/dist/_chunks/{Settings-DOUUwwxB.mjs → Settings-XloJ-aHl.mjs} +26 -54
  11. package/dist/_chunks/StyledButtons-D2EbG_Zw.js +419 -0
  12. package/dist/_chunks/StyledButtons-fbNVRlMY.mjs +418 -0
  13. package/dist/_chunks/{UpgradePage-mqr6dLVY.mjs → UpgradePage-C441wvPX.mjs} +1 -1
  14. package/dist/_chunks/{UpgradePage-Bwy_1m6f.js → UpgradePage-D2FRalDz.js} +1 -1
  15. package/dist/_chunks/{index-BuxWeACw.js → index-DtBfKBne.js} +236 -190
  16. package/dist/_chunks/{index-CUSrDKCG.mjs → index-Ij0JRf9W.mjs} +237 -193
  17. package/dist/_chunks/{useLicense-xjKLHcVq.mjs → useLicense-DJEDGSap.mjs} +1 -1
  18. package/dist/_chunks/{useLicense-D7FSpX8c.js → useLicense-NCFYHpDd.js} +1 -1
  19. package/dist/admin/index.js +1 -1
  20. package/dist/admin/index.mjs +1 -1
  21. package/dist/server/index.js +35938 -169
  22. package/dist/server/index.mjs +35927 -167
  23. package/package.json +7 -7
@@ -1,9 +1,10 @@
1
- import { useEffect, useState } from "react";
1
+ import { useRef, useEffect, useState } from "react";
2
+ import { useFetchClient, useNotification } from "@strapi/strapi/admin";
2
3
  import { jsx, jsxs } from "react/jsx-runtime";
3
4
  import { useIntl } from "react-intl";
4
- import { Box, Typography, Flex, Badge, Divider, Button } from "@strapi/design-system";
5
- import { Server, Clock, Cross, Check, Phone, Monitor } from "@strapi/icons";
6
- import { useFetchClient, useNotification } from "@strapi/strapi/admin";
5
+ import styled from "styled-components";
6
+ import { Box, Typography, Flex, Badge, Divider } from "@strapi/design-system";
7
+ import { Server, Clock, User, Cross, Check, Phone, Monitor } from "@strapi/icons";
7
8
  const strapi = {
8
9
  name: "magic-sessionmanager",
9
10
  displayName: "Magic Sessionmanager"
@@ -13,10 +14,29 @@ const pluginPkg = {
13
14
  };
14
15
  const pluginId = "magic-sessionmanager";
15
16
  const PLUGIN_ID = pluginId;
16
- const Initializer = () => {
17
+ const Initializer = ({ setPlugin }) => {
18
+ const ref = useRef(setPlugin);
19
+ const { get } = useFetchClient();
17
20
  useEffect(() => {
18
- console.log("[magic-sessionmanager] Plugin initialized");
21
+ if (ref.current) {
22
+ ref.current(pluginId);
23
+ }
19
24
  }, []);
25
+ useEffect(() => {
26
+ const HEARTBEAT_INTERVAL = 4 * 60 * 1e3;
27
+ const heartbeat = async () => {
28
+ try {
29
+ await get(`/${pluginId}/license/status`);
30
+ } catch (error) {
31
+ }
32
+ };
33
+ const initialTimeout = setTimeout(heartbeat, 60 * 1e3);
34
+ const interval = setInterval(heartbeat, HEARTBEAT_INTERVAL);
35
+ return () => {
36
+ clearTimeout(initialTimeout);
37
+ clearInterval(interval);
38
+ };
39
+ }, [get]);
20
40
  return null;
21
41
  };
22
42
  const PluginIcon = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 32 32", fill: "currentColor", width: "24", height: "24", children: /* @__PURE__ */ jsx("path", { d: "M26 5H6a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h20a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3M20 27h-8a1 1 0 0 0 0 2h8a1 1 0 0 0 0-2" }) });
@@ -83,6 +103,123 @@ const parseUserAgent = (userAgent) => {
83
103
  };
84
104
  };
85
105
  const getTranslation = (id) => `${PLUGIN_ID}.${id}`;
106
+ const PanelContainer = styled(Box)`
107
+ width: 100%;
108
+ `;
109
+ const StatusCard = styled(Box)`
110
+ padding: 20px;
111
+ border-radius: 12px;
112
+ border: 1px solid ${(props) => props.$isOnline ? "#BBF7D0" : "#E5E7EB"};
113
+ background: ${(props) => props.$isOnline ? "linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%)" : "linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%)"};
114
+ transition: all 0.2s ease;
115
+ `;
116
+ const BlockedWarning = styled(Box)`
117
+ padding: 16px;
118
+ border-radius: 10px;
119
+ background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
120
+ border: 1px solid #FECACA;
121
+ `;
122
+ const SessionCard = styled(Box)`
123
+ padding: 16px;
124
+ background: white;
125
+ border-radius: 10px;
126
+ border: 1px solid #E5E7EB;
127
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
128
+ transition: all 0.2s ease;
129
+
130
+ &:hover {
131
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
132
+ border-color: #0EA5E9;
133
+ }
134
+ `;
135
+ const EmptyState = styled(Box)`
136
+ padding: 32px;
137
+ background: #F9FAFB;
138
+ border-radius: 12px;
139
+ border: 2px dashed #E5E7EB;
140
+ text-align: center;
141
+ `;
142
+ const EmptyIcon = styled(Box)`
143
+ width: 48px;
144
+ height: 48px;
145
+ margin: 0 auto 12px;
146
+ display: flex;
147
+ align-items: center;
148
+ justify-content: center;
149
+ background: #E5E7EB;
150
+ border-radius: 50%;
151
+ color: #9CA3AF;
152
+ `;
153
+ const SectionLabel = styled(Typography)`
154
+ text-transform: uppercase;
155
+ letter-spacing: 0.5px;
156
+ font-size: 11px !important;
157
+ font-weight: 700 !important;
158
+ color: #6B7280;
159
+ margin-bottom: 12px;
160
+ display: block;
161
+ `;
162
+ const ActionButton = styled.button`
163
+ width: 100%;
164
+ padding: 12px 16px;
165
+ border-radius: 8px;
166
+ font-size: 14px;
167
+ font-weight: 600;
168
+ cursor: pointer;
169
+ display: flex;
170
+ align-items: center;
171
+ justify-content: center;
172
+ gap: 8px;
173
+ transition: all 0.2s ease;
174
+
175
+ ${(props) => props.$variant === "danger" && `
176
+ background: white;
177
+ color: #DC2626;
178
+ border: 2px solid #DC2626;
179
+
180
+ &:hover:not(:disabled) {
181
+ background: #DC2626;
182
+ color: white;
183
+ }
184
+ `}
185
+
186
+ ${(props) => props.$variant === "success" && `
187
+ background: white;
188
+ color: #16A34A;
189
+ border: 2px solid #16A34A;
190
+
191
+ &:hover:not(:disabled) {
192
+ background: #16A34A;
193
+ color: white;
194
+ }
195
+ `}
196
+
197
+ &:disabled {
198
+ opacity: 0.5;
199
+ cursor: not-allowed;
200
+ }
201
+
202
+ svg {
203
+ width: 16px;
204
+ height: 16px;
205
+ }
206
+ `;
207
+ const IconWrapper = styled(Box)`
208
+ width: 32px;
209
+ height: 32px;
210
+ display: flex;
211
+ align-items: center;
212
+ justify-content: center;
213
+ background: #F3F4F6;
214
+ border-radius: 8px;
215
+ flex-shrink: 0;
216
+
217
+ svg {
218
+ width: 16px;
219
+ height: 16px;
220
+ color: #6B7280;
221
+ }
222
+ `;
86
223
  const SessionInfoPanel = ({ documentId, model, document }) => {
87
224
  const { formatMessage } = useIntl();
88
225
  const [sessions, setSessions] = useState([]);
@@ -177,202 +314,109 @@ const SessionInfoPanel = ({ documentId, model, document }) => {
177
314
  const isOnline = sessions.length > 0;
178
315
  return {
179
316
  title: t("panel.title", "Session Info"),
180
- content: /* @__PURE__ */ jsx(Box, { style: { width: "100%" }, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 4, alignItems: "stretch", children: [
181
- /* @__PURE__ */ jsx(
182
- Box,
183
- {
184
- padding: 5,
185
- background: isOnline ? "success100" : "neutral150",
186
- hasRadius: true,
187
- style: {
188
- border: isOnline ? "1px solid #c6f6d5" : "1px solid #eaeaef",
189
- transition: "all 0.2s ease"
190
- },
191
- children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 3, alignItems: "center", children: [
192
- /* @__PURE__ */ jsx(
193
- Badge,
194
- {
195
- backgroundColor: isOnline ? "success600" : "neutral600",
196
- textColor: "neutral0",
197
- size: "M",
198
- style: { fontSize: "14px", padding: "6px 12px" },
199
- children: isOnline ? t("panel.status.active", "ACTIVE") : t("panel.status.offline", "OFFLINE")
200
- }
201
- ),
202
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", textColor: isOnline ? "success700" : "neutral700", children: t("panel.sessions.count", "{count} active session{count, plural, one {} other {s}}", { count: sessions.length }) })
203
- ] })
204
- }
205
- ),
206
- isBlocked && /* @__PURE__ */ jsxs(
207
- Box,
208
- {
209
- padding: 4,
210
- background: "danger100",
211
- hasRadius: true,
212
- children: [
213
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", textColor: "danger700", marginBottom: 1, children: t("panel.blocked.title", "User is blocked") }),
214
- /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "danger600", children: t("panel.blocked.description", "Authentication disabled") })
215
- ]
216
- }
217
- ),
317
+ content: /* @__PURE__ */ jsx(PanelContainer, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 4, alignItems: "stretch", children: [
318
+ /* @__PURE__ */ jsx(StatusCard, { $isOnline: isOnline, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 3, alignItems: "center", children: [
319
+ /* @__PURE__ */ jsx(
320
+ Badge,
321
+ {
322
+ backgroundColor: isOnline ? "success600" : "neutral600",
323
+ textColor: "neutral0",
324
+ size: "M",
325
+ style: { fontSize: "12px", padding: "6px 14px", fontWeight: "700" },
326
+ children: isOnline ? t("panel.status.active", "ONLINE") : t("panel.status.offline", "OFFLINE")
327
+ }
328
+ ),
329
+ /* @__PURE__ */ jsxs(
330
+ Typography,
331
+ {
332
+ variant: "omega",
333
+ fontWeight: "semiBold",
334
+ textColor: isOnline ? "success700" : "neutral700",
335
+ children: [
336
+ sessions.length,
337
+ " ",
338
+ t("panel.sessions.label", "active session"),
339
+ sessions.length !== 1 ? "s" : ""
340
+ ]
341
+ }
342
+ )
343
+ ] }) }),
344
+ isBlocked && /* @__PURE__ */ jsxs(BlockedWarning, { children: [
345
+ /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "bold", textColor: "danger700", children: t("panel.blocked.title", "User is blocked") }),
346
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "danger600", style: { marginTop: "4px" }, children: t("panel.blocked.description", "Authentication disabled") })
347
+ ] }),
218
348
  sessions.length > 0 ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 3, alignItems: "stretch", children: [
219
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: {
220
- textAlign: "left",
221
- letterSpacing: "0.5px",
222
- fontSize: "12px"
223
- }, children: t("panel.sessions.title", "Active Sessions") }),
349
+ /* @__PURE__ */ jsx(SectionLabel, { children: t("panel.sessions.title", "Active Sessions") }),
224
350
  sessions.slice(0, 5).map((session) => {
225
351
  const deviceInfo = parseUserAgent(session.userAgent);
226
352
  const DeviceIcon = getDeviceIcon(deviceInfo.device);
227
- return /* @__PURE__ */ jsx(
228
- Box,
229
- {
230
- padding: 4,
231
- background: "neutral0",
232
- hasRadius: true,
233
- style: {
234
- border: "1px solid #e3e8ef",
235
- boxShadow: "0 1px 3px rgba(0, 0, 0, 0.04)",
236
- transition: "all 0.2s ease"
237
- },
238
- onMouseEnter: (e) => {
239
- e.currentTarget.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.08)";
240
- e.currentTarget.style.borderColor = "#4945FF";
241
- },
242
- onMouseLeave: (e) => {
243
- e.currentTarget.style.boxShadow = "0 1px 3px rgba(0, 0, 0, 0.04)";
244
- e.currentTarget.style.borderColor = "#e3e8ef";
245
- },
246
- children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, alignItems: "flex-start", children: [
247
- /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
248
- /* @__PURE__ */ jsx(DeviceIcon, { width: "20px", height: "20px" }),
249
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "bold", textColor: "neutral800", children: deviceInfo.device })
250
- ] }),
251
- /* @__PURE__ */ jsx(
252
- Badge,
253
- {
254
- backgroundColor: "success600",
255
- textColor: "neutral0",
256
- size: "S",
257
- children: t("panel.sessions.active", "Active")
258
- }
259
- ),
260
- /* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "neutral600", children: [
261
- deviceInfo.browser,
262
- " on ",
263
- deviceInfo.os
264
- ] }),
265
- /* @__PURE__ */ jsx(Divider, {}),
266
- /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
267
- /* @__PURE__ */ jsx(Server, { width: "14px", height: "14px" }),
268
- /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: session.ipAddress })
269
- ] }),
270
- /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
271
- /* @__PURE__ */ jsx(Clock, { width: "14px", height: "14px" }),
272
- /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: new Date(session.loginTime).toLocaleString("en-US", {
273
- month: "short",
274
- day: "numeric",
275
- hour: "2-digit",
276
- minute: "2-digit"
277
- }) })
278
- ] }),
279
- session.minutesSinceActive !== void 0 && session.minutesSinceActive < 60 && /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "success600", fontWeight: "semiBold", children: session.minutesSinceActive === 0 ? t("panel.sessions.activeNow", "Active now") : t("panel.sessions.activeAgo", "Active {minutes} min ago", { minutes: session.minutesSinceActive }) })
280
- ] })
281
- },
282
- session.id
283
- );
353
+ return /* @__PURE__ */ jsx(SessionCard, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, alignItems: "flex-start", children: [
354
+ /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
355
+ /* @__PURE__ */ jsx(IconWrapper, { children: /* @__PURE__ */ jsx(DeviceIcon, {}) }),
356
+ /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "bold", textColor: "neutral800", children: deviceInfo.device })
357
+ ] }),
358
+ /* @__PURE__ */ jsx(Badge, { backgroundColor: "success600", textColor: "neutral0", size: "S", children: t("panel.sessions.active", "Active") }),
359
+ /* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "neutral600", children: [
360
+ deviceInfo.browser,
361
+ " on ",
362
+ deviceInfo.os
363
+ ] }),
364
+ /* @__PURE__ */ jsx(Divider, {}),
365
+ /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
366
+ /* @__PURE__ */ jsx(Server, { width: "14px", height: "14px", style: { color: "#9CA3AF" } }),
367
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: session.ipAddress })
368
+ ] }),
369
+ /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
370
+ /* @__PURE__ */ jsx(Clock, { width: "14px", height: "14px", style: { color: "#9CA3AF" } }),
371
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: new Date(session.loginTime).toLocaleString("en-US", {
372
+ month: "short",
373
+ day: "numeric",
374
+ hour: "2-digit",
375
+ minute: "2-digit"
376
+ }) })
377
+ ] }),
378
+ session.minutesSinceActive !== void 0 && session.minutesSinceActive < 60 && /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "success600", fontWeight: "semiBold", children: session.minutesSinceActive === 0 ? t("panel.sessions.activeNow", "Active now") : t("panel.sessions.activeAgo", "Active {minutes} min ago", { minutes: session.minutesSinceActive }) })
379
+ ] }) }, session.id);
284
380
  }),
285
- sessions.length > 5 && /* @__PURE__ */ jsx(Box, { padding: 3, background: "primary100", hasRadius: true, textAlign: "center", children: /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "primary600", fontWeight: "semiBold", children: t("panel.sessions.more", "+{count} more session{count, plural, one {} other {s}}", { count: sessions.length - 5 }) }) })
286
- ] }) : /* @__PURE__ */ jsx(
287
- Box,
288
- {
289
- padding: 6,
290
- background: "neutral100",
291
- hasRadius: true,
292
- style: {
293
- border: "1px dashed #dcdce4",
294
- textAlign: "center"
295
- },
296
- children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 2, children: [
297
- /* @__PURE__ */ jsx(
298
- Typography,
299
- {
300
- variant: "pi",
301
- textColor: "neutral600",
302
- style: { fontSize: "32px", marginBottom: "8px" },
303
- children: "💤"
304
- }
305
- ),
306
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", textColor: "neutral700", children: t("panel.empty.title", "No active sessions") }),
307
- /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", style: { fontSize: "13px" }, children: t("panel.empty.description", "User has not logged in yet") })
308
- ] })
309
- }
310
- ),
381
+ sessions.length > 5 && /* @__PURE__ */ jsx(Box, { padding: 3, background: "primary100", hasRadius: true, style: { textAlign: "center" }, children: /* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "primary600", fontWeight: "semiBold", children: [
382
+ "+",
383
+ sessions.length - 5,
384
+ " ",
385
+ t("panel.sessions.more", "more session"),
386
+ sessions.length - 5 !== 1 ? "s" : ""
387
+ ] }) })
388
+ ] }) : /* @__PURE__ */ jsxs(EmptyState, { children: [
389
+ /* @__PURE__ */ jsx(EmptyIcon, { children: /* @__PURE__ */ jsx(User, { width: "24px", height: "24px" }) }),
390
+ /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", textColor: "neutral700", style: { display: "block" }, children: t("panel.empty.title", "No active sessions") }),
391
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", style: { display: "block", marginTop: "4px" }, children: t("panel.empty.description", "User has not logged in yet") })
392
+ ] }),
311
393
  /* @__PURE__ */ jsx(Divider, {}),
312
394
  /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 3, alignItems: "stretch", children: [
313
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: {
314
- textAlign: "left",
315
- letterSpacing: "0.5px",
316
- fontSize: "12px"
317
- }, children: t("panel.actions.title", "Actions") }),
318
- /* @__PURE__ */ jsx(
319
- Button,
395
+ /* @__PURE__ */ jsx(SectionLabel, { children: t("panel.actions.title", "Actions") }),
396
+ /* @__PURE__ */ jsxs(
397
+ ActionButton,
320
398
  {
321
- variant: "secondary",
322
- size: "M",
323
- fullWidth: true,
399
+ $variant: "danger",
324
400
  onClick: handleLogoutAll,
325
401
  disabled: actionLoading || sessions.length === 0,
326
- startIcon: /* @__PURE__ */ jsx(Cross, {}),
327
- style: {
328
- border: "1px solid #dc2626",
329
- color: "#dc2626",
330
- backgroundColor: "transparent",
331
- transition: "all 0.2s ease"
332
- },
333
- onMouseEnter: (e) => {
334
- if (!actionLoading && sessions.length > 0) {
335
- e.currentTarget.style.backgroundColor = "#dc2626";
336
- e.currentTarget.style.color = "white";
337
- }
338
- },
339
- onMouseLeave: (e) => {
340
- if (!actionLoading && sessions.length > 0) {
341
- e.currentTarget.style.backgroundColor = "transparent";
342
- e.currentTarget.style.color = "#dc2626";
343
- }
344
- },
345
- children: t("panel.actions.terminateAll", "Terminate All Sessions")
402
+ type: "button",
403
+ children: [
404
+ /* @__PURE__ */ jsx(Cross, {}),
405
+ t("panel.actions.terminateAll", "Terminate All Sessions")
406
+ ]
346
407
  }
347
408
  ),
348
- /* @__PURE__ */ jsx(
349
- Button,
409
+ /* @__PURE__ */ jsxs(
410
+ ActionButton,
350
411
  {
351
- variant: "secondary",
352
- size: "M",
353
- fullWidth: true,
412
+ $variant: isBlocked ? "success" : "danger",
354
413
  onClick: handleToggleBlock,
355
414
  disabled: actionLoading,
356
- startIcon: isBlocked ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Cross, {}),
357
- style: {
358
- border: isBlocked ? "1px solid #16a34a" : "1px solid #dc2626",
359
- color: isBlocked ? "#16a34a" : "#dc2626",
360
- backgroundColor: "transparent",
361
- transition: "all 0.2s ease"
362
- },
363
- onMouseEnter: (e) => {
364
- if (!actionLoading) {
365
- e.currentTarget.style.backgroundColor = isBlocked ? "#16a34a" : "#dc2626";
366
- e.currentTarget.style.color = "white";
367
- }
368
- },
369
- onMouseLeave: (e) => {
370
- if (!actionLoading) {
371
- e.currentTarget.style.backgroundColor = "transparent";
372
- e.currentTarget.style.color = isBlocked ? "#16a34a" : "#dc2626";
373
- }
374
- },
375
- children: isBlocked ? t("panel.actions.unblockUser", "Unblock User") : t("panel.actions.blockUser", "Block User")
415
+ type: "button",
416
+ children: [
417
+ isBlocked ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Cross, {}),
418
+ isBlocked ? t("panel.actions.unblockUser", "Unblock User") : t("panel.actions.blockUser", "Block User")
419
+ ]
376
420
  }
377
421
  )
378
422
  ] })
@@ -396,7 +440,7 @@ const index = {
396
440
  id: `${pluginId}.plugin.name`,
397
441
  defaultMessage: pluginPkg.strapi.displayName
398
442
  },
399
- Component: () => import("./App-CahdcIEB.mjs")
443
+ Component: () => import("./App-Cs4KKd3L.mjs")
400
444
  });
401
445
  app.createSettingSection(
402
446
  {
@@ -412,7 +456,7 @@ const index = {
412
456
  },
413
457
  id: "upgrade",
414
458
  to: `${pluginId}/upgrade`,
415
- Component: () => import("./UpgradePage-mqr6dLVY.mjs")
459
+ Component: () => import("./UpgradePage-C441wvPX.mjs")
416
460
  },
417
461
  {
418
462
  intlLabel: {
@@ -421,7 +465,7 @@ const index = {
421
465
  },
422
466
  id: "general",
423
467
  to: `${pluginId}/general`,
424
- Component: () => import("./Settings-DOUUwwxB.mjs")
468
+ Component: () => import("./Settings-XloJ-aHl.mjs")
425
469
  },
426
470
  {
427
471
  intlLabel: {
@@ -430,7 +474,7 @@ const index = {
430
474
  },
431
475
  id: "analytics",
432
476
  to: `${pluginId}/analytics`,
433
- Component: () => import("./Analytics-BC4jdzBT.mjs")
477
+ Component: () => import("./Analytics-sX94t6D9.mjs")
434
478
  },
435
479
  {
436
480
  intlLabel: {
@@ -439,7 +483,7 @@ const index = {
439
483
  },
440
484
  id: "license",
441
485
  to: `${pluginId}/license`,
442
- Component: () => import("./License-BFx721o7.mjs")
486
+ Component: () => import("./License-CN5YpqIu.mjs")
443
487
  }
444
488
  ]
445
489
  );
@@ -457,7 +501,7 @@ const index = {
457
501
  defaultMessage: "Online Users"
458
502
  },
459
503
  component: async () => {
460
- const component = await import("./OnlineUsersWidget-r2ZgSnok.mjs");
504
+ const component = await import("./OnlineUsersWidget-ytykP_tA.mjs");
461
505
  return component.default;
462
506
  },
463
507
  id: "online-users-widget",
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect } from "react";
2
2
  import { useFetchClient } from "@strapi/strapi/admin";
3
- import { a as pluginId } from "./index-CUSrDKCG.mjs";
3
+ import { a as pluginId } from "./index-Ij0JRf9W.mjs";
4
4
  const useLicense = () => {
5
5
  const { get } = useFetchClient();
6
6
  const [isPremium, setIsPremium] = useState(false);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const react = require("react");
3
3
  const admin = require("@strapi/strapi/admin");
4
- const index = require("./index-BuxWeACw.js");
4
+ const index = require("./index-DtBfKBne.js");
5
5
  const useLicense = () => {
6
6
  const { get } = admin.useFetchClient();
7
7
  const [isPremium, setIsPremium] = react.useState(false);
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-BuxWeACw.js");
2
+ const index = require("../_chunks/index-DtBfKBne.js");
3
3
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-CUSrDKCG.mjs";
1
+ import { i } from "../_chunks/index-Ij0JRf9W.mjs";
2
2
  export {
3
3
  i as default
4
4
  };