@moontra/moonui-pro 2.37.7 → 2.37.9

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,65 +2185,64 @@ function MoonUIAuthProvider({ children }) {
2185
2185
  authPromise = (async () => {
2186
2186
  try {
2187
2187
  lastFetchTime = now;
2188
- let response;
2189
- const authServerUrl = typeof window !== "undefined" ? process.env.NEXT_PUBLIC_MOONUI_AUTH_SERVER || "http://localhost:7878" : "http://localhost:7878";
2190
- try {
2191
- console.log("[MoonUI Auth] Checking CLI auth server at:", authServerUrl);
2192
- response = await fetch(`${authServerUrl}/validate`, {
2193
- method: "GET",
2194
- headers: {
2195
- "X-Component": "MoonUIAuthProvider",
2196
- "X-Timestamp": Date.now().toString()
2197
- },
2198
- credentials: "include"
2199
- });
2200
- if (response && response.ok) {
2201
- console.log("[MoonUI Auth] Using CLI auth server");
2202
- } else {
2203
- throw new Error("Auth server not available");
2204
- }
2205
- } catch (error) {
2206
- console.log('[MoonUI Auth] Auth server not available. Run "moonui dev" to enable Pro features.');
2207
- const freeState = {
2208
- isLoading: false,
2209
- hasProAccess: false,
2210
- isAuthenticated: false,
2211
- subscriptionPlan: "free",
2212
- subscription: {
2213
- status: "inactive",
2214
- plan: "free"
2215
- },
2216
- isAdmin: false
2217
- };
2218
- if (isMounted.current) {
2219
- setState(freeState);
2188
+ const isProduction = false;
2189
+ const isDevelopment = true;
2190
+ if (isDevelopment) {
2191
+ let response;
2192
+ const authServerUrl = typeof window !== "undefined" ? process.env.NEXT_PUBLIC_MOONUI_AUTH_SERVER || "http://localhost:7878" : "http://localhost:7878";
2193
+ try {
2194
+ console.log("[MoonUI Auth] Checking CLI auth server at:", authServerUrl);
2195
+ response = await fetch(`${authServerUrl}/validate`, {
2196
+ method: "GET",
2197
+ headers: {
2198
+ "X-Component": "MoonUIAuthProvider",
2199
+ "X-Timestamp": Date.now().toString()
2200
+ },
2201
+ credentials: "include"
2202
+ });
2203
+ if (response && response.ok) {
2204
+ console.log("[MoonUI Auth] Using CLI auth server");
2205
+ const data = await response.json();
2206
+ const newState = {
2207
+ isLoading: false,
2208
+ hasProAccess: data.hasProAccess || false,
2209
+ isAuthenticated: data.valid || false,
2210
+ subscriptionPlan: data.hasProAccess ? "lifetime" : "free",
2211
+ subscription: {
2212
+ status: data.hasProAccess ? "active" : "inactive",
2213
+ plan: data.hasProAccess ? "lifetime" : "free"
2214
+ },
2215
+ isAdmin: data.isAdmin || false
2216
+ };
2217
+ if (isMounted.current) {
2218
+ setState(newState);
2219
+ }
2220
+ authPromise = null;
2221
+ return newState;
2222
+ } else {
2223
+ throw new Error("Auth server not available");
2224
+ }
2225
+ } catch (error) {
2226
+ console.log('[MoonUI Auth] Auth server not available in development. Run "moonui dev" to enable Pro features.');
2220
2227
  }
2221
- return freeState;
2222
2228
  }
2223
- if (!response.ok) {
2224
- console.error("[MoonUI Auth] Validation failed:", response.status);
2225
- throw new Error(`Validation failed: ${response.status}`);
2226
- }
2227
- const data = await response.json();
2228
- const newState = {
2229
+ if (isProduction || !isDevelopment) ;
2230
+ const freeState = {
2229
2231
  isLoading: false,
2230
- hasProAccess: data.hasProAccess || false,
2231
- isAuthenticated: data.valid || false,
2232
- subscriptionPlan: data.hasProAccess ? "lifetime" : "free",
2232
+ hasProAccess: false,
2233
+ isAuthenticated: false,
2234
+ subscriptionPlan: "free",
2233
2235
  subscription: {
2234
- status: data.hasProAccess ? "active" : "inactive",
2235
- plan: data.hasProAccess ? "lifetime" : "free"
2236
+ status: "inactive",
2237
+ plan: "free"
2236
2238
  },
2237
- isAdmin: data.isAdmin || false
2239
+ isAdmin: false
2238
2240
  };
2239
2241
  if (isMounted.current) {
2240
- setState(newState);
2242
+ setState(freeState);
2241
2243
  }
2242
- console.log("[MoonUI Auth] Validation complete:", {
2243
- hasProAccess: newState.hasProAccess,
2244
- cached: data.cached
2245
- });
2246
- return newState;
2244
+ authPromise = null;
2245
+ return freeState;
2247
2246
  } catch (error) {
2248
2247
  console.error("[MoonUI Auth] Validation error:", error);
2249
2248
  const errorState = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.37.7",
3
+ "version": "2.37.9",
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",