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
|
@@ -3930,9 +3930,23 @@ class ConfigService {
|
|
|
3930
3930
|
}
|
|
3931
3931
|
const configService = ConfigService.getInstance();
|
|
3932
3932
|
|
|
3933
|
+
// const getRootDomain = (hostOrUrl: string): string => {
|
|
3934
|
+
// // Ensure we can parse it with URL
|
|
3935
|
+
// const url = hostOrUrl.startsWith("http") ? new URL(hostOrUrl) : new URL(`https://${hostOrUrl}`);
|
|
3936
|
+
// const hostname = url.hostname;
|
|
3937
|
+
// const port = url.port ? `:${url.port}` : "";
|
|
3938
|
+
// const parts = hostname.split(".");
|
|
3939
|
+
// // localhost → return with port
|
|
3940
|
+
// if (hostname === "localhost") return hostname + port;
|
|
3941
|
+
// // sslip.io → keep last 3 parts
|
|
3942
|
+
// if (hostname.endsWith(".sslip.io")) return parts.slice(-5).join(".") + port;
|
|
3943
|
+
// // Normal domains → remove first label
|
|
3944
|
+
// return parts.slice(1).join(".") + port;
|
|
3945
|
+
// };
|
|
3933
3946
|
const getRootDomain = (hostOrUrl) => {
|
|
3934
|
-
|
|
3935
|
-
|
|
3947
|
+
const url = hostOrUrl.startsWith("http")
|
|
3948
|
+
? new URL(hostOrUrl)
|
|
3949
|
+
: new URL(`https://${hostOrUrl}`);
|
|
3936
3950
|
const hostname = url.hostname;
|
|
3937
3951
|
const port = url.port ? `:${url.port}` : "";
|
|
3938
3952
|
const parts = hostname.split(".");
|
|
@@ -3942,8 +3956,8 @@ const getRootDomain = (hostOrUrl) => {
|
|
|
3942
3956
|
// sslip.io → keep last 3 parts
|
|
3943
3957
|
if (hostname.endsWith(".sslip.io"))
|
|
3944
3958
|
return parts.slice(-5).join(".") + port;
|
|
3945
|
-
//
|
|
3946
|
-
return
|
|
3959
|
+
// Keep full hostname
|
|
3960
|
+
return hostname + port;
|
|
3947
3961
|
};
|
|
3948
3962
|
const getUrlProtocol = (url, defaultProtocol = "https://") => {
|
|
3949
3963
|
if (!url)
|