strapi-plugin-magic-mark 3.3.1 → 3.4.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/_chunks/{App-PJuAWFXQ.js → App-DNyxeldt.js} +2 -62
- package/dist/_chunks/{App-CeYRinOC.mjs → App-D_Vllkur.mjs} +1 -61
- package/dist/_chunks/{UpgradePage-BWZTKs8A.mjs → UpgradePage-DuyIskve.mjs} +2 -2
- package/dist/_chunks/{UpgradePage-hQjPuiMV.js → UpgradePage-SzlmS6po.js} +2 -2
- package/dist/_chunks/{index-D1AjX5wc.js → index-CBwb0AEf.js} +1092 -172
- package/dist/_chunks/{index-Bh3DfbXD.mjs → index-QkINaIgJ.mjs} +1094 -174
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/package.json +3 -3
|
@@ -9,69 +9,9 @@ const designSystem = require("@strapi/design-system");
|
|
|
9
9
|
const icons = require("@strapi/icons");
|
|
10
10
|
const outline = require("@heroicons/react/24/outline");
|
|
11
11
|
const admin = require("@strapi/strapi/admin");
|
|
12
|
-
const index = require("./index-
|
|
12
|
+
const index = require("./index-CBwb0AEf.js");
|
|
13
13
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
14
14
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
15
|
-
const FEATURES = {
|
|
16
|
-
// Free tier features
|
|
17
|
-
basicBookmarks: { tier: "free", limit: 10 },
|
|
18
|
-
basicFilters: { tier: "free" },
|
|
19
|
-
// Premium tier features
|
|
20
|
-
extendedBookmarks: { tier: "premium", limit: 50 },
|
|
21
|
-
queryHistory: { tier: "premium" },
|
|
22
|
-
exportBookmarks: { tier: "premium" },
|
|
23
|
-
sharedBookmarks: { tier: "premium" },
|
|
24
|
-
// Advanced tier features
|
|
25
|
-
unlimitedBookmarks: { tier: "advanced", limit: -1 },
|
|
26
|
-
advancedFilters: { tier: "advanced" },
|
|
27
|
-
subGroups: { tier: "advanced" },
|
|
28
|
-
bulkOperations: { tier: "advanced" },
|
|
29
|
-
analytics: { tier: "advanced" },
|
|
30
|
-
customIntegrations: { tier: "advanced" }
|
|
31
|
-
};
|
|
32
|
-
const useLicenseInfo = () => {
|
|
33
|
-
const { get } = admin.useFetchClient();
|
|
34
|
-
const [limits, setLimits] = React.useState(null);
|
|
35
|
-
const [isLoading, setIsLoading] = React.useState(true);
|
|
36
|
-
React.useEffect(() => {
|
|
37
|
-
const fetchLimits = async () => {
|
|
38
|
-
try {
|
|
39
|
-
console.log("[useLicenseInfo] Fetching license limits...");
|
|
40
|
-
const response = await get("/magic-mark/license/limits");
|
|
41
|
-
console.log("[useLicenseInfo] Raw API response:", response);
|
|
42
|
-
console.log("[useLicenseInfo] Response data:", response.data);
|
|
43
|
-
if (response.data?.success) {
|
|
44
|
-
console.log("[useLicenseInfo] Setting limits:", response.data.data);
|
|
45
|
-
setLimits(response.data.data);
|
|
46
|
-
} else {
|
|
47
|
-
console.warn("[useLicenseInfo] API returned success=false or missing data");
|
|
48
|
-
}
|
|
49
|
-
} catch (error) {
|
|
50
|
-
console.error("[useLicenseInfo] Error fetching license limits:", error);
|
|
51
|
-
} finally {
|
|
52
|
-
setIsLoading(false);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
fetchLimits();
|
|
56
|
-
}, []);
|
|
57
|
-
const tier = limits?.tier || "free";
|
|
58
|
-
const isPremium = tier === "premium" || tier === "advanced";
|
|
59
|
-
const isAdvanced = tier === "advanced";
|
|
60
|
-
console.log("[useLicenseInfo] Computed values:", { tier, isPremium, isAdvanced, limits });
|
|
61
|
-
return {
|
|
62
|
-
isLoading,
|
|
63
|
-
limits,
|
|
64
|
-
tier,
|
|
65
|
-
isFree: tier === "free",
|
|
66
|
-
isPremium,
|
|
67
|
-
isAdvanced,
|
|
68
|
-
canUseFeature: (feature) => {
|
|
69
|
-
const featureConfig = FEATURES[feature];
|
|
70
|
-
const tierOrder = { free: 0, premium: 1, advanced: 2 };
|
|
71
|
-
return tierOrder[tier] >= tierOrder[featureConfig.tier];
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
15
|
const theme = {
|
|
76
16
|
colors: {
|
|
77
17
|
primary: {
|
|
@@ -459,7 +399,7 @@ const HomePageModern = () => {
|
|
|
459
399
|
const { formatMessage } = reactIntl.useIntl();
|
|
460
400
|
const navigate = reactRouterDom.useNavigate();
|
|
461
401
|
const { get, post, del } = admin.useFetchClient();
|
|
462
|
-
useLicenseInfo();
|
|
402
|
+
index.useLicenseInfo();
|
|
463
403
|
const [currentUser, setCurrentUser] = React.useState(null);
|
|
464
404
|
const [bookmarks, setBookmarks] = React.useState([]);
|
|
465
405
|
const [loading, setLoading] = React.useState(false);
|
|
@@ -7,67 +7,7 @@ import { Flex, Loader, Box, Typography, SingleSelect, SingleSelectOption, Thead,
|
|
|
7
7
|
import { Pin, Eye, Pencil, Trash, Cross, Key, User, Mail, Check } from "@strapi/icons";
|
|
8
8
|
import { BookOpenIcon, UserIcon, SparklesIcon, LinkIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";
|
|
9
9
|
import { useFetchClient, useNotification } from "@strapi/strapi/admin";
|
|
10
|
-
import { p as pluginId, g as getIconById, C as CreateEditModal } from "./index-
|
|
11
|
-
const FEATURES = {
|
|
12
|
-
// Free tier features
|
|
13
|
-
basicBookmarks: { tier: "free", limit: 10 },
|
|
14
|
-
basicFilters: { tier: "free" },
|
|
15
|
-
// Premium tier features
|
|
16
|
-
extendedBookmarks: { tier: "premium", limit: 50 },
|
|
17
|
-
queryHistory: { tier: "premium" },
|
|
18
|
-
exportBookmarks: { tier: "premium" },
|
|
19
|
-
sharedBookmarks: { tier: "premium" },
|
|
20
|
-
// Advanced tier features
|
|
21
|
-
unlimitedBookmarks: { tier: "advanced", limit: -1 },
|
|
22
|
-
advancedFilters: { tier: "advanced" },
|
|
23
|
-
subGroups: { tier: "advanced" },
|
|
24
|
-
bulkOperations: { tier: "advanced" },
|
|
25
|
-
analytics: { tier: "advanced" },
|
|
26
|
-
customIntegrations: { tier: "advanced" }
|
|
27
|
-
};
|
|
28
|
-
const useLicenseInfo = () => {
|
|
29
|
-
const { get } = useFetchClient();
|
|
30
|
-
const [limits, setLimits] = useState(null);
|
|
31
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
const fetchLimits = async () => {
|
|
34
|
-
try {
|
|
35
|
-
console.log("[useLicenseInfo] Fetching license limits...");
|
|
36
|
-
const response = await get("/magic-mark/license/limits");
|
|
37
|
-
console.log("[useLicenseInfo] Raw API response:", response);
|
|
38
|
-
console.log("[useLicenseInfo] Response data:", response.data);
|
|
39
|
-
if (response.data?.success) {
|
|
40
|
-
console.log("[useLicenseInfo] Setting limits:", response.data.data);
|
|
41
|
-
setLimits(response.data.data);
|
|
42
|
-
} else {
|
|
43
|
-
console.warn("[useLicenseInfo] API returned success=false or missing data");
|
|
44
|
-
}
|
|
45
|
-
} catch (error) {
|
|
46
|
-
console.error("[useLicenseInfo] Error fetching license limits:", error);
|
|
47
|
-
} finally {
|
|
48
|
-
setIsLoading(false);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
fetchLimits();
|
|
52
|
-
}, []);
|
|
53
|
-
const tier = limits?.tier || "free";
|
|
54
|
-
const isPremium = tier === "premium" || tier === "advanced";
|
|
55
|
-
const isAdvanced = tier === "advanced";
|
|
56
|
-
console.log("[useLicenseInfo] Computed values:", { tier, isPremium, isAdvanced, limits });
|
|
57
|
-
return {
|
|
58
|
-
isLoading,
|
|
59
|
-
limits,
|
|
60
|
-
tier,
|
|
61
|
-
isFree: tier === "free",
|
|
62
|
-
isPremium,
|
|
63
|
-
isAdvanced,
|
|
64
|
-
canUseFeature: (feature) => {
|
|
65
|
-
const featureConfig = FEATURES[feature];
|
|
66
|
-
const tierOrder = { free: 0, premium: 1, advanced: 2 };
|
|
67
|
-
return tierOrder[tier] >= tierOrder[featureConfig.tier];
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
};
|
|
10
|
+
import { u as useLicenseInfo, p as pluginId, g as getIconById, C as CreateEditModal } from "./index-QkINaIgJ.mjs";
|
|
71
11
|
const theme = {
|
|
72
12
|
colors: {
|
|
73
13
|
primary: {
|
|
@@ -5,7 +5,7 @@ import { useFetchClient, useNotification } from "@strapi/strapi/admin";
|
|
|
5
5
|
import styled from "styled-components";
|
|
6
6
|
import { Flex, Typography, Box, Badge, Button } from "@strapi/design-system";
|
|
7
7
|
import { Check, Cross, Sparkle, Lightning, Rocket } from "@strapi/icons";
|
|
8
|
-
import { p as pluginId } from "./index-
|
|
8
|
+
import { p as pluginId } from "./index-QkINaIgJ.mjs";
|
|
9
9
|
const Container = styled(Box)`
|
|
10
10
|
padding: 32px;
|
|
11
11
|
max-width: 1400px;
|
|
@@ -128,7 +128,7 @@ const FeatureIcon = styled(Box)`
|
|
|
128
128
|
background: rgba(34, 197, 94, 0.15);
|
|
129
129
|
svg { color: #16A34A; }
|
|
130
130
|
` : `
|
|
131
|
-
background:
|
|
131
|
+
background: rgba(239, 68, 68, 0.12);
|
|
132
132
|
svg { color: #DC2626; }
|
|
133
133
|
`}
|
|
134
134
|
`;
|
|
@@ -7,7 +7,7 @@ const admin = require("@strapi/strapi/admin");
|
|
|
7
7
|
const styled = require("styled-components");
|
|
8
8
|
const designSystem = require("@strapi/design-system");
|
|
9
9
|
const icons = require("@strapi/icons");
|
|
10
|
-
const index = require("./index-
|
|
10
|
+
const index = require("./index-CBwb0AEf.js");
|
|
11
11
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
12
12
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
13
13
|
const Container = styled__default.default(designSystem.Box)`
|
|
@@ -132,7 +132,7 @@ const FeatureIcon = styled__default.default(designSystem.Box)`
|
|
|
132
132
|
background: rgba(34, 197, 94, 0.15);
|
|
133
133
|
svg { color: #16A34A; }
|
|
134
134
|
` : `
|
|
135
|
-
background:
|
|
135
|
+
background: rgba(239, 68, 68, 0.12);
|
|
136
136
|
svg { color: #DC2626; }
|
|
137
137
|
`}
|
|
138
138
|
`;
|