strapi-plugin-magic-sessionmanager 4.0.1 → 4.0.2

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 (57) hide show
  1. package/README.md +2 -2
  2. package/admin/src/components/OnlineUsersWidget.jsx +11 -7
  3. package/admin/src/components/SessionDetailModal.jsx +42 -38
  4. package/admin/src/components/SessionInfoPanel.jsx +29 -20
  5. package/admin/src/index.js +9 -0
  6. package/admin/src/pages/HomePage.jsx +128 -161
  7. package/admin/src/pages/License.jsx +3 -3
  8. package/admin/src/pages/Settings.jsx +139 -135
  9. package/admin/src/pages/UpgradePage.jsx +448 -0
  10. package/admin/src/pluginId.js +1 -0
  11. package/admin/src/translations/de.json +294 -15
  12. package/admin/src/translations/en.json +293 -14
  13. package/admin/src/translations/es.json +284 -18
  14. package/admin/src/translations/fr.json +284 -18
  15. package/admin/src/translations/pt.json +284 -18
  16. package/admin/src/utils/theme.js +85 -0
  17. package/dist/_chunks/{Analytics-Dv9f_0eZ.mjs → Analytics-DTE_zmRV.mjs} +2 -2
  18. package/dist/_chunks/{Analytics-BBdv1I5y.js → Analytics-lw_JaOVy.js} +2 -2
  19. package/dist/_chunks/{App-CJaZPNjt.js → App-DDKYCjKw.js} +216 -206
  20. package/dist/_chunks/{App-CIQ-7sa7.mjs → App-DJW1ZNl5.mjs} +216 -206
  21. package/dist/_chunks/{License-nrmFxoBm.mjs → License-DaOFuImm.mjs} +4 -8
  22. package/dist/_chunks/{License-D24rgaZQ.js → License-Tk-6UfPl.js} +4 -8
  23. package/dist/_chunks/{OnlineUsersWidget-B8JS1xZu.js → OnlineUsersWidget-C1qTpsws.js} +11 -7
  24. package/dist/_chunks/{OnlineUsersWidget-ArMl0nen.mjs → OnlineUsersWidget-CADphbXG.mjs} +11 -7
  25. package/dist/_chunks/{Settings-D5dLEGc_.mjs → Settings-C9xvckgq.mjs} +191 -179
  26. package/dist/_chunks/{Settings-CqxgjU0y.js → Settings-DyEAuTNQ.js} +191 -179
  27. package/dist/_chunks/UpgradePage-Dssk8A0Z.js +354 -0
  28. package/dist/_chunks/UpgradePage-cINvE9zY.mjs +352 -0
  29. package/dist/_chunks/de-CDA1V0rF.mjs +292 -0
  30. package/dist/_chunks/de-I-Q-pWqu.js +292 -0
  31. package/dist/_chunks/en-Bd7_h-4e.js +292 -0
  32. package/dist/_chunks/en-DzmOCyzQ.mjs +292 -0
  33. package/dist/_chunks/es-BcAx18XG.js +277 -0
  34. package/dist/_chunks/es-Cx-SN6qV.mjs +277 -0
  35. package/dist/_chunks/fr-DCzYMuJ-.js +277 -0
  36. package/dist/_chunks/fr-DXlXE5Eo.mjs +277 -0
  37. package/dist/_chunks/{index-WH04CS1c.js → index-CWcvrfXc.js} +45 -42
  38. package/dist/_chunks/{index-Duk1_Wrz.mjs → index-DQO9bNP7.mjs} +45 -42
  39. package/dist/_chunks/pt-21-MAb72.js +277 -0
  40. package/dist/_chunks/pt-zsdTSjba.mjs +277 -0
  41. package/dist/_chunks/{useLicense-BwOlCyhc.js → useLicense-DtvJOszr.js} +1 -1
  42. package/dist/_chunks/{useLicense-Ce8GaxB0.mjs → useLicense-DxbD4Wf8.mjs} +1 -1
  43. package/dist/admin/index.js +1 -1
  44. package/dist/admin/index.mjs +1 -1
  45. package/dist/server/index.js +1 -1
  46. package/dist/server/index.mjs +1 -1
  47. package/package.json +1 -1
  48. package/dist/_chunks/de-BxFx1pwE.js +0 -23
  49. package/dist/_chunks/de-CdO3s01z.mjs +0 -23
  50. package/dist/_chunks/en-CsPpPJL3.mjs +0 -23
  51. package/dist/_chunks/en-RqmpDHdS.js +0 -23
  52. package/dist/_chunks/es-CuLHazN1.js +0 -23
  53. package/dist/_chunks/es-Dkmjhy9c.mjs +0 -23
  54. package/dist/_chunks/fr-BAJp2yhI.js +0 -23
  55. package/dist/_chunks/fr-Bssg_3UF.mjs +0 -23
  56. package/dist/_chunks/pt-BAP9cKs3.js +0 -23
  57. package/dist/_chunks/pt-BVNoNcuY.mjs +0 -23
