strapi-plugin-magic-mark 3.4.0 → 4.0.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +366 -0
  2. package/README.md +390 -619
  3. package/dist/admin/App-C9PsvW9C.mjs +580 -0
  4. package/dist/admin/App-KJvUCwN1.js +580 -0
  5. package/dist/admin/PinnedBookmarksWidget-ClskVR1i.mjs +55 -0
  6. package/dist/admin/PinnedBookmarksWidget-DlD8lDhq.js +55 -0
  7. package/dist/admin/de-BF0nCjGF.mjs +183 -0
  8. package/dist/admin/de-Cn90CcnC.js +183 -0
  9. package/dist/admin/en-D-EGHodf.mjs +183 -0
  10. package/dist/admin/en-GDfO_EfL.js +183 -0
  11. package/dist/admin/es-6o-_RABX.js +183 -0
  12. package/dist/admin/es-C33BufuB.mjs +183 -0
  13. package/dist/admin/fr-BOZS5mJT.js +183 -0
  14. package/dist/admin/fr-DJHTjkmb.mjs +183 -0
  15. package/dist/admin/index-CLjQOzqv.js +1770 -0
  16. package/dist/admin/index-X8I03cOT.mjs +1769 -0
  17. package/dist/admin/index.js +4 -2
  18. package/dist/admin/index.mjs +2 -1
  19. package/dist/admin/pt-D13SxuK2.js +183 -0
  20. package/dist/admin/pt-yoB1jrsq.mjs +183 -0
  21. package/dist/server/index.js +1129 -1542
  22. package/dist/server/index.mjs +1126 -1539
  23. package/package.json +90 -54
  24. package/strapi-admin.js +5 -0
  25. package/strapi-server.js +2 -1
  26. package/COPYRIGHT_NOTICE.txt +0 -20
  27. package/dist/_chunks/App-DNyxeldt.js +0 -1451
  28. package/dist/_chunks/App-D_Vllkur.mjs +0 -1449
  29. package/dist/_chunks/UpgradePage-DuyIskve.mjs +0 -351
  30. package/dist/_chunks/UpgradePage-SzlmS6po.js +0 -353
  31. package/dist/_chunks/de-Cs9dd3Mr.js +0 -138
  32. package/dist/_chunks/de-DOVki5VS.mjs +0 -138
  33. package/dist/_chunks/en-CE3r46Y2.js +0 -138
  34. package/dist/_chunks/en-Cf5-O03L.mjs +0 -138
  35. package/dist/_chunks/es-Ba6JcPIm.mjs +0 -138
  36. package/dist/_chunks/es-D4AOyJYJ.js +0 -138
  37. package/dist/_chunks/fr-CWSfoA8i.js +0 -138
  38. package/dist/_chunks/fr-CrMBXR3c.mjs +0 -138
  39. package/dist/_chunks/index-CBwb0AEf.js +0 -3618
  40. package/dist/_chunks/index-JirQF8zE.mjs +0 -328
  41. package/dist/_chunks/index-QkINaIgJ.mjs +0 -3614
  42. package/dist/_chunks/index-uUErgmi9.js +0 -330
  43. package/dist/_chunks/pt-BXxZ1Zym.mjs +0 -138
  44. package/dist/_chunks/pt-DW_6r_mP.js +0 -138
  45. package/pics/advancedFilters.png +0 -0
  46. package/pics/dashboard.png +0 -0
  47. package/pics/quickaccesinContentmanager.png +0 -0
  48. package/pics/saveAsMagicMark.png +0 -0
