@moontra/moonui-pro 3.1.0 → 3.1.1

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
@@ -2137,6 +2137,17 @@ function readLicenseTokenClient() {
2137
2137
  return null;
2138
2138
  }
2139
2139
  }
2140
+ function saveLicenseTokenClient(token) {
2141
+ try {
2142
+ if (typeof window === "undefined" || !window.localStorage) {
2143
+ return;
2144
+ }
2145
+ localStorage.setItem("moonui_license_token", JSON.stringify(token));
2146
+ console.log("[MoonUI] License token cached in browser");
2147
+ } catch (error) {
2148
+ console.error("[MoonUI] Error saving client license token:", error);
2149
+ }
2150
+ }
2140
2151
  var AuthContext = createContext(void 0);
2141
2152
  var authPromise = null;
2142
2153
  var lastFetchTime = 0;
@@ -2265,6 +2276,16 @@ function MoonUIAuthProvider({ children }) {
2265
2276
  if (response && response.ok) {
2266
2277
  console.log("[MoonUI Auth] Using CLI auth server");
2267
2278
  const data = await response.json();
2279
+ if (data.valid && data.hasProAccess) {
2280
+ saveLicenseTokenClient({
2281
+ valid: true,
2282
+ hasProAccess: data.hasProAccess,
2283
+ plan: data.plan || "lifetime",
2284
+ expiresAt: data.expiresAt || Date.now() + 30 * 24 * 60 * 60 * 1e3,
2285
+ domain: "localhost",
2286
+ timestamp: Date.now()
2287
+ });
2288
+ }
2268
2289
  const newState = {
2269
2290
  isLoading: false,
2270
2291
  hasProAccess: data.hasProAccess || false,
@@ -2309,6 +2330,14 @@ function MoonUIAuthProvider({ children }) {
2309
2330
  const validationData = await validationResponse.json();
2310
2331
  if (validationData.valid && validationData.hasProAccess) {
2311
2332
  console.log("[MoonUI Auth] License key validated successfully");
2333
+ saveLicenseTokenClient({
2334
+ valid: true,
2335
+ hasProAccess: validationData.hasProAccess,
2336
+ plan: validationData.plan || "lifetime",
2337
+ expiresAt: validationData.expiresAt || Date.now() + 30 * 24 * 60 * 60 * 1e3,
2338
+ domain: currentDomain || "production",
2339
+ timestamp: Date.now()
2340
+ });
2312
2341
  const newState = {
2313
2342
  isLoading: false,
2314
2343
  hasProAccess: validationData.hasProAccess,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
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",