@moontra/moonui-pro 2.37.6 → 2.37.8
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 +104 -104
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.mjs +22 -21
- package/dist/server.d.ts +0 -1
- package/dist/server.mjs +2 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2055,11 +2055,9 @@ function createAIProvider(provider, config) {
|
|
|
2055
2055
|
// src/lib/auth-config.ts
|
|
2056
2056
|
var IS_PRODUCTION = false;
|
|
2057
2057
|
var AUTH_CONFIG = {
|
|
2058
|
-
// CLI Auth Server endpoint (
|
|
2058
|
+
// CLI Auth Server endpoint (REQUIRED - No fallback)
|
|
2059
|
+
// Run "moonui dev" to start the auth server
|
|
2059
2060
|
authServerEndpoint: process.env.NEXT_PUBLIC_MOONUI_AUTH_SERVER || "http://localhost:7878",
|
|
2060
|
-
// Internal API endpoint (fallback only - deprecated)
|
|
2061
|
-
// This will be removed in future versions
|
|
2062
|
-
internalEndpoint: "/api/moonui/validate-pro",
|
|
2063
2061
|
// Cache configuration
|
|
2064
2062
|
cache: {
|
|
2065
2063
|
// Server-side cache duration
|
|
@@ -2205,15 +2203,22 @@ function MoonUIAuthProvider({ children }) {
|
|
|
2205
2203
|
throw new Error("Auth server not available");
|
|
2206
2204
|
}
|
|
2207
2205
|
} catch (error) {
|
|
2208
|
-
console.log(
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
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);
|
|
2220
|
+
}
|
|
2221
|
+
return freeState;
|
|
2217
2222
|
}
|
|
2218
2223
|
if (!response.ok) {
|
|
2219
2224
|
console.error("[MoonUI Auth] Validation failed:", response.status);
|
|
@@ -2396,12 +2401,13 @@ function useSubscription() {
|
|
|
2396
2401
|
}
|
|
2397
2402
|
try {
|
|
2398
2403
|
console.log("[Client Auth] Validating with internal API...");
|
|
2399
|
-
const response = await fetch(AUTH_CONFIG.
|
|
2404
|
+
const response = await fetch(`${AUTH_CONFIG.authServerEndpoint}/validate`, {
|
|
2400
2405
|
method: "GET",
|
|
2401
2406
|
credentials: "include",
|
|
2402
2407
|
// Include cookies
|
|
2403
2408
|
headers: {
|
|
2404
|
-
"Content-Type": "application/json"
|
|
2409
|
+
"Content-Type": "application/json",
|
|
2410
|
+
"X-Component": "useSubscription"
|
|
2405
2411
|
}
|
|
2406
2412
|
});
|
|
2407
2413
|
if (!response.ok) {
|
|
@@ -2514,12 +2520,7 @@ function clearAuth() {
|
|
|
2514
2520
|
} catch (error) {
|
|
2515
2521
|
}
|
|
2516
2522
|
if (typeof window !== "undefined") {
|
|
2517
|
-
|
|
2518
|
-
method: "DELETE",
|
|
2519
|
-
credentials: "include"
|
|
2520
|
-
}).then(() => {
|
|
2521
|
-
window.location.reload();
|
|
2522
|
-
});
|
|
2523
|
+
window.location.reload();
|
|
2523
2524
|
}
|
|
2524
2525
|
}
|
|
2525
2526
|
async function sha256(message) {
|
package/dist/server.d.ts
CHANGED
|
@@ -61,7 +61,6 @@ declare function performServerValidation(): Promise<{
|
|
|
61
61
|
*/
|
|
62
62
|
declare const AUTH_CONFIG: {
|
|
63
63
|
readonly authServerEndpoint: string;
|
|
64
|
-
readonly internalEndpoint: "/api/moonui/validate-pro";
|
|
65
64
|
readonly cache: {
|
|
66
65
|
readonly serverCacheDuration: number;
|
|
67
66
|
readonly cookieMaxAge: number;
|
package/dist/server.mjs
CHANGED
|
@@ -2965,11 +2965,9 @@ var import_headers = __toESM(require_headers3(), 1);
|
|
|
2965
2965
|
// src/lib/auth-config.ts
|
|
2966
2966
|
var IS_PRODUCTION = false;
|
|
2967
2967
|
var AUTH_CONFIG = {
|
|
2968
|
-
// CLI Auth Server endpoint (
|
|
2968
|
+
// CLI Auth Server endpoint (REQUIRED - No fallback)
|
|
2969
|
+
// Run "moonui dev" to start the auth server
|
|
2969
2970
|
authServerEndpoint: process.env.NEXT_PUBLIC_MOONUI_AUTH_SERVER || "http://localhost:7878",
|
|
2970
|
-
// Internal API endpoint (fallback only - deprecated)
|
|
2971
|
-
// This will be removed in future versions
|
|
2972
|
-
internalEndpoint: "/api/moonui/validate-pro",
|
|
2973
2971
|
// Cache configuration
|
|
2974
2972
|
cache: {
|
|
2975
2973
|
// Server-side cache duration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.37.
|
|
3
|
+
"version": "2.37.8",
|
|
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",
|