@@ -1,328 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect } from "react";
3
- import { Loader, Box, Alert, Flex, Typography, Button, Badge, Accordion } from "@strapi/design-system";
4
- import { useFetchClient, useNotification } from "@strapi/strapi/admin";
5
- import { ArrowClockwise, Duplicate, Download, User, Shield, Sparkle, Check, Cross, ChartBubble } from "@strapi/icons";
6
- import styled, { keyframes } from "styled-components";
7
- const theme = {
8
- shadows: { sm: "0 1px 3px rgba(0,0,0,0.1)" },
9
- borderRadius: { lg: "12px" }
10
- };
11
- const fadeIn = keyframes`
12
- from { opacity: 0; transform: translateY(10px); }
13
- to { opacity: 1; transform: translateY(0); }
14
- `;
15
- const shimmer = keyframes`
16
- 0% { background-position: -200% 0; }
17
- 100% { background-position: 200% 0; }
18
- `;
19
- const Container = styled(Box)`
20
- animation: ${fadeIn} 0.5s;
21
- max-width: 1400px;
22
- margin: 0 auto;
23
- `;
24
- const StickySaveBar = styled(Box)`
25
- position: sticky;
26
- top: 0;
27
- z-index: 10;
28
- background: ${(p) => p.theme.colors.neutral0};
29
- border-bottom: 1px solid rgba(128, 128, 128, 0.2);
30
- box-shadow: ${theme.shadows.sm};
31
- `;
32
- const LicenseKeyBanner = styled(Box)`
33
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
34
- border-radius: ${theme.borderRadius.lg};
35
- padding: 28px 32px;
36
- color: white;
37
- position: relative;
38
- overflow: hidden;
39
- box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
40
- margin-bottom: 24px;
41
-
42
- &::after {
43
- content: '';
44
- position: absolute;
45
- top: -50%;
46
- right: -50%;
47
- width: 200%;
48
- height: 200%;
49
- background: linear-gradient(
50
- 45deg,
51
- transparent,
52
- rgba(255, 255, 255, 0.08),
53
- transparent
54
- );
55
- animation: ${shimmer} 3s infinite;
56
- pointer-events: none;
57
- z-index: 0;
58
- }
59
-
60
- & > * {
61
- position: relative;
62
- z-index: 1;
63
- }
64
- `;
65
- const LoaderContainer = styled(Flex)`
66
- min-height: 400px;
67
- align-items: center;
68
- justify-content: center;
69
- flex-direction: column;
70
- gap: 16px;
71
- `;
72
- const LicensePage = () => {
73
- const { get } = useFetchClient();
74
- const { toggleNotification } = useNotification();
75
- const [loading, setLoading] = useState(true);
76
- const [licenseData, setLicenseData] = useState(null);
77
- const [error, setError] = useState(null);
78
- const fetchLicenseStatus = async () => {
79
- setLoading(true);
80
- setError(null);
81
- try {
82
- const response = await get("/magic-mark/license/status");
83
- setLicenseData(response.data);
84
- } catch (err) {
85
- console.error("Error fetching license:", err);
86
- setError("Failed to load license information");
87
- } finally {
88
- setLoading(false);
89
- }
90
- };
91
- const handleCopyLicenseKey = async () => {
92
- try {
93
- await navigator.clipboard.writeText(licenseData?.data?.licenseKey || "");
94
- toggleNotification({
95
- type: "success",
96
- message: "License key copied to clipboard!"
97
- });
98
- } catch (err) {
99
- toggleNotification({
100
- type: "danger",
101
- message: "Failed to copy license key"
102
- });
103
- }
104
- };
105
- const handleDownloadLicenseKey = () => {
106
- try {
107
- const data2 = licenseData?.data || {};
108
- const licenseKey = data2.licenseKey || "";
109
- const email = data2.email || "N/A";
110
- const firstName = data2.firstName || "";
111
- const lastName = data2.lastName || "";
112
- const fullName = `${firstName} ${lastName}`.trim() || "N/A";
113
- const content = `MagicMark Plugin License Key
114
- ═══════════════════════════════════════
115
-
116
- License Key: ${licenseKey}
117
-
118
- License Holder Information:
119
- ──────────────────────────────────────
120
- Name: ${fullName}
121
- Email: ${email}
122
-
123
- License Status:
124
- ──────────────────────────────────────
125
- Status: ${data2.isActive ? "ACTIVE" : "INACTIVE"}
126
- Expires: ${data2.expiresAt ? new Date(data2.expiresAt).toLocaleDateString() : "Never"}
127
-
128
- ═══════════════════════════════════════
129
- Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
130
- `;
131
- const blob = new Blob([content], { type: "text/plain" });
132
- const url = window.URL.createObjectURL(blob);
133
- const link = document.createElement("a");
134
- link.href = url;
135
- link.download = `magicmark-license-${licenseKey.substring(0, 8)}.txt`;
136
- document.body.appendChild(link);
137
- link.click();
138
- document.body.removeChild(link);
139
- window.URL.revokeObjectURL(url);
140
- toggleNotification({
141
- type: "success",
142
- message: "License key downloaded successfully!"
143
- });
144
- } catch (err) {
145
- toggleNotification({
146
- type: "danger",
147
- message: "Failed to download license key"
148
- });
149
- }
150
- };
151
- useEffect(() => {
152
- fetchLicenseStatus();
153
- }, []);
154
- if (loading) {
155
- return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(LoaderContainer, { children: /* @__PURE__ */ jsx(Loader, { children: "Loading license information..." }) }) });
156
- }
157
- if (error) {
158
- return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(Box, { padding: 8, children: /* @__PURE__ */ jsx(Alert, { variant: "danger", title: "Error", closeLabel: "Close", children: error }) }) });
159
- }
160
- const isValid = licenseData?.valid;
161
- const isDemo = licenseData?.demo;
162
- const data = licenseData?.data || {};
163
- return /* @__PURE__ */ jsxs(Container, { children: [
164
- /* @__PURE__ */ jsx(StickySaveBar, { paddingTop: 5, paddingBottom: 5, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", children: [
165
- /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, children: [
166
- /* @__PURE__ */ jsx(Typography, { variant: "alpha", fontWeight: "bold", children: "License Management" }),
167
- /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: "View your MagicMark plugin license" })
168
- ] }),
169
- /* @__PURE__ */ jsx(
170
- Button,
171
- {
172
- startIcon: /* @__PURE__ */ jsx(ArrowClockwise, {}),
173
- onClick: fetchLicenseStatus,
174
- size: "L",
175
- style: {
176
- background: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
177
- color: "white",
178
- fontWeight: "600",
179
- border: "none"
180
- },
181
- children: "Refresh Status"
182
- }
183
- )
184
- ] }) }),
185
- /* @__PURE__ */ jsxs(Box, { paddingTop: 6, paddingLeft: 6, paddingRight: 6, paddingBottom: 10, children: [
186
- isDemo ? /* @__PURE__ */ jsx(Alert, { variant: "warning", title: "Demo Mode", closeLabel: "Close", children: "You're using the demo version. Create a license to unlock all features." }) : isValid ? /* @__PURE__ */ jsx(Alert, { variant: "success", title: "License Active", closeLabel: "Close", children: "Your license is active and all features are unlocked." }) : /* @__PURE__ */ jsx(Alert, { variant: "danger", title: "License Issue", closeLabel: "Close", children: "There's an issue with your license. Please check your license status." }),
187
- data.licenseKey && /* @__PURE__ */ jsx(Box, { marginTop: 6, children: /* @__PURE__ */ jsx(LicenseKeyBanner, { children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", children: [
188
- /* @__PURE__ */ jsxs(Box, { style: { flex: 1 }, children: [
189
- /* @__PURE__ */ jsx(Typography, { variant: "pi", style: { color: "rgba(255,255,255,0.8)", marginBottom: "12px", textTransform: "uppercase", fontSize: "11px", letterSpacing: "0.5px", display: "block" }, children: "License Key" }),
190
- /* @__PURE__ */ jsx(Typography, { style: { color: "white", fontFamily: "monospace", fontSize: "28px", fontWeight: "bold", wordBreak: "break-all", marginBottom: "16px" }, children: data.licenseKey }),
191
- /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
192
- /* @__PURE__ */ jsx(
193
- Button,
194
- {
195
- onClick: handleCopyLicenseKey,
196
- startIcon: /* @__PURE__ */ jsx(Duplicate, {}),
197
- size: "S",
198
- variant: "secondary",
199
- style: {
200
- backgroundColor: "rgba(255,255,255,0.2)",
201
- color: "white",
202
- border: "1px solid rgba(255,255,255,0.3)",
203
- fontWeight: "600"
204
- },
205
- children: "Copy Key"
206
- }
207
- ),
208
- /* @__PURE__ */ jsx(
209
- Button,
210
- {
211
- onClick: handleDownloadLicenseKey,
212
- startIcon: /* @__PURE__ */ jsx(Download, {}),
213
- size: "S",
214
- variant: "secondary",
215
- style: {
216
- backgroundColor: "rgba(255,255,255,0.2)",
217
- color: "white",
218
- border: "1px solid rgba(255,255,255,0.3)",
219
- fontWeight: "600"
220
- },
221
- children: "Download as TXT"
222
- }
223
- )
224
- ] })
225
- ] }),
226
- /* @__PURE__ */ jsx(
227
- Badge,
228
- {
229
- backgroundColor: data.isActive ? "success100" : "danger100",
230
- textColor: data.isActive ? "success700" : "danger700",
231
- style: { fontSize: "11px", fontWeight: "700", padding: "6px 12px", marginLeft: "16px", flexShrink: 0 },
232
- children: data.isActive ? "ACTIVE" : "INACTIVE"
233
- }
234
- )
235
- ] }) }) }),
236
- /* @__PURE__ */ jsx(Box, { marginTop: 6, children: /* @__PURE__ */ jsxs(Accordion.Root, { defaultValue: "account", collapsible: true, children: [
237
- /* @__PURE__ */ jsxs(Accordion.Item, { value: "account", children: [
238
- /* @__PURE__ */ jsx(Accordion.Header, { children: /* @__PURE__ */ jsx(Accordion.Trigger, { icon: User, children: "Account Information" }) }),
239
- /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(Box, { padding: 6, children: /* @__PURE__ */ jsxs(Flex, { gap: 8, wrap: "wrap", children: [
240
- /* @__PURE__ */ jsxs(Box, { style: { flex: "1", minWidth: "200px" }, children: [
241
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: "Email Address" }),
242
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: data.email || "Not provided" })
243
- ] }),
244
- /* @__PURE__ */ jsxs(Box, { style: { flex: "1", minWidth: "200px" }, children: [
245
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: "License Holder" }),
246
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: data.firstName && data.lastName ? `${data.firstName} ${data.lastName}` : "Not specified" })
247
- ] })
248
- ] }) }) })
249
- ] }),
250
- /* @__PURE__ */ jsxs(Accordion.Item, { value: "details", children: [
251
- /* @__PURE__ */ jsx(Accordion.Header, { children: /* @__PURE__ */ jsx(Accordion.Trigger, { icon: Shield, children: "License Details" }) }),
252
- /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(Box, { padding: 6, children: /* @__PURE__ */ jsxs(Flex, { gap: 8, wrap: "wrap", children: [
253
- /* @__PURE__ */ jsxs(Box, { style: { flex: "1", minWidth: "180px" }, children: [
254
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: data.isExpired ? "Expired On" : "Expires On" }),
255
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: data.expiresAt ? new Date(data.expiresAt).toLocaleDateString("en-US", {
256
- year: "numeric",
257
- month: "long",
258
- day: "numeric"
259
- }) : "Never" })
260
- ] }),
261
- /* @__PURE__ */ jsxs(Box, { style: { flex: "1", minWidth: "180px" }, children: [
262
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: "Device Name" }),
263
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: data.deviceName || "Unknown" })
264
- ] }),
265
- /* @__PURE__ */ jsxs(Box, { style: { flex: "1", minWidth: "180px" }, children: [
266
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: "IP Address" }),
267
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: data.ipAddress || "Not detected" })
268
- ] })
269
- ] }) }) })
270
- ] }),
271
- /* @__PURE__ */ jsxs(Accordion.Item, { value: "features", children: [
272
- /* @__PURE__ */ jsx(Accordion.Header, { children: /* @__PURE__ */ jsx(Accordion.Trigger, { icon: Sparkle, children: "Features & Capabilities" }) }),
273
- /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(Box, { padding: 6, children: /* @__PURE__ */ jsxs(Flex, { gap: 8, wrap: "wrap", children: [
274
- /* @__PURE__ */ jsxs(Box, { style: { flex: "1", minWidth: "180px" }, children: [
275
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: "Premium Features" }),
276
- /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 1, children: [
277
- data.features?.premium ? /* @__PURE__ */ jsx(Check, { fill: "success600" }) : /* @__PURE__ */ jsx(Cross, { fill: "danger600" }),
278
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: data.features?.premium ? "Enabled" : "Disabled" })
279
- ] })
280
- ] }),
281
- /* @__PURE__ */ jsxs(Box, { style: { flex: "1", minWidth: "180px" }, children: [
282
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: "Advanced Features" }),
283
- /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 1, children: [
284
- data.features?.advanced ? /* @__PURE__ */ jsx(Check, { fill: "success600" }) : /* @__PURE__ */ jsx(Cross, { fill: "danger600" }),
285
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: data.features?.advanced ? "Enabled" : "Disabled" })
286
- ] })
287
- ] }),
288
- /* @__PURE__ */ jsxs(Box, { style: { flex: "1", minWidth: "180px" }, children: [
289
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: "Enterprise Features" }),
290
- /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 1, children: [
291
- data.features?.enterprise ? /* @__PURE__ */ jsx(Check, { fill: "success600" }) : /* @__PURE__ */ jsx(Cross, { fill: "danger600" }),
292
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: data.features?.enterprise ? "Enabled" : "Disabled" })
293
- ] })
294
- ] })
295
- ] }) }) })
296
- ] }),
297
- /* @__PURE__ */ jsxs(Accordion.Item, { value: "status", children: [
298
- /* @__PURE__ */ jsx(Accordion.Header, { children: /* @__PURE__ */ jsx(Accordion.Trigger, { icon: ChartBubble, children: "System Status" }) }),
299
- /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(Box, { padding: 6, children: /* @__PURE__ */ jsxs(Flex, { gap: 8, wrap: "wrap", children: [
300
- /* @__PURE__ */ jsxs(Box, { style: { flex: "1", minWidth: "150px" }, children: [
301
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: "License Status" }),
302
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: data.isActive ? "Active" : "Inactive" })
303
- ] }),
304
- /* @__PURE__ */ jsxs(Box, { style: { flex: "1", minWidth: "150px" }, children: [
305
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: "Connection" }),
306
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: data.isOnline ? "Online" : "Offline" })
307
- ] }),
308
- /* @__PURE__ */ jsxs(Box, { style: { flex: "1", minWidth: "150px" }, children: [
309
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: "Last Sync" }),
310
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: data.lastPingAt ? new Date(data.lastPingAt).toLocaleTimeString() : "Never" })
311
- ] }),
312
- /* @__PURE__ */ jsxs(Box, { style: { flex: "1", minWidth: "150px" }, children: [
313
- /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: "Device Limit" }),
314
- /* @__PURE__ */ jsxs(Typography, { variant: "omega", fontWeight: "semiBold", children: [
315
- data.currentDevices || 0,
316
- " / ",
317
- data.maxDevices || 1
318
- ] })
319
- ] })
320
- ] }) }) })
321
- ] })
322
- ] }) })
323
- ] })
324
- ] });
325
- };
326
- export {
327
- LicensePage as default
328
- };