From 1ed0e97b103cb0b893e6533c95f1ecef25dac132 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Mon, 23 Feb 2026 18:32:07 +0100 Subject: [PATCH 01/26] Log debug information --- .../datawrapper-switcher/DatawrapperSwitcher.svelte | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sophora-components/src/routes/datawrapper-switcher/DatawrapperSwitcher.svelte b/sophora-components/src/routes/datawrapper-switcher/DatawrapperSwitcher.svelte index 0732296..34c6b8a 100644 --- a/sophora-components/src/routes/datawrapper-switcher/DatawrapperSwitcher.svelte +++ b/sophora-components/src/routes/datawrapper-switcher/DatawrapperSwitcher.svelte @@ -21,7 +21,10 @@
- Datawrapper switcher to be rendered here: +
{JSON.stringify({ labels, ids, fixedHeight, layout }, null, 2)}
+ + -
+
From f013be0a9dc9c8d3ccfd2761a0f2f3d42978cb1c Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Wed, 25 Feb 2026 11:10:29 +0100 Subject: [PATCH 02/26] Refactor getDataFromUrl (less specific to domains, add error logging) --- .../src/lib/utils/getDataFromUrl.ts | 29 +++++------- .../DatawrapperSwitcher.svelte | 47 +++++++++++++------ .../highlight-cards/HighlightCards.svelte | 5 ++ sophora-components/svelte.config.js | 1 + 4 files changed, 51 insertions(+), 31 deletions(-) diff --git a/sophora-components/src/lib/utils/getDataFromUrl.ts b/sophora-components/src/lib/utils/getDataFromUrl.ts index 9448278..ac1fe0f 100644 --- a/sophora-components/src/lib/utils/getDataFromUrl.ts +++ b/sophora-components/src/lib/utils/getDataFromUrl.ts @@ -1,21 +1,16 @@ export default function getDataFromUrl(target: HTMLElement): Record { - let url: URL; - if ( - // SvelteKit DEV mode, preview server, or static hosting: - import.meta.env.DEV || - window.location.origin === 'http://localhost:4173' || - window.location.origin === 'https://static.datenhub.net' || - window.location.href.includes('apidata.googleusercontent.com') || - window.location.href.includes('storage.googleapis.com') - ) { + const parent = target.parentNode?.parentNode as HTMLElement | null; + + // Default: Embedded mode – use URL used to embed the component + // `data-url` is the embeds the grandparent element, provided by Sophora + let embedURL = parent?.dataset.url; + + if (!embedURL) { // Preview mode – use URL of current page - url = new URL(window.location.href); - } else { - // Embedded mode – use URL used to embed the component - // `data-url` is set on the grandparent element, provided by Sophora - const parent = target.parentNode?.parentNode as HTMLElement | null; - url = new URL(parent?.dataset.url || ''); + embedURL = window?.location.href; } - const params: Record = Object.fromEntries(url.searchParams); - return params; + + return URL.canParse(embedURL) + ? Object.fromEntries(new URL(embedURL).searchParams.entries()) + : (console.error('Could not parse Embed-URL:', embedURL), {}); } diff --git a/sophora-components/src/routes/datawrapper-switcher/DatawrapperSwitcher.svelte b/sophora-components/src/routes/datawrapper-switcher/DatawrapperSwitcher.svelte index 34c6b8a..c57901e 100644 --- a/sophora-components/src/routes/datawrapper-switcher/DatawrapperSwitcher.svelte +++ b/sophora-components/src/routes/datawrapper-switcher/DatawrapperSwitcher.svelte @@ -1,7 +1,7 @@
-

Datawrapper switcher to be rendered here:

-
{JSON.stringify({ labels, ids, fixedHeight, layout }, null, 2)}
- - + /> - +
+ +

Debug Information:

+

actual url: {url || 'n/a'}

+

data-url: {root?.parentNode?.parentNode?.dataset.url || 'n/a'}

+
+
{JSON.stringify({ labels, ids, fixedHeight, layout }, null, 2)}
+ {#if error} +
{error}
+ {/if}
diff --git a/sophora-components/src/routes/highlight-cards/HighlightCards.svelte b/sophora-components/src/routes/highlight-cards/HighlightCards.svelte index bc6657d..f1ec268 100644 --- a/sophora-components/src/routes/highlight-cards/HighlightCards.svelte +++ b/sophora-components/src/routes/highlight-cards/HighlightCards.svelte @@ -35,5 +35,10 @@ @media (min-width: 1200px) { grid-template-columns: repeat(2, minmax(0, 1fr)); } + + /* Explicitly set background color for dark mode, workaround for SWR Aktuell App */ + @media (prefers-color-scheme: dark) { + background-color: #0c0c0c; + } } diff --git a/sophora-components/svelte.config.js b/sophora-components/svelte.config.js index cf5067f..dfb2f16 100644 --- a/sophora-components/svelte.config.js +++ b/sophora-components/svelte.config.js @@ -6,6 +6,7 @@ const dev = process.argv.includes('dev'); /** @type {import('@sveltejs/kit').Config} */ const config = { kit: { + embedded: true, paths: { base: dev ? '' : process.env.BASE_PATH, assets: dev ? '' : process.env.ASSETS_PATH From 81ccbf2bbd517edea5e50a51e471b56b29a9f54e Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Wed, 25 Mar 2026 18:42:13 +0100 Subject: [PATCH 03/26] Alternative setup: Svelte only, clientside rendering --- package-lock.json | 247 ++++++++++++------ sophora-components/datawrapper-switcher.html | 29 ++ sophora-components/highlight-cards.html | 29 ++ .../{src/app.html => index.html} | 8 +- sophora-components/package.json | 10 +- sophora-components/src/app.d.ts | 13 - .../DatawrapperSwitcher.svelte | 13 +- .../HighlightCards.svelte | 5 +- .../src/entries/datawrapper-switcher.ts | 8 + .../src/entries/highlight-cards.ts | 8 + sophora-components/src/entries/index.ts | 6 + sophora-components/src/hooks.server.js | 15 -- .../DatawrapperSwitcherPage.svelte} | 7 +- .../HighlightCardsPage.svelte} | 7 +- .../+page.svelte => pages/IndexPage.svelte} | 11 +- sophora-components/src/routes/+layout.js | 1 - .../src/shims/app-environment.ts | 6 + sophora-components/svelte.config.js | 18 -- sophora-components/tsconfig.json | 11 +- sophora-components/vite.config.ts | 36 ++- 20 files changed, 320 insertions(+), 168 deletions(-) create mode 100644 sophora-components/datawrapper-switcher.html create mode 100644 sophora-components/highlight-cards.html rename sophora-components/{src/app.html => index.html} (77%) delete mode 100644 sophora-components/src/app.d.ts rename sophora-components/src/{routes/datawrapper-switcher => components}/DatawrapperSwitcher.svelte (87%) rename sophora-components/src/{routes/highlight-cards => components}/HighlightCards.svelte (79%) create mode 100644 sophora-components/src/entries/datawrapper-switcher.ts create mode 100644 sophora-components/src/entries/highlight-cards.ts create mode 100644 sophora-components/src/entries/index.ts delete mode 100644 sophora-components/src/hooks.server.js rename sophora-components/src/{routes/datawrapper-switcher/+page.svelte => pages/DatawrapperSwitcherPage.svelte} (54%) rename sophora-components/src/{routes/highlight-cards/+page.svelte => pages/HighlightCardsPage.svelte} (53%) rename sophora-components/src/{routes/+page.svelte => pages/IndexPage.svelte} (81%) delete mode 100644 sophora-components/src/routes/+layout.js create mode 100644 sophora-components/src/shims/app-environment.ts diff --git a/package-lock.json b/package-lock.json index 153da8c..7497654 100644 --- a/package-lock.json +++ b/package-lock.json @@ -558,7 +558,6 @@ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "license": "MIT", - "peer": true, "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -755,6 +754,7 @@ "integrity": "sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "package-manager-detector": "^1.3.0", "tinyexec": "^1.0.1" @@ -794,7 +794,6 @@ "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", @@ -1231,6 +1230,7 @@ "integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -1298,7 +1298,8 @@ "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.1.2.tgz", "integrity": "sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@bufbuild/protobuf": { "version": "2.11.0", @@ -1313,6 +1314,7 @@ "integrity": "sha512-BvIKpRLeS/8UbfxXxgC33xOumsacaeCKAjAeLyOn7Pcp95HiRbrpl14S+9vaZLolnbssPIUuiUd8IvgkRyt6NQ==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@chevrotain/gast": "11.0.3", "@chevrotain/types": "11.0.3", @@ -1324,7 +1326,8 @@ "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@chevrotain/gast": { "version": "11.0.3", @@ -1332,6 +1335,7 @@ "integrity": "sha512-+qNfcoNk70PyS/uxmj3li5NiECO+2YKZZQMbmjTqRI3Qchu8Hig/Q9vgkHpI3alNjr7M+a2St5pw5w5F6NL5/Q==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@chevrotain/types": "11.0.3", "lodash-es": "4.17.21" @@ -1342,28 +1346,32 @@ "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@chevrotain/regexp-to-ast": { "version": "11.0.3", "resolved": "https://registry.npmjs.org/@chevrotain/regexp-to-ast/-/regexp-to-ast-11.0.3.tgz", "integrity": "sha512-1fMHaBZxLFvWI067AVbGJav1eRY7N8DDvYCTwGBiE/ytKBgP8azTdgyrKyWZ9Mfh09eHWb5PgTSO8wi7U824RA==", "dev": true, - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/@chevrotain/types": { "version": "11.0.3", "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.0.3.tgz", "integrity": "sha512-gsiM3G8b58kZC2HaWR50gu6Y1440cHiJ+i3JUvcp/35JchYejb2+5MVeJK0iKThYpAa/P2PYFV4hoi44HD+aHQ==", "dev": true, - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/@chevrotain/utils": { "version": "11.0.3", "resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-11.0.3.tgz", "integrity": "sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==", "dev": true, - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/@colors/colors": { "version": "1.5.0", @@ -2155,7 +2163,8 @@ "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz", "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@iconify/utils": { "version": "3.1.0", @@ -2163,6 +2172,7 @@ "integrity": "sha512-Zlzem1ZXhI1iHeeERabLNzBHdOa4VhQbqAcOQaMKuTuyZCpwKbC2R4Dd0Zo3g9EAc+Y4fiarO8HIHRAth7+skw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@antfu/install-pkg": "^1.1.0", "@iconify/types": "^2.0.0", @@ -3371,6 +3381,7 @@ "integrity": "sha512-lnjOhe7zyHjc+If7yT4zoedx2vo4sHaTmtkl1+or8BRTnCtDmcTpAjpzDSfCZrshM5bCoz0GyidzadJAH1xobA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "langium": "3.3.1" } @@ -3404,7 +3415,6 @@ "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@octokit/auth-token": "^6.0.0", "@octokit/graphql": "^9.0.3", @@ -5317,7 +5327,6 @@ "integrity": "sha512-2iG4PlBiKLrVbGlwDRCTFgMfW5kBUvIAhJ8cfE2jOeS9cZFuY5Bbl9YJQpiXXcTqaEaX4gLrla5+q2lvQKZIaA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "ts-dedent": "^2.0.0", "type-fest": "~2.19" @@ -5470,7 +5479,6 @@ "integrity": "sha512-iAIPEahFgDJJyvz8g0jP08KvqnM6JvdW8YfsygZ+pMeMvyM2zssWMltcsotETvjSZ82G3VlitgDtBIvpQSZrTA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@standard-schema/spec": "^1.0.0", "@sveltejs/acorn-typescript": "^1.0.5", @@ -5580,7 +5588,6 @@ "integrity": "sha512-ou/d51QSdTyN26D7h6dSpusAKaZkAiGM55/AKYi+9AGZw7q85hElbjK3kEyzXHhLSnRISHOYzVge6x0jRZ7DXA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@sveltejs/vite-plugin-svelte-inspector": "^5.0.0", "deepmerge": "^4.3.1", @@ -5621,7 +5628,6 @@ "dev": true, "hasInstallScript": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@swc/counter": "^0.1.3", "@swc/types": "^0.1.25" @@ -5869,6 +5875,7 @@ "integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -5889,6 +5896,7 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -5899,6 +5907,7 @@ "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -5912,6 +5921,7 @@ "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "dequal": "^2.0.3" } @@ -5922,6 +5932,7 @@ "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", @@ -5936,7 +5947,8 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@testing-library/jest-dom": { "version": "6.9.1", @@ -6014,7 +6026,8 @@ "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/babel__core": { "version": "7.20.5", @@ -6085,6 +6098,7 @@ "integrity": "sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/d3-array": "*", "@types/d3-axis": "*", @@ -6123,7 +6137,8 @@ "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz", "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-axis": { "version": "3.0.6", @@ -6131,6 +6146,7 @@ "integrity": "sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/d3-selection": "*" } @@ -6141,6 +6157,7 @@ "integrity": "sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/d3-selection": "*" } @@ -6150,14 +6167,16 @@ "resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-3.0.6.tgz", "integrity": "sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-color": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-contour": { "version": "3.0.6", @@ -6165,6 +6184,7 @@ "integrity": "sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/d3-array": "*", "@types/geojson": "*" @@ -6175,14 +6195,16 @@ "resolved": "https://registry.npmjs.org/@types/d3-delaunay/-/d3-delaunay-6.0.4.tgz", "integrity": "sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-dispatch": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-3.0.7.tgz", "integrity": "sha512-5o9OIAdKkhN1QItV2oqaE5KMIiXAvDWBDPrD85e58Qlz1c1kI/J0NcqbEG88CoTwJrYe7ntUCVfeUl2UJKbWgA==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-drag": { "version": "3.0.7", @@ -6190,6 +6212,7 @@ "integrity": "sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/d3-selection": "*" } @@ -6206,7 +6229,8 @@ "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-fetch": { "version": "3.0.7", @@ -6214,6 +6238,7 @@ "integrity": "sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/d3-dsv": "*" } @@ -6223,14 +6248,16 @@ "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.10.tgz", "integrity": "sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-format": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-3.0.4.tgz", "integrity": "sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-geo": { "version": "3.1.0", @@ -6238,6 +6265,7 @@ "integrity": "sha512-856sckF0oP/diXtS4jNsiQw/UuK5fQG8l/a9VVLeSouf1/PPbBE1i1W852zVwKwYCBkFJJB7nCFTbk6UMEXBOQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/geojson": "*" } @@ -6247,7 +6275,8 @@ "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-3.1.7.tgz", "integrity": "sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-interpolate": { "version": "3.0.4", @@ -6255,6 +6284,7 @@ "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/d3-color": "*" } @@ -6264,28 +6294,32 @@ "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz", "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-polygon": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-3.0.2.tgz", "integrity": "sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-quadtree": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-3.0.6.tgz", "integrity": "sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-random": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-3.0.3.tgz", "integrity": "sha512-Imagg1vJ3y76Y2ea0871wpabqp613+8/r0mCLEBfdtqC7xMSfj9idOnmBYyMoULfHePJyxMAw3nWhJxzc+LFwQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-scale": { "version": "4.0.9", @@ -6293,6 +6327,7 @@ "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/d3-time": "*" } @@ -6302,14 +6337,16 @@ "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", "integrity": "sha512-iWMJgwkK7yTRmWqRB5plb1kadXyQ5Sj8V/zYlFGMUBbIPKQScw+Dku9cAAMgJG+z5GYDoMjWGLVOvjghDEFnKQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-selection": { "version": "3.0.11", "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.11.tgz", "integrity": "sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-shape": { "version": "3.1.8", @@ -6317,6 +6354,7 @@ "integrity": "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/d3-path": "*" } @@ -6326,21 +6364,24 @@ "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz", "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-time-format": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-4.0.3.tgz", "integrity": "sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-timer": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/d3-transition": { "version": "3.0.9", @@ -6348,6 +6389,7 @@ "integrity": "sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/d3-selection": "*" } @@ -6358,6 +6400,7 @@ "integrity": "sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/d3-interpolate": "*", "@types/d3-selection": "*" @@ -6626,7 +6669,6 @@ "integrity": "sha512-klQbnPAAiGYFyI02+znpBRLyjL4/BrBd0nyWkdC0s/6xFLkXYQ8OoRrSkqacS1ddVxf/LDyODIKbQ5TgKAf/Fg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.56.1", "@typescript-eslint/types": "8.56.1", @@ -7157,7 +7199,6 @@ "integrity": "sha512-gVQqh7paBz3gC+ZdcCmNSWJMk70IUjDeVqi+5m5vYpEHsIwRgw3Y545jljtajhkekIpIp5Gg8oK7bctgY0E2Ng==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@vitest/mocker": "4.0.18", "@vitest/utils": "4.0.18", @@ -7181,7 +7222,6 @@ "integrity": "sha512-gfajTHVCiwpxRj1qh0Sh/5bbGLG4F/ZH/V9xvFVoFddpITfMta9YGow0W6ZpTTORv2vdJuz9TnrNSmjKvpOf4g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@vitest/browser": "4.0.18", "@vitest/mocker": "4.0.18", @@ -7355,7 +7395,6 @@ "integrity": "sha512-rpk9y12PGa22Jg6g5M3UVVnTS7+zycIGk9ZNGN+m6tZHKQb7jrP7/77WfZy13Y/EUDd52NDsLRQhYKtv7XfPQw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@vitest/utils": "4.0.18", "pathe": "^2.0.3" @@ -7443,7 +7482,6 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -8188,7 +8226,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -8520,6 +8557,7 @@ "integrity": "sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@chevrotain/cst-dts-gen": "11.0.3", "@chevrotain/gast": "11.0.3", @@ -8535,6 +8573,7 @@ "integrity": "sha512-b7g+y9A0v4mxCW1qUhf3BSVPg+/NvGErk/dOkrDaHA0nQIQGAtrOjlX//9OQtRlSCy+x9rfB5N8yC71lH1nvMw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "lodash-es": "^4.17.21" }, @@ -8547,7 +8586,8 @@ "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/chokidar": { "version": "4.0.3", @@ -9043,7 +9083,8 @@ "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/config-chain": { "version": "1.1.13", @@ -9167,6 +9208,7 @@ "integrity": "sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "layout-base": "^1.0.0" } @@ -9267,7 +9309,8 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/cwd": { "version": "0.10.0", @@ -9300,6 +9343,7 @@ "integrity": "sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cose-base": "^1.0.0" }, @@ -9313,6 +9357,7 @@ "integrity": "sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cose-base": "^2.2.0" }, @@ -9326,6 +9371,7 @@ "integrity": "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "layout-base": "^2.0.0" } @@ -9335,7 +9381,8 @@ "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-2.0.1.tgz", "integrity": "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/d3": { "version": "7.9.0", @@ -9343,6 +9390,7 @@ "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "d3-array": "3", "d3-axis": "3", @@ -9398,6 +9446,7 @@ "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==", "dev": true, "license": "ISC", + "peer": true, "engines": { "node": ">=12" } @@ -9408,6 +9457,7 @@ "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "d3-dispatch": "1 - 3", "d3-drag": "2 - 3", @@ -9425,6 +9475,7 @@ "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "d3-path": "1 - 3" }, @@ -9448,6 +9499,7 @@ "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "d3-array": "^3.2.0" }, @@ -9461,6 +9513,7 @@ "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "delaunator": "5" }, @@ -9474,6 +9527,7 @@ "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", "dev": true, "license": "ISC", + "peer": true, "engines": { "node": ">=12" } @@ -9484,6 +9538,7 @@ "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "d3-dispatch": "1 - 3", "d3-selection": "3" @@ -9521,6 +9576,7 @@ "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "engines": { "node": ">=12" } @@ -9531,6 +9587,7 @@ "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "d3-dsv": "1 - 3" }, @@ -9544,6 +9601,7 @@ "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "d3-dispatch": "1 - 3", "d3-quadtree": "1 - 3", @@ -9569,6 +9627,7 @@ "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "d3-array": "2.5.0 - 3" }, @@ -9582,6 +9641,7 @@ "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", "dev": true, "license": "ISC", + "peer": true, "engines": { "node": ">=12" } @@ -9615,6 +9675,7 @@ "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==", "dev": true, "license": "ISC", + "peer": true, "engines": { "node": ">=12" } @@ -9625,6 +9686,7 @@ "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", "dev": true, "license": "ISC", + "peer": true, "engines": { "node": ">=12" } @@ -9635,6 +9697,7 @@ "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==", "dev": true, "license": "ISC", + "peer": true, "engines": { "node": ">=12" } @@ -9645,6 +9708,7 @@ "integrity": "sha512-nQhsBRmM19Ax5xEIPLMY9ZmJ/cDvd1BG3UVvt5h3WRxKg5zGRbvnteTyWAbzeSvlh3tW7ZEmq4VwR5mB3tutmQ==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "d3-array": "1 - 2", "d3-shape": "^1.2.0" @@ -9656,6 +9720,7 @@ "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "internmap": "^1.0.0" } @@ -9665,7 +9730,8 @@ "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==", "dev": true, - "license": "BSD-3-Clause" + "license": "BSD-3-Clause", + "peer": true }, "node_modules/d3-sankey/node_modules/d3-shape": { "version": "1.3.7", @@ -9673,6 +9739,7 @@ "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "d3-path": "1" } @@ -9682,7 +9749,8 @@ "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/d3-scale": { "version": "4.0.2", @@ -9707,6 +9775,7 @@ "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "d3-color": "1 - 3", "d3-interpolate": "1 - 3" @@ -9771,6 +9840,7 @@ "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", "dev": true, "license": "ISC", + "peer": true, "engines": { "node": ">=12" } @@ -9781,6 +9851,7 @@ "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "d3-color": "1 - 3", "d3-dispatch": "1 - 3", @@ -9801,6 +9872,7 @@ "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "d3-dispatch": "1 - 3", "d3-drag": "2 - 3", @@ -9818,6 +9890,7 @@ "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 10" } @@ -9828,6 +9901,7 @@ "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "commander": "7", "iconv-lite": "0.6", @@ -9854,6 +9928,7 @@ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -9867,6 +9942,7 @@ "integrity": "sha512-efEhnxpSuwpYOKRm/L5KbqoZmNNukHa/Flty4Wp62JRvgH2ojwVgPgdYyr4twpieZnyRDdIH7PY2mopX26+j2Q==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "d3": "^7.9.0", "lodash-es": "^4.17.21" @@ -9888,7 +9964,8 @@ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/debug": { "version": "4.4.3", @@ -10072,6 +10149,7 @@ "integrity": "sha512-8nvh+XBe96aCESrGOqMp/84b13H9cdKbG5P2ejQCh4d4sK9RL4371qou9drQjMhvnPmhWl5hnmqbEE0fXr9Xnw==", "dev": true, "license": "ISC", + "peer": true, "dependencies": { "robust-predicates": "^3.0.2" } @@ -10180,7 +10258,8 @@ "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/dom-serializer": { "version": "0.2.2", @@ -10239,6 +10318,7 @@ "integrity": "sha512-qkdCKzLNtrgPFP1Vo+98FRzJnBRGe4ffyCea9IwHB1fyxPOeNTHpLKYGd4Uk9xvNoH0ZoOjwZxNptyMwqrId1Q==", "dev": true, "license": "(MPL-2.0 OR Apache-2.0)", + "peer": true, "optionalDependencies": { "@types/trusted-types": "^2.0.7" } @@ -10695,7 +10775,6 @@ "dev": true, "hasInstallScript": true, "license": "MIT", - "peer": true, "bin": { "esbuild": "bin/esbuild" }, @@ -10800,7 +10879,6 @@ "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -12185,7 +12263,8 @@ "resolved": "https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.5.2.tgz", "integrity": "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/handlebars": { "version": "4.7.8", @@ -13318,7 +13397,6 @@ "integrity": "sha512-F26gjC0yWN8uAA5m5Ss8ZQf5nDHWGlN/xWZIh8S5SRbsEKBovwZhxGd6LJlbZYxBgCYOtreSUyb8hpXyGC5O4A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/core": "30.2.0", "@jest/types": "30.2.0", @@ -14213,6 +14291,7 @@ "https://github.com/sponsors/katex" ], "license": "MIT", + "peer": true, "dependencies": { "commander": "^8.3.0" }, @@ -14226,6 +14305,7 @@ "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 12" } @@ -14250,7 +14330,8 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/khroma/-/khroma-2.1.0.tgz", "integrity": "sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/kind-of": { "version": "6.0.3", @@ -14283,6 +14364,7 @@ "integrity": "sha512-QJv/h939gDpvT+9SiLVlY7tZC3xB2qK57v0J04Sh9wpMb6MP1q8gB21L3WIo8T5P1MSMg3Ep14L7KkDCFG3y4w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "chevrotain": "~11.0.3", "chevrotain-allstar": "~0.3.0", @@ -14319,7 +14401,8 @@ "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz", "integrity": "sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/leven": { "version": "3.1.0", @@ -14603,6 +14686,7 @@ "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", "dev": true, "license": "MIT", + "peer": true, "bin": { "lz-string": "bin/bin.js" } @@ -14698,7 +14782,6 @@ "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-5.7.0.tgz", "integrity": "sha512-Hs+Y0qbR1iZo+07WuSbYUCOOUK45pPRzA3+7Pes8Y9jCcAqZendIMcVP6O99CWD1V/znh3qHgaZOAi3jlVxwcg==", "license": "BSD-3-Clause", - "peer": true, "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", @@ -14766,6 +14849,7 @@ "integrity": "sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA==", "dev": true, "license": "MIT", + "peer": true, "bin": { "marked": "bin/marked.js" }, @@ -15024,6 +15108,7 @@ "integrity": "sha512-n34QPDPEKmaeCG4WDMGy0OT6PSyxKCfy2pJgShP+Qow2KLrvWjclwbc3yXfSIf4BanqWEhQEpngWwNp/XhZt6w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@braintree/sanitize-url": "^7.1.1", "@iconify/utils": "^3.0.1", @@ -15057,6 +15142,7 @@ "https://github.com/sponsors/ctavan" ], "license": "MIT", + "peer": true, "bin": { "uuid": "dist/esm/bin/uuid" } @@ -15869,6 +15955,7 @@ "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "acorn": "^8.15.0", "pathe": "^2.0.3", @@ -18193,7 +18280,6 @@ "dev": true, "inBundle": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -19142,7 +19228,8 @@ "resolved": "https://registry.npmjs.org/path-data-parser/-/path-data-parser-0.1.0.tgz", "integrity": "sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/path-exists": { "version": "4.0.0", @@ -19459,6 +19546,7 @@ "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "confbox": "^0.1.8", "mlly": "^1.7.4", @@ -19508,6 +19596,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } @@ -19536,7 +19625,8 @@ "resolved": "https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.2.0.tgz", "integrity": "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/points-on-path": { "version": "0.2.1", @@ -19544,6 +19634,7 @@ "integrity": "sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "path-data-parser": "0.1.0", "points-on-curve": "0.2.0" @@ -19583,7 +19674,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", @@ -19706,7 +19796,6 @@ "resolved": "https://registry.npmjs.org/posthtml/-/posthtml-0.16.7.tgz", "integrity": "sha512-7Hc+IvlQ7hlaIfQFZnxlRl0jnpWq2qwibORBhQYIb0QbNtuicc5ZxvKkVT71HJ4Py1wSZ/3VR1r8LfkCtoCzhw==", "license": "MIT", - "peer": true, "dependencies": { "posthtml-parser": "^0.11.0", "posthtml-render": "^3.0.0" @@ -19868,7 +19957,6 @@ "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -20245,7 +20333,6 @@ "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -20256,7 +20343,6 @@ "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -20605,7 +20691,8 @@ "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz", "integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==", "dev": true, - "license": "Unlicense" + "license": "Unlicense", + "peer": true }, "node_modules/rollup": { "version": "4.57.1", @@ -20613,7 +20700,6 @@ "integrity": "sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/estree": "1.0.8" }, @@ -20659,6 +20745,7 @@ "integrity": "sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "hachure-fill": "^0.5.2", "path-data-parser": "^0.1.0", @@ -20728,7 +20815,6 @@ "integrity": "sha512-t+YPtOQHpGW1QWsh1CHQ5cPIr9lbbGZLZnbihP/D/qZj/yuV68m8qarcV17nvkOX81BCrvzAlq2klCQFZghyTg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -20750,7 +20836,6 @@ "integrity": "sha512-eKzFy13Nk+IRHhlAwP3sfuv+PzOrvzUkwJK2hdoCKYcWGSdmwFpeGpWmyewdw8EgBnsKaSBtgf/0b2K635ecSA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@bufbuild/protobuf": "^2.5.0", "colorjs.io": "^0.5.0", @@ -21193,7 +21278,6 @@ "integrity": "sha512-WRgl5GcypwramYX4HV+eQGzUbD7UUbljVmS+5G1uMwX/wLgYuJAxGeerXJDMO2xshng4+FXqCgyB5QfClV6WjA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@semantic-release/commit-analyzer": "^13.0.1", "@semantic-release/error": "^4.0.0", @@ -21437,7 +21521,6 @@ "integrity": "sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==", "dev": true, "license": "MIT", - "peer": true, "bin": { "marked": "bin/marked.js" }, @@ -22354,7 +22437,6 @@ "integrity": "sha512-heMfJjOfbHvL+wlCAwFZlSxcakyJ5yQDam6e9k2RRArB1veJhRnsjO6lO1hOXjJYrqxfHA/ldIugbBVlCDqfvQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@storybook/global": "^5.0.0", "@storybook/icons": "^2.0.1", @@ -22707,7 +22789,8 @@ "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.6.tgz", "integrity": "sha512-yQ3rwFWRfwNUY7H5vpU0wfdkNSnvnJinhF9830Swlaxl03zsOjCfmX0ugac+3LtK0lYSgwL/KXc8oYL3mG4YFQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/subtag": { "version": "0.5.0", @@ -22788,7 +22871,6 @@ "integrity": "sha512-YkqERnF05g8KLdDZwZrF8/i1eSbj6Eoat8Jjr2IfruZz9StLuBqo8sfCSzjosNKd+ZrQ8DkKZDjpO5y3ht1Pow==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jridgewell/remapping": "^2.3.4", "@jridgewell/sourcemap-codec": "^1.5.0", @@ -23516,7 +23598,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -23560,7 +23641,8 @@ "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.3.tgz", "integrity": "sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/uglify-js": { "version": "3.19.3", @@ -23744,7 +23826,6 @@ "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/unist": "^2.0.0", "unist-util-is": "^5.0.0", @@ -24037,7 +24118,6 @@ "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", @@ -24148,7 +24228,6 @@ "integrity": "sha512-hOQuK7h0FGKgBAas7v0mSAsnvrIgAvWmRFjmzpJ7SwFHH3g1k2u37JtYwOwmEKhK6ZO3v9ggDBBm0La1LCK4uQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@vitest/expect": "4.0.18", "@vitest/mocker": "4.0.18", @@ -24255,6 +24334,7 @@ "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=14.0.0" } @@ -24265,6 +24345,7 @@ "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "vscode-languageserver-protocol": "3.17.5" }, @@ -24278,6 +24359,7 @@ "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "vscode-jsonrpc": "8.2.0", "vscode-languageserver-types": "3.17.5" @@ -24288,21 +24370,24 @@ "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/vscode-languageserver-types": { "version": "3.17.5", "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/vscode-uri": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/wait-on": { "version": "8.0.3", @@ -24893,8 +24978,6 @@ "devDependencies": { "@eslint/compat": "^2.0.2", "@eslint/js": "^9.39.2", - "@sveltejs/adapter-static": "^3.0.10", - "@sveltejs/kit": "^2.53.4", "@sveltejs/vite-plugin-svelte": "^6.2.4", "@swr-data-lab/components": "^2.43.0", "@types/node": "^22", diff --git a/sophora-components/datawrapper-switcher.html b/sophora-components/datawrapper-switcher.html new file mode 100644 index 0000000..9f41758 --- /dev/null +++ b/sophora-components/datawrapper-switcher.html @@ -0,0 +1,29 @@ + + + + + + + + + +
+ + + diff --git a/sophora-components/highlight-cards.html b/sophora-components/highlight-cards.html new file mode 100644 index 0000000..19ae634 --- /dev/null +++ b/sophora-components/highlight-cards.html @@ -0,0 +1,29 @@ + + + + + + + + + +
+ + + diff --git a/sophora-components/src/app.html b/sophora-components/index.html similarity index 77% rename from sophora-components/src/app.html rename to sophora-components/index.html index f935657..18909b9 100644 --- a/sophora-components/src/app.html +++ b/sophora-components/index.html @@ -2,11 +2,8 @@ - - %sveltekit.head% - - -
%sveltekit.body%
+ +
+ diff --git a/sophora-components/package.json b/sophora-components/package.json index 32e8319..48f6d37 100644 --- a/sophora-components/package.json +++ b/sophora-components/package.json @@ -4,19 +4,17 @@ "version": "0.0.1", "type": "module", "scripts": { - "dev": "vite dev", - "build": "svelte-kit sync && vite build", + "dev": "vite", + "build": "vite build", "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "check": "svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", "format": "prettier --write .", "lint": "prettier --check . && eslint ." }, "devDependencies": { "@eslint/compat": "^2.0.2", "@eslint/js": "^9.39.2", - "@sveltejs/adapter-static": "^3.0.10", - "@sveltejs/kit": "^2.53.4", "@sveltejs/vite-plugin-svelte": "^6.2.4", "@swr-data-lab/components": "^2.43.0", "@types/node": "^22", diff --git a/sophora-components/src/app.d.ts b/sophora-components/src/app.d.ts deleted file mode 100644 index da08e6d..0000000 --- a/sophora-components/src/app.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// See https://svelte.dev/docs/kit/types#app.d.ts -// for information about these interfaces -declare global { - namespace App { - // interface Error {} - // interface Locals {} - // interface PageData {} - // interface PageState {} - // interface Platform {} - } -} - -export {}; diff --git a/sophora-components/src/routes/datawrapper-switcher/DatawrapperSwitcher.svelte b/sophora-components/src/components/DatawrapperSwitcher.svelte similarity index 87% rename from sophora-components/src/routes/datawrapper-switcher/DatawrapperSwitcher.svelte rename to sophora-components/src/components/DatawrapperSwitcher.svelte index c57901e..1d36560 100644 --- a/sophora-components/src/routes/datawrapper-switcher/DatawrapperSwitcher.svelte +++ b/sophora-components/src/components/DatawrapperSwitcher.svelte @@ -1,7 +1,8 @@ {#if dev} diff --git a/sophora-components/src/routes/highlight-cards/+page.svelte b/sophora-components/src/pages/HighlightCardsPage.svelte similarity index 53% rename from sophora-components/src/routes/highlight-cards/+page.svelte rename to sophora-components/src/pages/HighlightCardsPage.svelte index bb81f61..c4bcb93 100644 --- a/sophora-components/src/routes/highlight-cards/+page.svelte +++ b/sophora-components/src/pages/HighlightCardsPage.svelte @@ -1,7 +1,8 @@ {#if dev} diff --git a/sophora-components/src/routes/+page.svelte b/sophora-components/src/pages/IndexPage.svelte similarity index 81% rename from sophora-components/src/routes/+page.svelte rename to sophora-components/src/pages/IndexPage.svelte index dba12f7..1dd1466 100644 --- a/sophora-components/src/routes/+page.svelte +++ b/sophora-components/src/pages/IndexPage.svelte @@ -1,6 +1,5 @@ - - - - diff --git a/sophora-components/src/routes/+layout.js b/sophora-components/src/routes/+layout.js deleted file mode 100644 index 189f71e..0000000 --- a/sophora-components/src/routes/+layout.js +++ /dev/null @@ -1 +0,0 @@ -export const prerender = true; diff --git a/sophora-components/src/shims/app-environment.ts b/sophora-components/src/shims/app-environment.ts new file mode 100644 index 0000000..d8e1ee6 --- /dev/null +++ b/sophora-components/src/shims/app-environment.ts @@ -0,0 +1,6 @@ +// Shim for $app/environment used by @swr-data-lab/components +// Replaces SvelteKit's built-in module in this pure Vite setup +export const browser = typeof window !== 'undefined'; +export const dev = import.meta.env.DEV; +export const building = false; +export const version = ''; diff --git a/sophora-components/svelte.config.js b/sophora-components/svelte.config.js index dfb2f16..48941f5 100644 --- a/sophora-components/svelte.config.js +++ b/sophora-components/svelte.config.js @@ -1,24 +1,6 @@ -import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; -const dev = process.argv.includes('dev'); - -/** @type {import('@sveltejs/kit').Config} */ const config = { - kit: { - embedded: true, - paths: { - base: dev ? '' : process.env.BASE_PATH, - assets: dev ? '' : process.env.ASSETS_PATH - }, - adapter: adapter({ - pages: 'build', - assets: 'build', - fallback: undefined, - precompress: false, - strict: true - }) - }, preprocess: [vitePreprocess()] }; diff --git a/sophora-components/tsconfig.json b/sophora-components/tsconfig.json index c5a0883..e692a50 100644 --- a/sophora-components/tsconfig.json +++ b/sophora-components/tsconfig.json @@ -1,14 +1,19 @@ { - "extends": "./.svelte-kit/tsconfig.json", "compilerOptions": { "allowJs": true, "checkJs": true, "target": "es2022", + "module": "es2022", + "moduleResolution": "bundler", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "skipLibCheck": true, "sourceMap": true, - "strict": true - } + "strict": true, + "paths": { + "$lib/*": ["./src/lib/*"] + } + }, + "include": ["src/**/*", "vite.config.ts"] } diff --git a/sophora-components/vite.config.ts b/sophora-components/vite.config.ts index bbf8c7d..de999ac 100644 --- a/sophora-components/vite.config.ts +++ b/sophora-components/vite.config.ts @@ -1,6 +1,38 @@ -import { sveltekit } from '@sveltejs/kit/vite'; +import { svelte } from '@sveltejs/vite-plugin-svelte'; import { defineConfig } from 'vite'; +import { resolve, dirname } from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); export default defineConfig({ - plugins: [sveltekit()] + plugins: [ + { + name: 'resolve-app-environment', + resolveId(id) { + if (id === '$app/environment') { + return resolve(__dirname, 'src/shims/app-environment.ts'); + } + } + }, + svelte() + ], + resolve: { + alias: { + $lib: resolve(__dirname, 'src/lib') + } + }, + optimizeDeps: { + exclude: ['@swr-data-lab/components'] + }, + build: { + rollupOptions: { + input: { + index: resolve(__dirname, 'index.html'), + 'datawrapper-switcher': resolve(__dirname, 'datawrapper-switcher.html'), + 'highlight-cards': resolve(__dirname, 'highlight-cards.html') + } + }, + outDir: 'build' + } }); From 1a3bb30bff263a46f8f52ad064fe5f1949ebde43 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Thu, 26 Mar 2026 16:23:06 +0100 Subject: [PATCH 04/26] Run storybook workflows for components directory only --- .github/workflows/deploy-storybook.yml | 2 ++ .github/workflows/test-storybook.yml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/deploy-storybook.yml b/.github/workflows/deploy-storybook.yml index 57ceb96..3911d60 100644 --- a/.github/workflows/deploy-storybook.yml +++ b/.github/workflows/deploy-storybook.yml @@ -2,6 +2,8 @@ name: 'Deploy Storybook' on: workflow_dispatch: push: + paths: + - 'components/**' branches: - main jobs: diff --git a/.github/workflows/test-storybook.yml b/.github/workflows/test-storybook.yml index 4ea5397..735b456 100644 --- a/.github/workflows/test-storybook.yml +++ b/.github/workflows/test-storybook.yml @@ -2,9 +2,13 @@ name: 'Run Storybook Tests' on: workflow_dispatch: push: + paths: + - 'components/**' branches: - main pull_request: + paths: + - 'components/**' types: [opened, synchronize] jobs: From 89de4b190b0cbd7b402fad0991a99d1daee12905 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Thu, 26 Mar 2026 16:51:22 +0100 Subject: [PATCH 05/26] Resolve individual imports from @swr-data-lab/components --- .../src/components/DatawrapperSwitcher.svelte | 4 ++-- sophora-components/src/components/HighlightCards.svelte | 4 ++-- sophora-components/src/pages/DatawrapperSwitcherPage.svelte | 2 +- sophora-components/src/pages/HighlightCardsPage.svelte | 2 +- sophora-components/vite.config.ts | 6 +++++- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sophora-components/src/components/DatawrapperSwitcher.svelte b/sophora-components/src/components/DatawrapperSwitcher.svelte index 1d36560..7538e28 100644 --- a/sophora-components/src/components/DatawrapperSwitcher.svelte +++ b/sophora-components/src/components/DatawrapperSwitcher.svelte @@ -1,7 +1,7 @@ + +

Demo Embeds

+{#each charts as chart} + +{/each} From 92acb4b30c56f3bfffb61cb2ece9c32784b643fb Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Mon, 30 Mar 2026 23:29:18 +0200 Subject: [PATCH 10/26] Refactor project structure --- sophora-components/datawrapper-switcher.html | 2 +- sophora-components/highlight-cards.html | 2 +- sophora-components/index.html | 2 +- .../src/{entries/index.ts => routes/app/entry.ts} | 2 +- .../src/{pages/IndexPage.svelte => routes/app/index.svelte} | 0 .../datawrapper-switcher/entry.ts} | 2 +- .../datawrapper-switcher/index.svelte} | 2 +- .../highlight-cards.ts => routes/highlight-cards/entry.ts} | 2 +- .../highlight-cards/index.svelte} | 2 +- 9 files changed, 8 insertions(+), 8 deletions(-) rename sophora-components/src/{entries/index.ts => routes/app/entry.ts} (73%) rename sophora-components/src/{pages/IndexPage.svelte => routes/app/index.svelte} (100%) rename sophora-components/src/{entries/datawrapper-switcher.ts => routes/datawrapper-switcher/entry.ts} (72%) rename sophora-components/src/{pages/DatawrapperSwitcherPage.svelte => routes/datawrapper-switcher/index.svelte} (82%) rename sophora-components/src/{entries/highlight-cards.ts => routes/highlight-cards/entry.ts} (74%) rename sophora-components/src/{pages/HighlightCardsPage.svelte => routes/highlight-cards/index.svelte} (83%) diff --git a/sophora-components/datawrapper-switcher.html b/sophora-components/datawrapper-switcher.html index 9f41758..6ef4b70 100644 --- a/sophora-components/datawrapper-switcher.html +++ b/sophora-components/datawrapper-switcher.html @@ -24,6 +24,6 @@
- + diff --git a/sophora-components/highlight-cards.html b/sophora-components/highlight-cards.html index 19ae634..5b0c793 100644 --- a/sophora-components/highlight-cards.html +++ b/sophora-components/highlight-cards.html @@ -24,6 +24,6 @@
- + diff --git a/sophora-components/index.html b/sophora-components/index.html index 18909b9..c33f8d1 100644 --- a/sophora-components/index.html +++ b/sophora-components/index.html @@ -24,6 +24,6 @@
- + diff --git a/sophora-components/src/entries/index.ts b/sophora-components/src/routes/app/entry.ts similarity index 73% rename from sophora-components/src/entries/index.ts rename to sophora-components/src/routes/app/entry.ts index 3c2afce..be17e8c 100644 --- a/sophora-components/src/entries/index.ts +++ b/sophora-components/src/routes/app/entry.ts @@ -1,5 +1,5 @@ import { mount } from 'svelte'; -import IndexPage from '../pages/IndexPage.svelte'; +import IndexPage from './index.svelte'; mount(IndexPage, { target: document.querySelector('[data-lab-components-embed="swr-sophora-components"]')! diff --git a/sophora-components/src/pages/IndexPage.svelte b/sophora-components/src/routes/app/index.svelte similarity index 100% rename from sophora-components/src/pages/IndexPage.svelte rename to sophora-components/src/routes/app/index.svelte diff --git a/sophora-components/src/entries/datawrapper-switcher.ts b/sophora-components/src/routes/datawrapper-switcher/entry.ts similarity index 72% rename from sophora-components/src/entries/datawrapper-switcher.ts rename to sophora-components/src/routes/datawrapper-switcher/entry.ts index f61a0a8..a330a2f 100644 --- a/sophora-components/src/entries/datawrapper-switcher.ts +++ b/sophora-components/src/routes/datawrapper-switcher/entry.ts @@ -1,5 +1,5 @@ import { mount } from 'svelte'; -import DatawrapperSwitcherPage from '../pages/DatawrapperSwitcherPage.svelte'; +import DatawrapperSwitcherPage from './index.svelte'; document .querySelectorAll('[data-lab-components-embed="swr-sophora-components-datawrapper-switcher"]') diff --git a/sophora-components/src/pages/DatawrapperSwitcherPage.svelte b/sophora-components/src/routes/datawrapper-switcher/index.svelte similarity index 82% rename from sophora-components/src/pages/DatawrapperSwitcherPage.svelte rename to sophora-components/src/routes/datawrapper-switcher/index.svelte index 60eeef0..b97b5a5 100644 --- a/sophora-components/src/pages/DatawrapperSwitcherPage.svelte +++ b/sophora-components/src/routes/datawrapper-switcher/index.svelte @@ -1,6 +1,6 @@ diff --git a/sophora-components/src/entries/highlight-cards.ts b/sophora-components/src/routes/highlight-cards/entry.ts similarity index 74% rename from sophora-components/src/entries/highlight-cards.ts rename to sophora-components/src/routes/highlight-cards/entry.ts index f6db2b6..3ff1662 100644 --- a/sophora-components/src/entries/highlight-cards.ts +++ b/sophora-components/src/routes/highlight-cards/entry.ts @@ -1,5 +1,5 @@ import { mount } from 'svelte'; -import HighlightCardsPage from '../pages/HighlightCardsPage.svelte'; +import HighlightCardsPage from './index.svelte'; document .querySelectorAll('[data-lab-components-embed="swr-sophora-components-highlight-cards"]') diff --git a/sophora-components/src/pages/HighlightCardsPage.svelte b/sophora-components/src/routes/highlight-cards/index.svelte similarity index 83% rename from sophora-components/src/pages/HighlightCardsPage.svelte rename to sophora-components/src/routes/highlight-cards/index.svelte index eafc3ed..b840bab 100644 --- a/sophora-components/src/pages/HighlightCardsPage.svelte +++ b/sophora-components/src/routes/highlight-cards/index.svelte @@ -1,6 +1,6 @@ From c7b5f3a404a29537f6b052322bf9c8b43c8eb208 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Tue, 31 Mar 2026 16:23:27 +0200 Subject: [PATCH 11/26] Reduce boilerplate --- sophora-components/datawrapper-switcher.html | 13 +++++++++++-- sophora-components/highlight-cards.html | 13 +++++++++++-- sophora-components/index.html | 9 ++++++++- .../DatawrapperSwitcher.svelte | 0 .../datawrapper-switcher/embed.svelte} | 2 +- .../{ => highlight-cards}/HighlightCards.svelte | 0 .../highlight-cards/embed.svelte} | 2 +- .../src/{routes/app => }/index.svelte | 0 .../src/{ => lib}/shims/app-environment.ts | 0 sophora-components/src/lib/utils/mountEmbed.ts | 0 sophora-components/src/routes/app/entry.ts | 6 ------ .../src/routes/datawrapper-switcher/entry.ts | 8 -------- .../src/routes/highlight-cards/entry.ts | 8 -------- sophora-components/vite.config.ts | 2 +- 14 files changed, 33 insertions(+), 30 deletions(-) rename sophora-components/src/components/{ => datawrapper-switcher}/DatawrapperSwitcher.svelte (100%) rename sophora-components/src/{routes/datawrapper-switcher/index.svelte => components/datawrapper-switcher/embed.svelte} (82%) rename sophora-components/src/components/{ => highlight-cards}/HighlightCards.svelte (100%) rename sophora-components/src/{routes/highlight-cards/index.svelte => components/highlight-cards/embed.svelte} (83%) rename sophora-components/src/{routes/app => }/index.svelte (100%) rename sophora-components/src/{ => lib}/shims/app-environment.ts (100%) create mode 100644 sophora-components/src/lib/utils/mountEmbed.ts delete mode 100644 sophora-components/src/routes/app/entry.ts delete mode 100644 sophora-components/src/routes/datawrapper-switcher/entry.ts delete mode 100644 sophora-components/src/routes/highlight-cards/entry.ts diff --git a/sophora-components/datawrapper-switcher.html b/sophora-components/datawrapper-switcher.html index 6ef4b70..eb22b29 100644 --- a/sophora-components/datawrapper-switcher.html +++ b/sophora-components/datawrapper-switcher.html @@ -23,7 +23,16 @@ -
- +
+ diff --git a/sophora-components/highlight-cards.html b/sophora-components/highlight-cards.html index 5b0c793..1211ec0 100644 --- a/sophora-components/highlight-cards.html +++ b/sophora-components/highlight-cards.html @@ -23,7 +23,16 @@ -
- +
+ diff --git a/sophora-components/index.html b/sophora-components/index.html index c33f8d1..820e6da 100644 --- a/sophora-components/index.html +++ b/sophora-components/index.html @@ -24,6 +24,13 @@
- + diff --git a/sophora-components/src/components/DatawrapperSwitcher.svelte b/sophora-components/src/components/datawrapper-switcher/DatawrapperSwitcher.svelte similarity index 100% rename from sophora-components/src/components/DatawrapperSwitcher.svelte rename to sophora-components/src/components/datawrapper-switcher/DatawrapperSwitcher.svelte diff --git a/sophora-components/src/routes/datawrapper-switcher/index.svelte b/sophora-components/src/components/datawrapper-switcher/embed.svelte similarity index 82% rename from sophora-components/src/routes/datawrapper-switcher/index.svelte rename to sophora-components/src/components/datawrapper-switcher/embed.svelte index b97b5a5..30fd8be 100644 --- a/sophora-components/src/routes/datawrapper-switcher/index.svelte +++ b/sophora-components/src/components/datawrapper-switcher/embed.svelte @@ -1,6 +1,6 @@ diff --git a/sophora-components/src/components/HighlightCards.svelte b/sophora-components/src/components/highlight-cards/HighlightCards.svelte similarity index 100% rename from sophora-components/src/components/HighlightCards.svelte rename to sophora-components/src/components/highlight-cards/HighlightCards.svelte diff --git a/sophora-components/src/routes/highlight-cards/index.svelte b/sophora-components/src/components/highlight-cards/embed.svelte similarity index 83% rename from sophora-components/src/routes/highlight-cards/index.svelte rename to sophora-components/src/components/highlight-cards/embed.svelte index b840bab..3463a13 100644 --- a/sophora-components/src/routes/highlight-cards/index.svelte +++ b/sophora-components/src/components/highlight-cards/embed.svelte @@ -1,6 +1,6 @@ diff --git a/sophora-components/src/routes/app/index.svelte b/sophora-components/src/index.svelte similarity index 100% rename from sophora-components/src/routes/app/index.svelte rename to sophora-components/src/index.svelte diff --git a/sophora-components/src/shims/app-environment.ts b/sophora-components/src/lib/shims/app-environment.ts similarity index 100% rename from sophora-components/src/shims/app-environment.ts rename to sophora-components/src/lib/shims/app-environment.ts diff --git a/sophora-components/src/lib/utils/mountEmbed.ts b/sophora-components/src/lib/utils/mountEmbed.ts new file mode 100644 index 0000000..e69de29 diff --git a/sophora-components/src/routes/app/entry.ts b/sophora-components/src/routes/app/entry.ts deleted file mode 100644 index be17e8c..0000000 --- a/sophora-components/src/routes/app/entry.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { mount } from 'svelte'; -import IndexPage from './index.svelte'; - -mount(IndexPage, { - target: document.querySelector('[data-lab-components-embed="swr-sophora-components"]')! -}); diff --git a/sophora-components/src/routes/datawrapper-switcher/entry.ts b/sophora-components/src/routes/datawrapper-switcher/entry.ts deleted file mode 100644 index a330a2f..0000000 --- a/sophora-components/src/routes/datawrapper-switcher/entry.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { mount } from 'svelte'; -import DatawrapperSwitcherPage from './index.svelte'; - -document - .querySelectorAll('[data-lab-components-embed="swr-sophora-components-datawrapper-switcher"]') - .forEach((target) => { - mount(DatawrapperSwitcherPage, { target }); - }); diff --git a/sophora-components/src/routes/highlight-cards/entry.ts b/sophora-components/src/routes/highlight-cards/entry.ts deleted file mode 100644 index 3ff1662..0000000 --- a/sophora-components/src/routes/highlight-cards/entry.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { mount } from 'svelte'; -import HighlightCardsPage from './index.svelte'; - -document - .querySelectorAll('[data-lab-components-embed="swr-sophora-components-highlight-cards"]') - .forEach((target) => { - mount(HighlightCardsPage, { target }); - }); diff --git a/sophora-components/vite.config.ts b/sophora-components/vite.config.ts index 56f3f62..f31cf2c 100644 --- a/sophora-components/vite.config.ts +++ b/sophora-components/vite.config.ts @@ -15,7 +15,7 @@ export default defineConfig(({ mode }) => { enforce: 'pre', resolveId(id) { if (id === '$app/environment') { - return resolve(__dirname, 'src/shims/app-environment.ts'); + return resolve(__dirname, 'src/lib/shims/app-environment.ts'); } if (id.startsWith('@swr-data-lab/components/dist/')) { return resolve(__dirname, 'node_modules', id); From 778041326478a9d3ee0e095c7481e4b56c09a90d Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Tue, 31 Mar 2026 16:53:36 +0200 Subject: [PATCH 12/26] Remove debugger logging --- .../DatawrapperSwitcher.svelte | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/sophora-components/src/components/datawrapper-switcher/DatawrapperSwitcher.svelte b/sophora-components/src/components/datawrapper-switcher/DatawrapperSwitcher.svelte index 7538e28..ce0191c 100644 --- a/sophora-components/src/components/datawrapper-switcher/DatawrapperSwitcher.svelte +++ b/sophora-components/src/components/datawrapper-switcher/DatawrapperSwitcher.svelte @@ -11,15 +11,7 @@ let fixedHeight = $state(null); let layout = $state('auto'); - let url = $state(''); - let error = $state(null); - - console.log('DatawrapperSwitcher initialized with url:', url); - onMount(() => { - url = window.location.href; - console.log('DatawrapperSwitcher mounted with root:', root); - try { const entries = getDataFromUrl(root); labels = entries.labels?.split(',') || []; @@ -28,10 +20,7 @@ layout = entries.layout || 'auto'; } catch (e) { console.error(e); - error = e; } - - console.log('DatawrapperSwitcher props:', { labels, ids, fixedHeight, layout }); }); @@ -63,15 +52,6 @@ {/each} - -

Debug Information:

-

actual url: {url || 'n/a'}

-

data-url: {root?.parentNode?.parentNode?.dataset.url || 'n/a'}

-
-
{JSON.stringify({ labels, ids, fixedHeight, layout }, null, 2)}
- {#if error} -
{error}
- {/if} From 74df49f2a0f1a4b4b655010b7bfe307523ba68c0 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Tue, 31 Mar 2026 16:53:54 +0200 Subject: [PATCH 13/26] Move mounting of embeds to utility function --- sophora-components/datawrapper-switcher.html | 10 +++------- sophora-components/highlight-cards.html | 10 +++------- sophora-components/index.html | 2 +- sophora-components/src/lib/utils/mountEmbed.ts | 13 +++++++++++++ 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/sophora-components/datawrapper-switcher.html b/sophora-components/datawrapper-switcher.html index eb22b29..55f8630 100644 --- a/sophora-components/datawrapper-switcher.html +++ b/sophora-components/datawrapper-switcher.html @@ -25,14 +25,10 @@
diff --git a/sophora-components/highlight-cards.html b/sophora-components/highlight-cards.html index 1211ec0..c85a193 100644 --- a/sophora-components/highlight-cards.html +++ b/sophora-components/highlight-cards.html @@ -25,14 +25,10 @@
diff --git a/sophora-components/index.html b/sophora-components/index.html index 820e6da..3af3a71 100644 --- a/sophora-components/index.html +++ b/sophora-components/index.html @@ -26,7 +26,7 @@
From 136df97557526c2d182e2430aaefc3ed2d54bf73 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Wed, 1 Apr 2026 22:05:03 +0200 Subject: [PATCH 15/26] Add popstate handler --- sophora-components/datawrapper-switcher.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sophora-components/datawrapper-switcher.html b/sophora-components/datawrapper-switcher.html index d4762cb..c46b346 100644 --- a/sophora-components/datawrapper-switcher.html +++ b/sophora-components/datawrapper-switcher.html @@ -28,13 +28,21 @@ import { mountEmbed } from '/src/lib/utils/mountEmbed'; import Embed from '/src/components/datawrapper-switcher/embed.svelte'; - document.addEventListener('pjax:complete', () => { - console.log('pjax:complete, remounting datawrapper switcher embed'); + function mount() { + console.log('mounting datawrapper switcher embed'); mountEmbed('datawrapper-switcher', Embed); + } + + window.addEventListener('popstate', () => { + console.log('popstate, remounting datawrapper switcher embed'); + mount(); }); - console.log('DOM fully loaded, mounting datawrapper switcher embed'); - mountEmbed('datawrapper-switcher', Embed); + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', mount); + } else { + mount(); + } From b404424b6b40f296c7c913f45e93a37b3de7d291 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Wed, 1 Apr 2026 23:53:42 +0200 Subject: [PATCH 16/26] Expose mounting function via window object --- sophora-components/datawrapper-switcher.html | 21 +++++--------------- sophora-components/highlight-cards.html | 6 +++++- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/sophora-components/datawrapper-switcher.html b/sophora-components/datawrapper-switcher.html index c46b346..c2a8046 100644 --- a/sophora-components/datawrapper-switcher.html +++ b/sophora-components/datawrapper-switcher.html @@ -27,22 +27,11 @@ + diff --git a/sophora-components/highlight-cards.html b/sophora-components/highlight-cards.html index c85a193..346e227 100644 --- a/sophora-components/highlight-cards.html +++ b/sophora-components/highlight-cards.html @@ -28,7 +28,11 @@ import { mountEmbed } from '/src/lib/utils/mountEmbed'; import Embed from '/src/components/highlight-cards/embed.svelte'; - mountEmbed('highlight-cards', Embed); + window.__mountHighlightCards = () => mountEmbed('highlight-cards', Embed); + window.__mountHighlightCards(); + + From 2e02957f58c2d980f25e3e576a0f758fbe478905 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Thu, 2 Apr 2026 00:30:48 +0200 Subject: [PATCH 17/26] Use previous sibling as target, no more initialization loop --- sophora-components/datawrapper-switcher.html | 24 ++++++++++++++----- sophora-components/highlight-cards.html | 23 +++++++++++++----- .../src/lib/utils/mountEmbed.ts | 9 +++---- 3 files changed, 38 insertions(+), 18 deletions(-) diff --git a/sophora-components/datawrapper-switcher.html b/sophora-components/datawrapper-switcher.html index c2a8046..5bf7df3 100644 --- a/sophora-components/datawrapper-switcher.html +++ b/sophora-components/datawrapper-switcher.html @@ -24,14 +24,26 @@
+ - diff --git a/sophora-components/highlight-cards.html b/sophora-components/highlight-cards.html index 346e227..5a9f515 100644 --- a/sophora-components/highlight-cards.html +++ b/sophora-components/highlight-cards.html @@ -24,15 +24,26 @@
+ - diff --git a/sophora-components/src/lib/utils/mountEmbed.ts b/sophora-components/src/lib/utils/mountEmbed.ts index d0abc36..4ba01ae 100644 --- a/sophora-components/src/lib/utils/mountEmbed.ts +++ b/sophora-components/src/lib/utils/mountEmbed.ts @@ -2,12 +2,9 @@ import { mount } from 'svelte'; type ComponentConstructor = new (...args: any[]) => any; -export async function mountEmbed( - componentName: string, +export default async function mountEmbed( + target: Element, Component: ComponentConstructor ): Promise { - const selector = `[data-lab-components-embed="${componentName}"]`; - document.querySelectorAll(selector).forEach((target) => { - mount(Component, { target }); - }); + mount(Component, { target }); } From bf824517a8e9d1c906d8cf4b04cb1b3c6a1cc513 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Thu, 2 Apr 2026 08:04:44 +0200 Subject: [PATCH 18/26] Update DOM loaded handling --- sophora-components/datawrapper-switcher.html | 25 +++++++++++++------- sophora-components/highlight-cards.html | 16 ++++++------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/sophora-components/datawrapper-switcher.html b/sophora-components/datawrapper-switcher.html index 5bf7df3..3c40944 100644 --- a/sophora-components/datawrapper-switcher.html +++ b/sophora-components/datawrapper-switcher.html @@ -26,23 +26,30 @@
diff --git a/sophora-components/highlight-cards.html b/sophora-components/highlight-cards.html index 5a9f515..8ec3c14 100644 --- a/sophora-components/highlight-cards.html +++ b/sophora-components/highlight-cards.html @@ -25,16 +25,14 @@
From 8fb8f1c066de3b93f77f575d6f8b665eeb3b3cd6 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Thu, 2 Apr 2026 09:00:57 +0200 Subject: [PATCH 20/26] Add PJAX fallback for re-mounting embeds upon PJAX navigation --- sophora-components/datawrapper-switcher.html | 26 ++-------------- sophora-components/highlight-cards.html | 17 ++--------- .../src/lib/utils/mountEmbed.ts | 10 ------- .../src/lib/utils/mountEmbeds.ts | 30 +++++++++++++++++++ 4 files changed, 34 insertions(+), 49 deletions(-) delete mode 100644 sophora-components/src/lib/utils/mountEmbed.ts create mode 100644 sophora-components/src/lib/utils/mountEmbeds.ts diff --git a/sophora-components/datawrapper-switcher.html b/sophora-components/datawrapper-switcher.html index 8c9a5ae..a3c8160 100644 --- a/sophora-components/datawrapper-switcher.html +++ b/sophora-components/datawrapper-switcher.html @@ -25,32 +25,10 @@
diff --git a/sophora-components/highlight-cards.html b/sophora-components/highlight-cards.html index 8ec3c14..c3ec790 100644 --- a/sophora-components/highlight-cards.html +++ b/sophora-components/highlight-cards.html @@ -24,24 +24,11 @@
- diff --git a/sophora-components/src/lib/utils/mountEmbed.ts b/sophora-components/src/lib/utils/mountEmbed.ts deleted file mode 100644 index 4ba01ae..0000000 --- a/sophora-components/src/lib/utils/mountEmbed.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { mount } from 'svelte'; - -type ComponentConstructor = new (...args: any[]) => any; - -export default async function mountEmbed( - target: Element, - Component: ComponentConstructor -): Promise { - mount(Component, { target }); -} diff --git a/sophora-components/src/lib/utils/mountEmbeds.ts b/sophora-components/src/lib/utils/mountEmbeds.ts new file mode 100644 index 0000000..acaf8f7 --- /dev/null +++ b/sophora-components/src/lib/utils/mountEmbeds.ts @@ -0,0 +1,30 @@ +import { mount } from 'svelte'; +import type { SvelteComponent } from 'svelte'; + +export default async function mountEmbeds( + Component: typeof SvelteComponent, + targetSelector: string +): Promise { + const _mountEmbeds = () => { + console.log( + `Mounting components for selector: ${targetSelector}`, + document.querySelectorAll(targetSelector) + ); + document.querySelectorAll(targetSelector).forEach((target) => { + console.log(`Mounting individual component on target:`, target); + mount(Component, { target }); + }); + }; + + // Listen for PJAX navigation events to remount the component if needed + if (window.$) { + $(document).on('pjax:end', () => { + console.log('PJAX navigation detected (jQuery), remounting Datawrapper Switcher'); + _mountEmbeds(); + }); + } + + // Mount the components on initial load + console.log('Mounting Datawrapper Switcher on initial load'); + _mountEmbeds(); +} From 4a41d668675ecf8de9d8b34ef617408cf31942e3 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Thu, 2 Apr 2026 11:01:30 +0200 Subject: [PATCH 21/26] Defer initialization after PJAX navigation --- package-lock.json | 8 ++++ sophora-components/package.json | 1 + .../src/lib/utils/mountEmbeds.ts | 39 +++++++++++-------- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7497654..e1b5d13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6495,6 +6495,13 @@ "@types/istanbul-lib-report": "*" } }, + "node_modules/@types/jquery": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-4.0.0.tgz", + "integrity": "sha512-Z+to+A2VkaHq1DfI2oSwsoCdhCHMpTSgjWzNcbNlRGYzksDBpPUgEcAL+RQjOBJRaLoEAOHXxqDGBVP+BblBwg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -24980,6 +24987,7 @@ "@eslint/js": "^9.39.2", "@sveltejs/vite-plugin-svelte": "^6.2.4", "@swr-data-lab/components": "^2.43.0", + "@types/jquery": "^4.0.0", "@types/node": "^22", "eslint": "^9.39.2", "eslint-config-prettier": "^10.1.8", diff --git a/sophora-components/package.json b/sophora-components/package.json index 48f6d37..9572d60 100644 --- a/sophora-components/package.json +++ b/sophora-components/package.json @@ -17,6 +17,7 @@ "@eslint/js": "^9.39.2", "@sveltejs/vite-plugin-svelte": "^6.2.4", "@swr-data-lab/components": "^2.43.0", + "@types/jquery": "^4.0.0", "@types/node": "^22", "eslint": "^9.39.2", "eslint-config-prettier": "^10.1.8", diff --git a/sophora-components/src/lib/utils/mountEmbeds.ts b/sophora-components/src/lib/utils/mountEmbeds.ts index acaf8f7..60f0090 100644 --- a/sophora-components/src/lib/utils/mountEmbeds.ts +++ b/sophora-components/src/lib/utils/mountEmbeds.ts @@ -1,30 +1,37 @@ import { mount } from 'svelte'; import type { SvelteComponent } from 'svelte'; +declare global { + interface Window { + $?: unknown; + } +} + export default async function mountEmbeds( Component: typeof SvelteComponent, targetSelector: string ): Promise { - const _mountEmbeds = () => { - console.log( - `Mounting components for selector: ${targetSelector}`, - document.querySelectorAll(targetSelector) - ); - document.querySelectorAll(targetSelector).forEach((target) => { - console.log(`Mounting individual component on target:`, target); - mount(Component, { target }); - }); - }; + const _mountEmbeds = () => + (() => { + console.log( + `Mounting components for selector: ${targetSelector}`, + document.querySelectorAll(targetSelector) + ); + document.querySelectorAll(targetSelector).forEach((target) => { + console.log(`Mounting individual component on target:`, target); + mount(Component, { target }); + }); + })(); + + // Mount the components on initial load + console.log('Mounting Datawrapper Switcher on initial load'); + _mountEmbeds(); // Listen for PJAX navigation events to remount the component if needed if (window.$) { $(document).on('pjax:end', () => { - console.log('PJAX navigation detected (jQuery), remounting Datawrapper Switcher'); - _mountEmbeds(); + // Delay to ensure new DOM is ready before attempting to mount + setTimeout(() => _mountEmbeds(), 500); }); } - - // Mount the components on initial load - console.log('Mounting Datawrapper Switcher on initial load'); - _mountEmbeds(); } From 8301b31ab8b35c53c30180ee3c20c7fab857e7c7 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Thu, 2 Apr 2026 12:50:47 +0200 Subject: [PATCH 22/26] Remove debug logs and redundant styling --- sophora-components/datawrapper-switcher.html | 18 ------------------ sophora-components/highlight-cards.html | 18 ------------------ .../src/lib/utils/mountEmbeds.ts | 18 ++++++++---------- 3 files changed, 8 insertions(+), 46 deletions(-) diff --git a/sophora-components/datawrapper-switcher.html b/sophora-components/datawrapper-switcher.html index a3c8160..c3a9c18 100644 --- a/sophora-components/datawrapper-switcher.html +++ b/sophora-components/datawrapper-switcher.html @@ -3,24 +3,6 @@ - -
diff --git a/sophora-components/highlight-cards.html b/sophora-components/highlight-cards.html index c3ec790..23aabe0 100644 --- a/sophora-components/highlight-cards.html +++ b/sophora-components/highlight-cards.html @@ -3,24 +3,6 @@ - -
diff --git a/sophora-components/src/lib/utils/mountEmbeds.ts b/sophora-components/src/lib/utils/mountEmbeds.ts index 60f0090..99e9856 100644 --- a/sophora-components/src/lib/utils/mountEmbeds.ts +++ b/sophora-components/src/lib/utils/mountEmbeds.ts @@ -13,24 +13,22 @@ export default async function mountEmbeds( ): Promise { const _mountEmbeds = () => (() => { - console.log( - `Mounting components for selector: ${targetSelector}`, - document.querySelectorAll(targetSelector) - ); - document.querySelectorAll(targetSelector).forEach((target) => { - console.log(`Mounting individual component on target:`, target); + const embedTargets = document.querySelectorAll(targetSelector); + embedTargets.forEach((target) => { mount(Component, { target }); }); })(); - // Mount the components on initial load - console.log('Mounting Datawrapper Switcher on initial load'); + // Mount the embeds on initial page load _mountEmbeds(); - // Listen for PJAX navigation events to remount the component if needed + // SWR.dev uses PJAX and jQuery for client-side navigation, which replaces page content without a full reload. + // This means we need to re-mount the Svelte components after PJAX updates the DOM during client-side navigation. + // https://github.com/defunkt/jquery-pjax?tab=readme-ov-file#reinitializing-pluginswidget-on-new-page-content if (window.$) { $(document).on('pjax:end', () => { - // Delay to ensure new DOM is ready before attempting to mount + // Delay to ensure new DOM is ready for mounting. + // PJAX triggers 'pjax:end' before the mounting targets are actually available in the DOM. setTimeout(() => _mountEmbeds(), 500); }); } From 74e13fc15c110061bd0df09ef55043f4fc3be688 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Thu, 2 Apr 2026 13:41:15 +0200 Subject: [PATCH 23/26] Add log for validating mount cycle --- sophora-components/src/lib/utils/mountEmbeds.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sophora-components/src/lib/utils/mountEmbeds.ts b/sophora-components/src/lib/utils/mountEmbeds.ts index 99e9856..aca7cff 100644 --- a/sophora-components/src/lib/utils/mountEmbeds.ts +++ b/sophora-components/src/lib/utils/mountEmbeds.ts @@ -14,7 +14,8 @@ export default async function mountEmbeds( const _mountEmbeds = () => (() => { const embedTargets = document.querySelectorAll(targetSelector); - embedTargets.forEach((target) => { + embedTargets.forEach((target, index) => { + console.log(`>>> Mounting embed #${index} for target:`, target); mount(Component, { target }); }); })(); From 4c9124080b36b0989a94edacb6ad6b67cff1d23b Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Thu, 2 Apr 2026 16:40:30 +0200 Subject: [PATCH 24/26] Poll for DOM instead of simple setTimeout --- .../src/lib/utils/mountEmbeds.ts | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/sophora-components/src/lib/utils/mountEmbeds.ts b/sophora-components/src/lib/utils/mountEmbeds.ts index aca7cff..370222e 100644 --- a/sophora-components/src/lib/utils/mountEmbeds.ts +++ b/sophora-components/src/lib/utils/mountEmbeds.ts @@ -11,26 +11,41 @@ export default async function mountEmbeds( Component: typeof SvelteComponent, targetSelector: string ): Promise { - const _mountEmbeds = () => - (() => { - const embedTargets = document.querySelectorAll(targetSelector); - embedTargets.forEach((target, index) => { - console.log(`>>> Mounting embed #${index} for target:`, target); - mount(Component, { target }); - }); - })(); + const _mountEmbeds = (embedTargets: NodeListOf) => { + embedTargets.forEach((target) => { + target.innerHTML = ''; // Clear any existing content before mounting + mount(Component, { target }); + }); + }; // Mount the embeds on initial page load - _mountEmbeds(); + _mountEmbeds(document.querySelectorAll(targetSelector)); // SWR.dev uses PJAX and jQuery for client-side navigation, which replaces page content without a full reload. // This means we need to re-mount the Svelte components after PJAX updates the DOM during client-side navigation. // https://github.com/defunkt/jquery-pjax?tab=readme-ov-file#reinitializing-pluginswidget-on-new-page-content if (window.$) { $(document).on('pjax:end', () => { + let pollCount = 0; + const maxPolls = 10; + const pollInterval = 200; // ms + // Delay to ensure new DOM is ready for mounting. // PJAX triggers 'pjax:end' before the mounting targets are actually available in the DOM. - setTimeout(() => _mountEmbeds(), 500); + const interval = window.setInterval(() => { + pollCount++; + const embedTargets = document.querySelectorAll(targetSelector); + if (!embedTargets.length) return; + if (embedTargets.length > 0) { + _mountEmbeds(embedTargets); + window.clearInterval(interval); + console.log(`Mounting embeds succeeded after ${pollCount} polls.`); + } + if (pollCount > maxPolls) { + window.clearInterval(interval); + console.log(`Mounting embeds failed: targets not found after ${maxPolls} attempts.`); + } + }, pollInterval); }); } } From 54f5b5dd26529460521bae4c372a9ab24e8f9754 Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Thu, 2 Apr 2026 17:00:01 +0200 Subject: [PATCH 25/26] Simplify polling --- sophora-components/src/lib/utils/mountEmbeds.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sophora-components/src/lib/utils/mountEmbeds.ts b/sophora-components/src/lib/utils/mountEmbeds.ts index 370222e..8791c58 100644 --- a/sophora-components/src/lib/utils/mountEmbeds.ts +++ b/sophora-components/src/lib/utils/mountEmbeds.ts @@ -28,24 +28,21 @@ export default async function mountEmbeds( $(document).on('pjax:end', () => { let pollCount = 0; const maxPolls = 10; - const pollInterval = 200; // ms + const pollDelay = 200; // ms // Delay to ensure new DOM is ready for mounting. // PJAX triggers 'pjax:end' before the mounting targets are actually available in the DOM. const interval = window.setInterval(() => { - pollCount++; const embedTargets = document.querySelectorAll(targetSelector); - if (!embedTargets.length) return; if (embedTargets.length > 0) { _mountEmbeds(embedTargets); window.clearInterval(interval); console.log(`Mounting embeds succeeded after ${pollCount} polls.`); - } - if (pollCount > maxPolls) { + } else if (++pollCount >= maxPolls) { window.clearInterval(interval); console.log(`Mounting embeds failed: targets not found after ${maxPolls} attempts.`); } - }, pollInterval); + }, pollDelay); }); } } From 2cf07d10e567561e31e9ce993197f190085047ff Mon Sep 17 00:00:00 2001 From: Simon Jockers <449739+sjockers@users.noreply.github.com> Date: Thu, 2 Apr 2026 17:09:55 +0200 Subject: [PATCH 26/26] Remove logging, adjust delay --- sophora-components/src/lib/utils/mountEmbeds.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sophora-components/src/lib/utils/mountEmbeds.ts b/sophora-components/src/lib/utils/mountEmbeds.ts index 8791c58..fe803ef 100644 --- a/sophora-components/src/lib/utils/mountEmbeds.ts +++ b/sophora-components/src/lib/utils/mountEmbeds.ts @@ -26,9 +26,9 @@ export default async function mountEmbeds( // https://github.com/defunkt/jquery-pjax?tab=readme-ov-file#reinitializing-pluginswidget-on-new-page-content if (window.$) { $(document).on('pjax:end', () => { - let pollCount = 0; const maxPolls = 10; - const pollDelay = 200; // ms + const pollDelay = 300; // ms + let pollCount = 0; // Delay to ensure new DOM is ready for mounting. // PJAX triggers 'pjax:end' before the mounting targets are actually available in the DOM. @@ -37,10 +37,8 @@ export default async function mountEmbeds( if (embedTargets.length > 0) { _mountEmbeds(embedTargets); window.clearInterval(interval); - console.log(`Mounting embeds succeeded after ${pollCount} polls.`); } else if (++pollCount >= maxPolls) { window.clearInterval(interval); - console.log(`Mounting embeds failed: targets not found after ${maxPolls} attempts.`); } }, pollDelay); });