@@ -4,12 +4,8 @@ import { Loader, Box, Alert, Flex, Typography, Button, Badge, Accordion } from "
4
4
  import { useFetchClient, useNotification } from "@strapi/strapi/admin";
5
5
  import { ArrowClockwise, Duplicate, Download, User, Shield, Sparkle, ChartBubble } from "@strapi/icons";
6
6
  import styled, { css, keyframes } from "styled-components";
7
- import { a as pluginId } from "./index-Duk1_Wrz.mjs";
7
+ import { a as pluginId } from "./index-DQO9bNP7.mjs";
8
8
  const theme = {
9
- colors: {
10
- neutral: { 200: "#E5E7EB" }
11
- },
12
- shadows: { sm: "0 1px 3px rgba(0,0,0,0.1)" },
13
9
  borderRadius: { lg: "12px" }
14
10
  };
15
11
  const fadeIn = keyframes`
@@ -29,9 +25,9 @@ const StickySaveBar = styled(Box)`
29
25
  position: sticky;
30
26
  top: 0;
31
27
  z-index: 10;
32
- background: white;
33
- border-bottom: 1px solid ${theme.colors.neutral[200]};
34
- box-shadow: ${theme.shadows.sm};
28
+ background: ${(props) => props.theme.colors.neutral0};
29
+ border-bottom: 1px solid ${(props) => props.theme.colors.neutral200};
30
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
35
31
  `;
36
32
  const LicenseKeyBanner = styled(Box)`
37
33
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
@@ -6,14 +6,10 @@ const designSystem = require("@strapi/design-system");
6
6
  const admin = require("@strapi/strapi/admin");
7
7
  const icons = require("@strapi/icons");
8
8
  const styled = require("styled-components");
9
- const index = require("./index-WH04CS1c.js");
9
+ const index = require("./index-CWcvrfXc.js");
10
10
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
11
11
  const styled__default = /* @__PURE__ */ _interopDefault(styled);
12
12
  const theme = {
13
- colors: {
14
- neutral: { 200: "#E5E7EB" }
15
- },
16
- shadows: { sm: "0 1px 3px rgba(0,0,0,0.1)" },
17
13
  borderRadius: { lg: "12px" }
18
14
  };
19
15
  const fadeIn = styled.keyframes`
@@ -33,9 +29,9 @@ const StickySaveBar = styled__default.default(designSystem.Box)`
33
29
  position: sticky;
34
30
  top: 0;
35
31
  z-index: 10;
36
- background: white;
37
- border-bottom: 1px solid ${theme.colors.neutral[200]};
38
- box-shadow: ${theme.shadows.sm};
32
+ background: ${(props) => props.theme.colors.neutral0};
33
+ border-bottom: 1px solid ${(props) => props.theme.colors.neutral200};
34
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
39
35
  `;
40
36
  const LicenseKeyBanner = styled__default.default(designSystem.Box)`
41
37
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
@@ -2,11 +2,15 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
+ const reactIntl = require("react-intl");
5
6
  const designSystem = require("@strapi/design-system");
6
7
  const icons = require("@strapi/icons");
7
8
  const admin = require("@strapi/strapi/admin");
9
+ const index = require("./index-CWcvrfXc.js");
8
10
  const OnlineUsersWidget = () => {
11
+ const { formatMessage } = reactIntl.useIntl();
9
12
  const { get } = admin.useFetchClient();
13
+ const t = (id, defaultMessage, values) => formatMessage({ id: index.getTranslation(id), defaultMessage }, values);
10
14
  const [stats, setStats] = react.useState({
11
15
  onlineNow: 0,
12
16
  offline: 0,
@@ -112,14 +116,14 @@ const OnlineUsersWidget = () => {
112
116
  }
113
117
  );
114
118
  if (loading) {
115
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "Loading..." }) });
119
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: t("common.loading", "Loading...") }) });
116
120
  }
