Anvil/assets/Profile-AjlChAZK.js.map

1 line
9.7 KiB
Text
Raw Normal View History

2024-07-31 10:01:28 +02:00
{"version":3,"file":"Profile-AjlChAZK.js","sources":["../../src/lib/components/templates/Profile.svelte"],"sourcesContent":["<!--\nProfile template.\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 { _ } from 'svelte-i18n';\n\timport { Star16 } from 'svelte-octicons';\n\n\timport Avatar from '../atoms/Avatar.svelte';\n\timport BlockOrReport from '../atoms/BlockOrReport.svelte';\n\timport Created from '../atoms/Created.svelte';\n\timport DisplayName from '../atoms/DisplayName.svelte';\n\timport History from '../molecules/History.svelte';\n\timport MainMenu from '../molecules/MainMenu.svelte';\n\timport Project from '../molecules/Project.svelte';\n\n\t/**\n\t * Translation keys.\n\t */\n\tconst i18n = {\n\t\tbuttons: {\n\t\t\tfork: 'page.profile.projects.actions.fork',\n\t\t\tstar: 'page.profile.projects.actions.star',\n\t\t\twatch: 'page.profile.projects.actions.watch'\n\t\t},\n\t\theading: 'page.profile.heading'\n\t};\n\n\t/**\n\t * Required context for populating the template.\n\t * @type {*}\n\t */\n\texport let data = {\n\t\tlocale: '',\n\t\tuser: {\n\t\t\tavatar: '',\n\t\t\tcreated_at: null,\n\t\t\tcreated_with: '',\n\t\t\tdisplay_name: '',\n\t\t\tinstance: '',\n\t\t\tpronoun: '',\n\t\t\tusername: ''\n\t\t}\n\t};\n\n\t/**\n\t * Allow for linking stories in Storybook.\n\t */\n\texport let sb = '';\n\n\t/* Since I fetch collaborators for every following I need to filter. */\n\tconst mapCollaboratorsToMember = function (people, collaborators, associatedProject) {\n\t\tconst candidates = collaborators.filter((collaborator) => {\n\t\t\treturn collaborator.context === associatedProject;\n\t\t});\n\n\t\treturn candidates\n\t\t\t.map((candidate) => candidate.items)\n\t\t\t.map((members) => {\n\t\t\t\treturn people.find((person) => members.find((member) => person.id === member.object));\n\t\t\t})\n\t\t\t.flat(1);\n\t};\n</script>\n\n<div class=\"flex h-full w-full\">\n\t<aside class=\"w-[400px]\">\n\t\t<MainMenu />\n\t</aside>\n\t<main>\n\t\t<section class=\"w-full mx-auto flex px-8 pt-8\">\n\t\t\t<!-- Profile header -->\n\t\t\t<div>\n\t\t\t\t<Avatar avatar={data.user.avatar} displayName={data.user.display_name} />\n\t\t\t</div>\n\t\t\t<!-- Board -->\n\t\t\t<div class=\"flex flex-1 flex-col ps-8\">\n\t\t\t\t<div class=\"self-end\">\n\t\t\t\t\t<Created created_at={data.user.created_at} locale={data.locale} />\n\t\t\t\t\t<BlockOrReport />\n\t\t\t\t</div>\n\t\t\t\t<!-- Top Row -->\n\t\t\t\t<div class=\"flex mt-2\">\n\t\t\t\t\t<!-- Board -->\n\t\t\t\t\t<div class=\"flex flex-col flex-1 gap-2\">\n\t\t\t\t\t\t<div class=\"flex items-end\">\n\t\t\t\t\t\t\t<DisplayName\n\t\t\t\t\t\t\t\tdisplayName={data.user.display_name}\n\t\t\t\t\t\t\t\t{i18n}\n\t\t\t\t\t\t\t\tpronoun={data.user.pronoun}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class=\"leading-tight\">\n\t\t\t\t\t\t\t{data.user.username}@{data.user.instance}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<!-- Interaction Links -->\n\t\t\t\t\t<button type=\"button\" class=\"btn-icon border rounded-none self-start\">\n\t\t\t\t\t\t<Star16 fill=\"currentColor\" />\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</section>\n\t\t<section class=\"w-full h-full mx-auto flex flex-wrap mt-8 px-8\">\n\t\t\t<!-- Board -->\n\t\t\t<div class=\"flex flex-1 flex-col px-4\">\n\t\t\t\t<div class=\"space-y-6\">\n\t\t\t\t\t<h2 class=\"h2 font-s