Anvil/assets/Settings.stories-hDTrwO1R.js.map
André Jaenisch dd106117c6
Updates
2024-08-08 10:16:25 +02:00

1 line
No EOL
4.5 KiB
Text

{"version":3,"file":"Settings.stories-hDTrwO1R.js","sources":["../../src/lib/components/molecules/Settings.svelte","../../stories/molecules/Settings.stories.ts"],"sourcesContent":["<!--\nSettings molecule.\nCopyright (C) 2024 André Jaenisch\nSPDX-FileCopyrightText: 2024 André Jaenisch\nSPDX-License-Identifier: AGPL-3.0-or-later\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<script>\n\timport SettingsAccount from './SettingsAccount.svelte';\n\timport SettingsAppearance from './SettingsAppearance.svelte';\n\timport SettingsKeys from './SettingsKeys.svelte';\n\timport SettingsSidebar from '../atoms/SettingsSidebar.svelte';\n\timport SettingsProfile from './SettingsProfile.svelte';\n\n\tlet activeSetting = 'profile';\n let activeTheme = 'auto';\n\n\tfunction onTileChanged(ev) {\n\t\tactiveSetting = ev.detail;\n\t}\n\n function onThemeSwitched(ev) {\n activeTheme = ev.detail\n // This is a hack.\n // Skeleton relies on Cookies and a hook:\n // https://github.com/skeletonlabs/skeleton/blob/%40skeletonlabs/skeleton%402.10.2/sites/skeleton.dev/src/hooks.server.ts#L16\n // Svelte itself features a svelte:document special element that must\n // only be used at the top level - except SvelteKit has app.html\n // as a static file :[]\n // Ideas welcome!\n if (window?.document?.documentElement) {\n window.document.documentElement.classList.remove('auto')\n window.document.documentElement.classList.remove('dark')\n window.document.documentElement.classList.remove('light')\n window.document.documentElement.classList.add(activeTheme)\n }\n }\n</script>\n\n<div class=\"flex bg-surface-50 min-h-[900px]\">\n\t<SettingsSidebar on:switch-settings={onTileChanged} />\n\n\t{#if activeSetting === 'profile'}\n\t\t<SettingsProfile />\n\t{:else if activeSetting === 'account'}\n\t\t<SettingsAccount />\n\t{:else if activeSetting === 'ssh_gpg_keys'}\n\t\t<SettingsKeys />\n\t{:else if activeSetting === 'appearance'}\n\t\t<SettingsAppearance on:switch-theme={onThemeSwitched} />\n\t{/if}\n</div>\n","/* Stories for Settings molecule.\n * Copyright (C) 2024 André Jaenisch\n * SPDX-FileCopyrightText: 2024 André Jaenisch\n * SPDX-License-Identifier: AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport type { Meta, StoryObj } from '@storybook/svelte';\n\nimport Settings from '$lib/components/molecules/Settings.svelte';\n\nconst meta = {\n\ttitle: 'Molecules/Settings',\n\tcomponent: Settings,\n\ttags: ['autodocs']\n} satisfies Meta<Settings>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const Plain: Story = {};\n"],"names":["onThemeSwitched","ev","cov_ykccop8c","f","s","activeTheme","detail","window","document","documentElement","b","meta","title","component","Settings","tags","Plain","parameters","docs","source","originalSource"],"mappings":"u56BAeQ,SAAAA,EAAkBC,EAAMC,OAAAA,EAAA,EAAAC,EAAA,EAAA,IAAAD,EAAA,EAAAE,EACxBC,GAAAA,IAAAA,IAAkBC,OAuCaC,EAAAA,EAAAA,EAAAA,GAAAA,KAAAA,EAAAA,2BAAAC,WAAAD,MAAAA,EAAAE,iBAAAP,EAAA,EAAAQ,EAAA,EAAA,EAAA,CAAA,IAAAR,EAAAE,EAAAA,4jBCvCvC,MAAMO,GAAO,CACTC,MAAO,qBACPC,UAAWC,EACXC,KAAM,CAAC,UAAQ,CACnB,EAKaC,EAAe,CAAC,YAAEA,EAAAC,WAAA,CAAA,GAAAD,EAAAC,WAAAC,KAAA,CAAA,IAAAF,EAAAA,EAAAC,aAAAD,YAAAA,EAAAE,KAAAC,OAAA,CAAAC,eAAA,KAAA,IAAAJ,GAAAA,EAAAA,EAAAC,aAAAD,YAAAA,EAAAE,OAAAF,YAAAA,EAAAG,MAAA,CAAA,CAAA"}