@panomc/sdk 1.0.0-dev.39 → 1.0.0-dev.40
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/core/js/variables.js +19 -22
- package/core/scss/main.scss +3 -3
- package/package.json +1 -1
package/core/js/variables.js
CHANGED
|
@@ -16,34 +16,31 @@ export const CSRF_HEADER = 'X-CSRF-Token';
|
|
|
16
16
|
export function checkDomainRedirection() {
|
|
17
17
|
if (typeof window === 'undefined' || !API_URL || API_URL.startsWith('/')) return;
|
|
18
18
|
|
|
19
|
+
// In production API_URL is the Pano host's internal backend address (loopback or
|
|
20
|
+
// server.host:internal-port) — never a browser-reachable origin, so redirecting on it
|
|
21
|
+
// would bounce reverse-proxied visitors to the internal port. Canonical-host redirects
|
|
22
|
+
// are owned by the backend (WebsiteUrlRedirectHandler); this helper only smooths the
|
|
23
|
+
// dev workflow: hitting a vite dev port directly bounces you into the Pano dev server.
|
|
24
|
+
if (!import.meta.env.DEV) return;
|
|
25
|
+
|
|
19
26
|
try {
|
|
20
27
|
const apiUrl = new URL(API_URL);
|
|
21
28
|
const currentUrl = new URL(window.location.href);
|
|
22
29
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
) {
|
|
31
|
-
const basePath = UI_URL || PANEL_URL || SETUP_URL || '/';
|
|
32
|
-
let pathname = currentUrl.pathname;
|
|
33
|
-
|
|
34
|
-
if (basePath !== '/' && !pathname.startsWith(basePath)) {
|
|
35
|
-
pathname = basePath + (pathname === '/' ? '' : pathname);
|
|
36
|
-
}
|
|
30
|
+
if (
|
|
31
|
+
currentUrl.hostname !== apiUrl.hostname ||
|
|
32
|
+
currentUrl.port !== apiUrl.port ||
|
|
33
|
+
currentUrl.protocol !== apiUrl.protocol
|
|
34
|
+
) {
|
|
35
|
+
const basePath = UI_URL || PANEL_URL || SETUP_URL || '/';
|
|
36
|
+
let pathname = currentUrl.pathname;
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
if (currentUrl.port !== apiUrl.port) {
|
|
43
|
-
const targetUrl = new URL(window.location.href);
|
|
44
|
-
targetUrl.port = apiUrl.port;
|
|
45
|
-
window.location.href = targetUrl.toString();
|
|
38
|
+
if (basePath !== '/' && !pathname.startsWith(basePath)) {
|
|
39
|
+
pathname = basePath + (pathname === '/' ? '' : pathname);
|
|
46
40
|
}
|
|
41
|
+
|
|
42
|
+
const targetUrl = new URL(pathname + currentUrl.search + currentUrl.hash, apiUrl.origin);
|
|
43
|
+
window.location.href = targetUrl.toString();
|
|
47
44
|
}
|
|
48
45
|
} catch (e) {
|
|
49
46
|
console.error('Failed to check domain redirection:', e);
|
package/core/scss/main.scss
CHANGED
|
@@ -197,7 +197,7 @@ $blocks-border-dark: #1e293b;
|
|
|
197
197
|
32px 64px;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
/* ---
|
|
200
|
+
/* --- New Color Variations (Cool Theme) --- */
|
|
201
201
|
.blocks-cool {
|
|
202
202
|
background-position:
|
|
203
203
|
bottom right,
|
|
@@ -222,7 +222,7 @@ $blocks-border-dark: #1e293b;
|
|
|
222
222
|
32px 64px;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
/* ---
|
|
225
|
+
/* --- New Color Variations (Sunset / Warm Theme) --- */
|
|
226
226
|
.blocks-sunset {
|
|
227
227
|
background-position:
|
|
228
228
|
bottom right,
|
|
@@ -290,7 +290,7 @@ $blocks-border-dark: #1e293b;
|
|
|
290
290
|
32px 64px;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
/* ---
|
|
293
|
+
/* --- Bidirectional Variations (Both Top and Bottom Corners - Double) --- */
|
|
294
294
|
.blocks-double-cool {
|
|
295
295
|
background-position:
|
|
296
296
|
top left, right 33px top, top right,
|