@nekm/svelte-core 1.1.5 → 1.2.0
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.
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {onMount} from "svelte";
|
|
3
|
+
import {page} from "$app/state";
|
|
4
|
+
import {browserImportScript} from "@nekm/core";
|
|
5
|
+
|
|
6
|
+
export interface CookieConsentPopupsmart {
|
|
7
|
+
readonly Palette?: string;
|
|
8
|
+
readonly Mode?: string;
|
|
9
|
+
readonly Theme?: string;
|
|
10
|
+
readonly Location?: string;
|
|
11
|
+
readonly LinkText?: string;
|
|
12
|
+
readonly Message?: string;
|
|
13
|
+
readonly ButtonText?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const props: CookieConsentPopupsmart = $props();
|
|
17
|
+
|
|
18
|
+
const url = "https://cookieconsent.popupsmart.com";
|
|
19
|
+
|
|
20
|
+
onMount(async () => {
|
|
21
|
+
await browserImportScript(`${url}/src/js/popper.js`);
|
|
22
|
+
|
|
23
|
+
if ("start" in window) {
|
|
24
|
+
// See: https://cookieconsent.popupsmart.com/#simple-cookie-consent
|
|
25
|
+
// @ts-expect-error
|
|
26
|
+
window.start.init({
|
|
27
|
+
Palette: "palette3",
|
|
28
|
+
Mode: "floating right",
|
|
29
|
+
Theme: "edgeless",
|
|
30
|
+
Location: `${page.url.origin}/privacy-policy`,
|
|
31
|
+
LinkText: "Read the privacy policy",
|
|
32
|
+
Message: "This website uses cookies to enhance your experience and analyze usage. By continuing to use this site, you consent to this data processing.",
|
|
33
|
+
ButtonText: "OK, I understand",
|
|
34
|
+
// Order matters. We want anything that is passed in to
|
|
35
|
+
// be the mot important.
|
|
36
|
+
...props,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<svelte:head>
|
|
43
|
+
<link rel="preconnect" href={url} />
|
|
44
|
+
</svelte:head>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface CookieConsentPopupsmart {
|
|
2
|
+
readonly Palette?: string;
|
|
3
|
+
readonly Mode?: string;
|
|
4
|
+
readonly Theme?: string;
|
|
5
|
+
readonly Location?: string;
|
|
6
|
+
readonly LinkText?: string;
|
|
7
|
+
readonly Message?: string;
|
|
8
|
+
readonly ButtonText?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const CookieConsentPopupsmart: any;
|
|
11
|
+
type CookieConsentPopupsmart = ReturnType<typeof CookieConsentPopupsmart>;
|
|
12
|
+
export default CookieConsentPopupsmart;
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
|
|
23
23
|
const { id, productionDomain }: GoogleAnalyticsProps = $props();
|
|
24
24
|
|
|
25
|
+
const url = "https://www.googletagmanager.com";
|
|
26
|
+
|
|
25
27
|
const productionDomainStr = $derived(productionDomain instanceof URL ? productionDomain.hostname : productionDomain);
|
|
26
28
|
|
|
27
29
|
onMount(() => {
|
|
@@ -40,10 +42,10 @@
|
|
|
40
42
|
window.gtag("js", new Date());
|
|
41
43
|
window.gtag("config", id, config);
|
|
42
44
|
|
|
43
|
-
return browserImportScript(
|
|
45
|
+
return browserImportScript(`${url}/gtag/js?id=${id}`);
|
|
44
46
|
});
|
|
45
47
|
</script>
|
|
46
48
|
|
|
47
49
|
<svelte:head>
|
|
48
|
-
<link rel="
|
|
50
|
+
<link rel="dns-prefetch" href={url} />
|
|
49
51
|
</svelte:head>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nekm/svelte-core",
|
|
3
3
|
"description": "Code I find myself re-writing over-and-over, Svelte edition.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
7
7
|
"build": "vite build && npm run prepack",
|
|
@@ -28,25 +28,22 @@
|
|
|
28
28
|
"svelte": "./dist/index.js"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
"peerDependencies": {
|
|
32
|
-
"svelte": "^5.0.0"
|
|
33
|
-
},
|
|
34
31
|
"devDependencies": {
|
|
35
|
-
"@sveltejs/adapter-auto": "^6.0.
|
|
36
|
-
"@sveltejs/
|
|
37
|
-
"@sveltejs/
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"vite": "^6.2.6",
|
|
44
|
-
"vite-plugin-devtools-json": "^0.2.0"
|
|
32
|
+
"@sveltejs/adapter-auto": "^6.0.1",
|
|
33
|
+
"@sveltejs/package": "^2.3.12",
|
|
34
|
+
"@sveltejs/vite-plugin-svelte": "^5.1.0",
|
|
35
|
+
"publint": "^0.3.12",
|
|
36
|
+
"svelte-check": "^4.2.2",
|
|
37
|
+
"typescript": "^5.8.3",
|
|
38
|
+
"vite": "^6.2.7",
|
|
39
|
+
"vite-plugin-devtools-json": "^0.2.1"
|
|
45
40
|
},
|
|
46
41
|
"keywords": [
|
|
47
42
|
"svelte"
|
|
48
43
|
],
|
|
49
44
|
"dependencies": {
|
|
50
|
-
"@nekm/core": "^1.0.1"
|
|
45
|
+
"@nekm/core": "^1.0.1",
|
|
46
|
+
"@sveltejs/kit": "^2.22.4",
|
|
47
|
+
"svelte": "^5.35.5"
|
|
51
48
|
}
|
|
52
49
|
}
|