@moontra/moonui-pro 2.32.3 → 2.32.4

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
@@ -2066,7 +2066,6 @@ var isInitialized = false;
2066
2066
  var subscribers = [];
2067
2067
  var CACHE_KEY = "moonui_license_cache";
2068
2068
  var CACHE_DURATION = 1 * 60 * 1e3 ;
2069
- var OFFLINE_GRACE_PERIOD = 5 * 60 * 1e3 ;
2070
2069
  function notifySubscribers() {
2071
2070
  subscribers.forEach((callback) => callback());
2072
2071
  }
@@ -2097,74 +2096,26 @@ async function validateLicense() {
2097
2096
  });
2098
2097
  return;
2099
2098
  }
2100
- try {
2101
- const response = await fetch("https://moonui.dev/api/auth/validate", {
2102
- headers: {
2103
- "Authorization": `Bearer ${token}`
2104
- }
2105
- });
2106
- if (response.ok) {
2107
- const data = await response.json();
2108
- const cacheData = {
2109
- valid: data.valid,
2110
- hasLifetimeAccess: data.user?.hasLifetimeAccess || false,
2111
- timestamp: Date.now(),
2112
- cacheUntil: data.cacheUntil ? new Date(data.cacheUntil).getTime() : void 0
2113
- };
2114
- if (typeof window !== "undefined") {
2115
- localStorage.setItem(CACHE_KEY, JSON.stringify(cacheData));
2116
- }
2117
- const hasProAccess = data.valid && (data.user?.hasLifetimeAccess || data.user?.features?.includes("pro_components"));
2118
- updateGlobalState({
2119
- hasProAccess,
2120
- isAuthenticated: data.valid,
2121
- subscriptionPlan: hasProAccess ? "lifetime" : "free",
2122
- subscription: {
2123
- status: hasProAccess ? "active" : "inactive",
2124
- plan: hasProAccess ? "lifetime" : "free"
2125
- },
2126
- isLoading: false
2127
- });
2128
- } else {
2129
- if (typeof window !== "undefined") {
2130
- localStorage.removeItem(CACHE_KEY);
2131
- }
2132
- updateGlobalState({
2133
- hasProAccess: false,
2134
- isAuthenticated: false,
2135
- isLoading: false
2136
- });
2137
- }
2138
- } catch (error) {
2139
- console.error("[MoonUI Pro] Network error during license validation:", error);
2140
- if (typeof window !== "undefined") {
2141
- const cached = localStorage.getItem(CACHE_KEY);
2142
- if (cached) {
2143
- const cacheData = JSON.parse(cached);
2144
- const now = Date.now();
2145
- if (now - cacheData.timestamp < OFFLINE_GRACE_PERIOD) {
2146
- console.log("[MoonUI Pro] Development: Using cached access during network error");
2147
- updateGlobalState({
2148
- hasProAccess: cacheData.valid && cacheData.hasLifetimeAccess,
2149
- isAuthenticated: cacheData.valid,
2150
- subscriptionPlan: cacheData.valid && cacheData.hasLifetimeAccess ? "lifetime" : "free",
2151
- subscription: {
2152
- status: cacheData.valid && cacheData.hasLifetimeAccess ? "active" : "inactive",
2153
- plan: cacheData.valid && cacheData.hasLifetimeAccess ? "lifetime" : "free"
2154
- },
2155
- isLoading: false
2156
- });
2157
- return;
2158
- }
2159
- }
2160
- }
2161
- console.log("[MoonUI Pro] Denying access due to network error (production security)");
2162
- updateGlobalState({
2163
- hasProAccess: false,
2164
- isAuthenticated: false,
2165
- isLoading: false
2166
- });
2167
- }
2099
+ console.log("[MoonUI Pro] Granting access based on token presence");
2100
+ const cacheData = {
2101
+ valid: true,
2102
+ hasLifetimeAccess: true,
2103
+ timestamp: Date.now(),
2104
+ cacheUntil: Date.now() + CACHE_DURATION
2105
+ };
2106
+ if (typeof window !== "undefined") {
2107
+ localStorage.setItem(CACHE_KEY, JSON.stringify(cacheData));
2108
+ }
2109
+ updateGlobalState({
2110
+ hasProAccess: true,
2111
+ isAuthenticated: true,
2112
+ subscriptionPlan: "lifetime",
2113
+ subscription: {
2114
+ status: "active",
2115
+ plan: "lifetime"
2116
+ },
2117
+ isLoading: false
2118
+ });
2168
2119
  }
2169
2120
  async function initializeAuth() {
2170
2121
  if (isInitialized)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.32.3",
3
+ "version": "2.32.4",
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",
@@ -81,7 +81,7 @@
81
81
  "react-dom": ">=18.0.0 || ^19.0.0"
82
82
  },
83
83
  "dependencies": {
84
- "@moontra/moonui-pro": "^2.32.2",
84
+ "@moontra/moonui-pro": "^2.32.3",
85
85
  "@radix-ui/react-accordion": "^1.2.11",
86
86
  "@radix-ui/react-avatar": "^1.1.10",
87
87
  "@radix-ui/react-checkbox": "^1.3.2",