@nekm/svelte-core 1.0.4 → 1.0.6

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.
@@ -1,6 +1,5 @@
1
1
  <script lang="ts">
2
2
  import {onMount} from "svelte";
3
- import {assets} from "$app/paths";
4
3
  import {browserImportScript} from "@nekm/core";
5
4
  import {page} from "$app/state";
6
5
 
@@ -11,14 +10,12 @@
11
10
  readonly id: string;
12
11
 
13
12
  /**
14
- * Base URL to the site.
15
- * @default assets
13
+ * Base domain to the site.
16
14
  */
17
- readonly baseUrl?: URL;
15
+ readonly baseDomain: string;
18
16
  }
19
17
 
20
- const { id, baseUrl: baseUrlProps }: GoogleAnalyticsProps = $props();
21
- const baseUrl = baseUrlProps ?? new URL(assets);
18
+ const { id, baseDomain }: GoogleAnalyticsProps = $props();
22
19
 
23
20
  onMount(() => {
24
21
  window.dataLayer = window.dataLayer || [];
@@ -26,7 +23,7 @@
26
23
  window.dataLayer.push(arguments);
27
24
  }
28
25
  window.gtag("js", new Date());
29
- const config = page.url.hostname !== baseUrl.hostname ? { debug_mode: true } : {};
26
+ const config = page.url.hostname !== baseDomain ? { debug_mode: true } : {};
30
27
  window.gtag("config", id, config);
31
28
 
32
29
  return browserImportScript(`https://www.googletagmanager.com/gtag/js?id=${id}`);
@@ -4,10 +4,9 @@ export interface GoogleAnalyticsProps {
4
4
  */
5
5
  readonly id: string;
6
6
  /**
7
- * Base URL to the site.
8
- * @default assets
7
+ * Base domain to the site.
9
8
  */
10
- readonly baseUrl?: URL;
9
+ readonly baseDomain: string;
11
10
  }
12
11
  declare const GoogleAnalytics: import("svelte").Component<GoogleAnalyticsProps, {}, "">;
13
12
  type GoogleAnalytics = ReturnType<typeof GoogleAnalytics>;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  export { default as GoogleAnalytics } from "./google-analytics.svelte";
2
+ export * from "./google-analytics.svelte";
2
3
  export * from "./google-analytics.js";
3
4
  export { default as Seo } from "./seo.svelte";
5
+ export * from "./seo.svelte";
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export { default as GoogleAnalytics } from "./google-analytics.svelte";
2
+ export * from "./google-analytics.svelte";
2
3
  export * from "./google-analytics.js";
3
4
  export { default as Seo } from "./seo.svelte";
5
+ export * from "./seo.svelte";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nekm/svelte-core",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",