117
121
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 0, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 3, gridCols: 2, children: [
118
122
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 1, children: /* @__PURE__ */ jsxRuntime.jsx(
119
123
  StatCard,
120
124
  {
121
125
  icon: icons.Check,
122
- label: "Online Now",
126
+ label: t("widget.stats.onlineNow", "Online Now"),
123
127
  value: stats.onlineNow,
124
128
  color: "success"
125
129
  }
@@ -128,7 +132,7 @@ const OnlineUsersWidget = () => {
128
132
  StatCard,
129
133
  {
130
134
  icon: icons.Cross,
131
- label: "Offline",
135
+ label: t("widget.stats.offline", "Offline"),
132
136
  value: stats.offline,
133
137
  color: "neutral"
134
138
  }
@@ -137,7 +141,7 @@ const OnlineUsersWidget = () => {
137
141
  StatCard,
138
142
  {
139
143
  icon: icons.Clock,
140
- label: "Last 15 min",
144
+ label: t("widget.stats.last15min", "Last 15 min"),
141
145
  value: stats.last15min,
142
146
  color: "primary"
143
147
  }
@@ -146,7 +150,7 @@ const OnlineUsersWidget = () => {
146
150
  StatCard,
147
151
  {
148
152
  icon: icons.Clock,
149
- label: "Last 30 min",
153
+ label: t("widget.stats.last30min", "Last 30 min"),
150
154
  value: stats.last30min,
151
155
  color: "secondary"
152
156
  }
@@ -155,7 +159,7 @@ const OnlineUsersWidget = () => {
155
159
  StatCard,
156
160
  {
157
161
  icon: icons.User,
158
- label: "Total Users",
162
+ label: t("widget.stats.totalUsers", "Total Users"),
159
163
  value: stats.totalUsers,
160
164
  color: "neutral"
161
165
  }
@@ -164,7 +168,7 @@ const OnlineUsersWidget = () => {
164
168
  StatCard,
165
169
  {
166
170
  icon: icons.Cross,
167
- label: "Blocked",
171
+ label: t("widget.stats.blocked", "Blocked"),
168
172
  value: stats.blocked,
169
173
  color: "danger"
170
174
  }
@@ -1,10 +1,14 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState, useCallback, useEffect } from "react";
3
+ import { useIntl } from "react-intl";
3
4
  import { Box, Typography, Flex, Grid } from "@strapi/design-system";
4
5
  import { Check, Cross, Clock, User } from "@strapi/icons";
5
6
  import { useFetchClient } from "@strapi/strapi/admin";
7
+ import { g as getTranslation } from "./index-DQO9bNP7.mjs";
6
8
  const OnlineUsersWidget = () => {
9
+ const { formatMessage } = useIntl();
7
10
  const { get } = useFetchClient();
11
+ const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation(id), defaultMessage }, values);
8
12
  const [stats, setStats] = useState({
9
13
  onlineNow: 0,
10
14
  offline: 0,
@@ -110,14 +114,14 @@ const OnlineUsersWidget = () => {
110
114
  }
111
115
  );
112
116
  if (loading) {
113
- return /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: "Loading..." }) });
117
+ return /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: t("common.loading", "Loading...") }) });
114
118
  }
115
119
  return /* @__PURE__ */ jsx(Box, { padding: 0, children: /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 3, children: /* @__PURE__ */ jsxs(Grid.Root, { gap: 3, gridCols: 2, children: [
116
120
  /* @__PURE__ */ jsx(Grid.Item, { col: 1, children: /* @__PURE__ */ jsx(
117
121
  StatCard,
118
122
  {
119
123
  icon: Check,
120
- label: "Online Now",
124
+ label: t("widget.stats.onlineNow", "Online Now"),
121
125
  value: stats.onlineNow,
122
126
  color: "success"
123
127
  }
@@ -126,7 +130,7 @@ const OnlineUsersWidget = () => {
126
130
  StatCard,
127
131
  {
128
132
  icon: Cross,
129
- label: "Offline",
133
+ label: t("widget.stats.offline", "Offline"),
130
134
  value: stats.offline,
131
135
  color: "neutral"
132
136
  }
@@ -135,7 +139,7 @@ const OnlineUsersWidget = () => {
135
139
  StatCard,
136
140
  {
137
141
  icon: Clock,
138
- label: "Last 15 min",
142
+ label: t("widget.stats.last15min", "Last 15 min"),
139
143
  value: stats.last15min,
140
144
  color: "primary"
141
145
  }
@@ -144,7 +148,7 @@ const OnlineUsersWidget = () => {
144
148
  StatCard,
145
149
  {
146
150
  icon: Clock,
147
- label: "Last 30 min",
151
+ label: t("widget.stats.last30min", "Last 30 min"),
148
152
  value: stats.last30min,
149
153
  color: "secondary"
150
154
  }
@@ -153,7 +157,7 @@ const OnlineUsersWidget = () => {
153
157
  StatCard,
154
158
  {
155
159
  icon: User,
156
- label: "Total Users",
160
+ label: t("widget.stats.totalUsers", "Total Users"),
157
161
  value: stats.totalUsers,
158
162
  color: "neutral"
159
163
  }
@@ -162,7 +166,7 @@ const OnlineUsersWidget = () => {
162
166
  StatCard,
163
167
  {
164
168
  icon: Cross,
165
- label: "Blocked",
169
+ label: t("widget.stats.blocked", "Blocked"),
166
170
  value: stats.blocked,
167
171
  color: "danger"
168
172
  }