@nekm/svelte-core 1.6.2 → 1.6.3
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.
|
@@ -11,11 +11,17 @@
|
|
|
11
11
|
|
|
12
12
|
const { href, children, type = "nofollow", origin }: ExternalLinkProps = $props();
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const host = $derived.by(() => {
|
|
15
|
+
if (!origin) {
|
|
16
|
+
return page.url.host;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return origin.replace(/http(s)?:\/\//ig, "");
|
|
20
|
+
});
|
|
15
21
|
|
|
16
22
|
const hrefWithSource = $derived.by(() => {
|
|
17
23
|
const sign = href.includes("?") ? "&" : "?";
|
|
18
|
-
return href + sign + `utm_source=${encodeURIComponent(
|
|
24
|
+
return href + sign + `utm_source=${encodeURIComponent(host)}`;
|
|
19
25
|
});
|
|
20
26
|
|
|
21
27
|
const rel = $derived(type === "dofollow" ? undefined : type);
|
package/package.json
CHANGED