@moontra/moonui-pro 3.3.4 → 3.3.5
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/cdn/index.global.js +1 -1
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.mjs +26 -10
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2118,6 +2118,21 @@ var AUTH_CONFIG = {
|
|
|
2118
2118
|
// src/lib/license-token-client.ts
|
|
2119
2119
|
function readLicenseTokenClient() {
|
|
2120
2120
|
try {
|
|
2121
|
+
const envToken = process.env.NEXT_PUBLIC_MOONUI_PRO_TOKEN;
|
|
2122
|
+
if (envToken) {
|
|
2123
|
+
try {
|
|
2124
|
+
const decodedToken = typeof window !== "undefined" ? atob(envToken) : Buffer.from(envToken, "base64").toString("utf8");
|
|
2125
|
+
const token2 = JSON.parse(decodedToken);
|
|
2126
|
+
if (token2.expiresAt < Date.now()) {
|
|
2127
|
+
console.log("[MoonUI] Environment license token expired");
|
|
2128
|
+
} else {
|
|
2129
|
+
console.log("[MoonUI] Using environment license token (production)");
|
|
2130
|
+
return token2;
|
|
2131
|
+
}
|
|
2132
|
+
} catch (error) {
|
|
2133
|
+
console.error("[MoonUI] Error parsing environment token:", error);
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2121
2136
|
if (typeof window === "undefined" || !window.localStorage) {
|
|
2122
2137
|
return null;
|
|
2123
2138
|
}
|
|
@@ -2131,6 +2146,7 @@ function readLicenseTokenClient() {
|
|
|
2131
2146
|
localStorage.removeItem("moonui_license_token");
|
|
2132
2147
|
return null;
|
|
2133
2148
|
}
|
|
2149
|
+
console.log("[MoonUI] Using localStorage license token (development)");
|
|
2134
2150
|
return token;
|
|
2135
2151
|
} catch (error) {
|
|
2136
2152
|
console.error("[MoonUI] Error reading client license token:", error);
|
|
@@ -2260,12 +2276,12 @@ function MoonUIAuthProvider({ children }) {
|
|
|
2260
2276
|
);
|
|
2261
2277
|
const freeState = {
|
|
2262
2278
|
isLoading: false,
|
|
2263
|
-
hasProAccess:
|
|
2264
|
-
isAuthenticated:
|
|
2265
|
-
subscriptionPlan: "
|
|
2279
|
+
hasProAccess: false,
|
|
2280
|
+
isAuthenticated: false,
|
|
2281
|
+
subscriptionPlan: "free",
|
|
2266
2282
|
subscription: {
|
|
2267
|
-
status: "
|
|
2268
|
-
plan: "
|
|
2283
|
+
status: "inactive",
|
|
2284
|
+
plan: "free"
|
|
2269
2285
|
},
|
|
2270
2286
|
isAdmin: false
|
|
2271
2287
|
};
|
|
@@ -2278,12 +2294,12 @@ function MoonUIAuthProvider({ children }) {
|
|
|
2278
2294
|
console.error("[MoonUI Auth] Validation error:", error);
|
|
2279
2295
|
const errorState = {
|
|
2280
2296
|
isLoading: false,
|
|
2281
|
-
hasProAccess:
|
|
2282
|
-
isAuthenticated:
|
|
2283
|
-
subscriptionPlan: "
|
|
2297
|
+
hasProAccess: false,
|
|
2298
|
+
isAuthenticated: false,
|
|
2299
|
+
subscriptionPlan: "free",
|
|
2284
2300
|
subscription: {
|
|
2285
|
-
status: "
|
|
2286
|
-
plan: "
|
|
2301
|
+
status: "inactive",
|
|
2302
|
+
plan: "free"
|
|
2287
2303
|
},
|
|
2288
2304
|
isAdmin: false
|
|
2289
2305
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.5",
|
|
4
4
|
"description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|