@moontra/moonui-pro 2.37.11 → 2.37.13

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/index.mjs CHANGED
@@ -2185,12 +2185,20 @@ function MoonUIAuthProvider({ children }) {
2185
2185
  authPromise = (async () => {
2186
2186
  try {
2187
2187
  lastFetchTime = now;
2188
- 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."));
2189
- if (isLocalhost) {
2188
+ const isProduction = false;
2189
+ const isDevelopment = true;
2190
+ console.log("[MoonUI Auth] Environment Detection:", {
2191
+ NODE_ENV: "development",
2192
+ isProduction,
2193
+ isDevelopment,
2194
+ window: typeof window !== "undefined" ? "available" : "SSR"
2195
+ });
2196
+ 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;
2197
+ if (isDevelopment) {
2190
2198
  let response;
2191
2199
  const authServerUrl = typeof window !== "undefined" ? process.env.NEXT_PUBLIC_MOONUI_AUTH_SERVER || "http://localhost:7878" : "http://localhost:7878";
2192
2200
  try {
2193
- console.log("[MoonUI Auth] Running on localhost - checking CLI auth server at:", authServerUrl);
2201
+ console.log("[MoonUI Auth] Development mode - checking CLI auth server at:", authServerUrl);
2194
2202
  response = await fetch(`${authServerUrl}/validate`, {
2195
2203
  method: "GET",
2196
2204
  headers: {
@@ -2225,64 +2233,7 @@ function MoonUIAuthProvider({ children }) {
2225
2233
  console.log('[MoonUI Auth] Auth server not available in development. Run "moonui dev" to enable Pro features.');
2226
2234
  }
2227
2235
  }
2228
- if (!isLocalhost) {
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
- }
2236
+ if (isProduction) ;
2286
2237
  const freeState = {
2287
2238
  isLoading: false,
2288
2239
  hasProAccess: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.37.11",
3
+ "version": "2.37.13",
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",