@moontra/moonui-pro 2.37.11 → 2.37.12
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 +85 -85
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.mjs +6 -61
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2185,12 +2185,14 @@ function MoonUIAuthProvider({ children }) {
|
|
|
2185
2185
|
authPromise = (async () => {
|
|
2186
2186
|
try {
|
|
2187
2187
|
lastFetchTime = now;
|
|
2188
|
-
const
|
|
2189
|
-
|
|
2188
|
+
const isProduction = false;
|
|
2189
|
+
const isDevelopment = true;
|
|
2190
|
+
const isLocalhost = typeof window !== "undefined" ? window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.startsWith("192.168.") || window.location.hostname.startsWith("10.") : false;
|
|
2191
|
+
if (isDevelopment) {
|
|
2190
2192
|
let response;
|
|
2191
2193
|
const authServerUrl = typeof window !== "undefined" ? process.env.NEXT_PUBLIC_MOONUI_AUTH_SERVER || "http://localhost:7878" : "http://localhost:7878";
|
|
2192
2194
|
try {
|
|
2193
|
-
console.log("[MoonUI Auth]
|
|
2195
|
+
console.log("[MoonUI Auth] Development mode - checking CLI auth server at:", authServerUrl);
|
|
2194
2196
|
response = await fetch(`${authServerUrl}/validate`, {
|
|
2195
2197
|
method: "GET",
|
|
2196
2198
|
headers: {
|
|
@@ -2225,64 +2227,7 @@ function MoonUIAuthProvider({ children }) {
|
|
|
2225
2227
|
console.log('[MoonUI Auth] Auth server not available in development. Run "moonui dev" to enable Pro features.');
|
|
2226
2228
|
}
|
|
2227
2229
|
}
|
|
2228
|
-
if (
|
|
2229
|
-
const licenseKey = process.env.NEXT_PUBLIC_MOONUI_LICENSE_KEY || process.env.MOONUI_LICENSE_KEY || process.env.VITE_MOONUI_LICENSE_KEY || process.env.REACT_APP_MOONUI_LICENSE_KEY;
|
|
2230
|
-
if (licenseKey) {
|
|
2231
|
-
console.log("[MoonUI Auth] Running on production domain - validating license key...");
|
|
2232
|
-
try {
|
|
2233
|
-
const currentDomain = typeof window !== "undefined" ? window.location.hostname : process.env.VERCEL_URL || process.env.NEXT_PUBLIC_VERCEL_URL || "";
|
|
2234
|
-
const apiUrl = false ? "https://moonui.dev/api/v1/license/validate" : "https://moonui.dev/api/v1/license/validate";
|
|
2235
|
-
const validationResponse = await fetch(apiUrl, {
|
|
2236
|
-
method: "POST",
|
|
2237
|
-
headers: {
|
|
2238
|
-
"Content-Type": "application/json"
|
|
2239
|
-
},
|
|
2240
|
-
body: JSON.stringify({
|
|
2241
|
-
licenseKey,
|
|
2242
|
-
domain: currentDomain
|
|
2243
|
-
})
|
|
2244
|
-
});
|
|
2245
|
-
if (validationResponse.ok) {
|
|
2246
|
-
const validationData = await validationResponse.json();
|
|
2247
|
-
if (validationData.valid && validationData.hasProAccess) {
|
|
2248
|
-
console.log("[MoonUI Auth] License key validated successfully");
|
|
2249
|
-
const newState = {
|
|
2250
|
-
isLoading: false,
|
|
2251
|
-
hasProAccess: validationData.hasProAccess,
|
|
2252
|
-
isAuthenticated: true,
|
|
2253
|
-
subscriptionPlan: validationData.plan === "lifetime" ? "lifetime" : "free",
|
|
2254
|
-
subscription: {
|
|
2255
|
-
status: validationData.hasProAccess ? "active" : "inactive",
|
|
2256
|
-
plan: validationData.plan === "lifetime" ? "lifetime" : "free"
|
|
2257
|
-
},
|
|
2258
|
-
isAdmin: false
|
|
2259
|
-
};
|
|
2260
|
-
if (typeof document !== "undefined" && validationData.cacheDuration) {
|
|
2261
|
-
const cacheData = {
|
|
2262
|
-
valid: true,
|
|
2263
|
-
hasProAccess: validationData.hasProAccess,
|
|
2264
|
-
timestamp: Date.now()
|
|
2265
|
-
};
|
|
2266
|
-
document.cookie = `moonui_pro_status=${encodeURIComponent(
|
|
2267
|
-
JSON.stringify(cacheData)
|
|
2268
|
-
)}; max-age=${Math.floor(validationData.cacheDuration / 1e3)}; path=/; SameSite=Strict`;
|
|
2269
|
-
}
|
|
2270
|
-
if (isMounted.current) {
|
|
2271
|
-
setState(newState);
|
|
2272
|
-
}
|
|
2273
|
-
authPromise = null;
|
|
2274
|
-
return newState;
|
|
2275
|
-
} else {
|
|
2276
|
-
console.warn("[MoonUI Auth] License key validation failed:", validationData.error || "Invalid license");
|
|
2277
|
-
}
|
|
2278
|
-
} else {
|
|
2279
|
-
console.error("[MoonUI Auth] License validation request failed:", validationResponse.status);
|
|
2280
|
-
}
|
|
2281
|
-
} catch (error) {
|
|
2282
|
-
console.error("[MoonUI Auth] License validation error:", error);
|
|
2283
|
-
}
|
|
2284
|
-
}
|
|
2285
|
-
}
|
|
2230
|
+
if (isProduction) ;
|
|
2286
2231
|
const freeState = {
|
|
2287
2232
|
isLoading: false,
|
|
2288
2233
|
hasProAccess: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.37.
|
|
3
|
+
"version": "2.37.12",
|
|
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",
|