@moontra/moonui-pro 2.32.14 → 2.32.15
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.d.ts +37 -37
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +13 -29
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -93,9 +93,8 @@ var init_cli_token_reader = __esm({
|
|
|
93
93
|
this.cachedAuthInfo = null;
|
|
94
94
|
this.lastCheck = 0;
|
|
95
95
|
this.CACHE_DURATION = 30 * 1e3;
|
|
96
|
-
// 30 seconds - check frequently in dev
|
|
97
|
-
this.apiCheckAttempted = false;
|
|
98
96
|
}
|
|
97
|
+
// 30 seconds
|
|
99
98
|
static getInstance() {
|
|
100
99
|
if (!this.instance) {
|
|
101
100
|
this.instance = new CLITokenReader();
|
|
@@ -103,7 +102,7 @@ var init_cli_token_reader = __esm({
|
|
|
103
102
|
return this.instance;
|
|
104
103
|
}
|
|
105
104
|
/**
|
|
106
|
-
* Try to get CLI token through
|
|
105
|
+
* Try to get CLI token through API endpoint
|
|
107
106
|
*/
|
|
108
107
|
async getCLIToken() {
|
|
109
108
|
const now = Date.now();
|
|
@@ -111,33 +110,21 @@ var init_cli_token_reader = __esm({
|
|
|
111
110
|
return this.cachedToken;
|
|
112
111
|
}
|
|
113
112
|
{
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
console.log("[MoonUI Pro] CLI authentication
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
console.log("[MoonUI Pro] Has Pro Access:", authInfo.user?.hasProAccess);
|
|
123
|
-
this.cachedToken = authInfo.token;
|
|
124
|
-
this.cachedAuthInfo = authInfo;
|
|
113
|
+
try {
|
|
114
|
+
const response = await fetch("/api/moonui/cli-auth");
|
|
115
|
+
if (response.ok) {
|
|
116
|
+
const data = await response.json();
|
|
117
|
+
if (data.token) {
|
|
118
|
+
console.log("[MoonUI Pro] CLI authentication detected");
|
|
119
|
+
this.cachedToken = data.token;
|
|
120
|
+
this.cachedAuthInfo = data;
|
|
125
121
|
this.lastCheck = now;
|
|
126
|
-
return
|
|
127
|
-
}
|
|
128
|
-
} catch (error) {
|
|
129
|
-
if (typeof window === "undefined") {
|
|
130
|
-
console.log("[MoonUI Pro] Could not read CLI auth directly:", error.message);
|
|
122
|
+
return data.token;
|
|
131
123
|
}
|
|
132
124
|
}
|
|
125
|
+
} catch (error) {
|
|
126
|
+
console.log("[MoonUI Pro] CLI authentication API not available");
|
|
133
127
|
}
|
|
134
|
-
if (typeof window !== "undefined" && window.__MOONUI_CLI_TOKEN__) {
|
|
135
|
-
console.log("[MoonUI Pro] CLI token found in window object");
|
|
136
|
-
this.cachedToken = window.__MOONUI_CLI_TOKEN__;
|
|
137
|
-
this.lastCheck = now;
|
|
138
|
-
return this.cachedToken;
|
|
139
|
-
}
|
|
140
|
-
console.log("[MoonUI Pro] No CLI authentication found. Please run: moonui login");
|
|
141
128
|
}
|
|
142
129
|
return null;
|
|
143
130
|
}
|
|
@@ -168,9 +155,6 @@ var init_cli_token_reader = __esm({
|
|
|
168
155
|
this.cachedToken = null;
|
|
169
156
|
this.cachedAuthInfo = null;
|
|
170
157
|
this.lastCheck = 0;
|
|
171
|
-
if (typeof window !== "undefined") {
|
|
172
|
-
delete window.__MOONUI_CLI_TOKEN__;
|
|
173
|
-
}
|
|
174
158
|
}
|
|
175
159
|
/**
|
|
176
160
|
* Get cached auth info (if available)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.32.
|
|
3
|
+
"version": "2.32.15",
|
|
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",
|