dash-button-web 0.0.21 → 0.0.22
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/cjs/dash-button.cjs.entry.js +18 -4
- package/dist/cjs/dash-button.cjs.entry.js.map +1 -1
- package/dist/collection/services/menu.js +18 -4
- package/dist/collection/services/menu.js.map +1 -1
- package/dist/components/dash-button.js +18 -4
- package/dist/components/dash-button.js.map +1 -1
- package/dist/esm/dash-button.entry.js +18 -4
- package/dist/esm/dash-button.entry.js.map +1 -1
- package/dist/web-compnont/p-ad318f06.entry.js +10 -0
- package/dist/web-compnont/{p-fc02a292.entry.js.map → p-ad318f06.entry.js.map} +1 -1
- package/dist/web-compnont/web-compnont.esm.js +1 -1
- package/package.json +1 -1
- package/readme.md +22 -19
- package/dist/web-compnont/p-fc02a292.entry.js +0 -10
|
@@ -3934,9 +3934,23 @@ class ConfigService {
|
|
|
3934
3934
|
}
|
|
3935
3935
|
const configService = ConfigService.getInstance();
|
|
3936
3936
|
|
|
3937
|
+
// const getRootDomain = (hostOrUrl: string): string => {
|
|
3938
|
+
// // Ensure we can parse it with URL
|
|
3939
|
+
// const url = hostOrUrl.startsWith("http") ? new URL(hostOrUrl) : new URL(`https://${hostOrUrl}`);
|
|
3940
|
+
// const hostname = url.hostname;
|
|
3941
|
+
// const port = url.port ? `:${url.port}` : "";
|
|
3942
|
+
// const parts = hostname.split(".");
|
|
3943
|
+
// // localhost → return with port
|
|
3944
|
+
// if (hostname === "localhost") return hostname + port;
|
|
3945
|
+
// // sslip.io → keep last 3 parts
|
|
3946
|
+
// if (hostname.endsWith(".sslip.io")) return parts.slice(-5).join(".") + port;
|
|
3947
|
+
// // Normal domains → remove first label
|
|
3948
|
+
// return parts.slice(1).join(".") + port;
|
|
3949
|
+
// };
|
|
3937
3950
|
const getRootDomain = (hostOrUrl) => {
|
|
3938
|
-
|
|
3939
|
-
|
|
3951
|
+
const url = hostOrUrl.startsWith("http")
|
|
3952
|
+
? new URL(hostOrUrl)
|
|
3953
|
+
: new URL(`https://${hostOrUrl}`);
|
|
3940
3954
|
const hostname = url.hostname;
|
|
3941
3955
|
const port = url.port ? `:${url.port}` : "";
|
|
3942
3956
|
const parts = hostname.split(".");
|
|
@@ -3946,8 +3960,8 @@ const getRootDomain = (hostOrUrl) => {
|
|
|
3946
3960
|
// sslip.io → keep last 3 parts
|
|
3947
3961
|
if (hostname.endsWith(".sslip.io"))
|
|
3948
3962
|
return parts.slice(-5).join(".") + port;
|
|
3949
|
-
//
|
|
3950
|
-
return
|
|
3963
|
+
// Keep full hostname
|
|
3964
|
+
return hostname + port;
|
|
3951
3965
|
};
|
|
3952
3966
|
const getUrlProtocol = (url, defaultProtocol = "https://") => {
|
|
3953
3967
|
if (!url)
|