@nekm/svelte-core 1.1.1 → 1.1.2
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/date-time.svelte +4 -2
- package/dist/google-analytics.svelte +2 -2
- package/dist/seo.svelte +6 -12
- package/package.json +1 -1
package/dist/date-time.svelte
CHANGED
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
const { date }: Props = $props();
|
|
10
10
|
|
|
11
|
-
const isoString = date.toISOString();
|
|
12
|
-
let formatted = $state(
|
|
11
|
+
const isoString = $derived(date.toISOString());
|
|
12
|
+
let formatted = $state(localeFormatDate(date));
|
|
13
13
|
|
|
14
14
|
onMount(() => {
|
|
15
|
+
// Want to rerun this on mount as we want to use the browser
|
|
16
|
+
// locale.
|
|
15
17
|
formatted = localeFormatDate(date);
|
|
16
18
|
})
|
|
17
19
|
</script>
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
|
|
23
23
|
const { id, productionDomain }: GoogleAnalyticsProps = $props();
|
|
24
24
|
|
|
25
|
+
const productionDomainStr = $derived(productionDomain instanceof URL ? productionDomain.hostname : productionDomain);
|
|
26
|
+
|
|
25
27
|
onMount(() => {
|
|
26
28
|
let config: GoogleAnalyticsConfig = { debug_mode: true };
|
|
27
29
|
|
|
28
30
|
if (productionDomain) {
|
|
29
|
-
const productionDomainStr = productionDomain instanceof URL ? productionDomain.hostname : productionDomain;
|
|
30
|
-
|
|
31
31
|
if (page.url.hostname === productionDomainStr) {
|
|
32
32
|
config = {};
|
|
33
33
|
}
|
package/dist/seo.svelte
CHANGED
|
@@ -45,20 +45,14 @@
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// Starts with http or https. I.e, is an absolute URL.
|
|
48
|
-
const iconHref =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
let canonicalUrl = $state(createCanonical(canonical, true));
|
|
53
|
-
let nextUrl = $state(createCanonical(next));
|
|
54
|
-
|
|
55
|
-
$effect(() => {
|
|
56
|
-
canonicalUrl = createCanonical(canonical, true);
|
|
48
|
+
const iconHref = $derived.by(() => {
|
|
49
|
+
return !icon.href.match(/^https?:\/\//ig)
|
|
50
|
+
? `${strTrimEnd(origin, "/")}/${strTrimStart(icon.href, "/")}`
|
|
51
|
+
: icon.href;
|
|
57
52
|
});
|
|
58
53
|
|
|
59
|
-
$
|
|
60
|
-
|
|
61
|
-
});
|
|
54
|
+
const canonicalUrl = $derived(createCanonical(canonical, true));
|
|
55
|
+
const nextUrl = $derived(createCanonical(next));
|
|
62
56
|
</script>
|
|
63
57
|
|
|
64
58
|
<svelte:head>
|
package/package.json
CHANGED