-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Remove unused routes, cleanup data loading
- Loading branch information
Showing
49 changed files
with
325 additions
and
763 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 13 additions & 34 deletions
47
svelte-app/src/components/document/content/common/summary.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,19 @@ | ||
<script lang="ts"> | ||
import Heading from '$components/document/content/common/summary_old/heading.svelte'; | ||
import Items from '$components/document/content/common/summary_old/items.svelte'; | ||
import type { DocumentHeadings } from '$types'; | ||
export let headings: DocumentHeadings[], | ||
expanded = false; | ||
$: headingsExist = headings.length > 0; | ||
export let headings: DocumentHeadings[]; | ||
</script> | ||
|
||
<div class:expanded> | ||
<Heading {headingsExist} on:toggle={() => (expanded = !expanded)} /> | ||
{#if expanded} | ||
<Items {headings} {headingsExist} on:toggle={() => (expanded = !expanded)} /> | ||
{/if} | ||
<div class={$$props.class}> | ||
{#each headings as heading} | ||
<a | ||
href={`#${heading.key}`} | ||
class="focusOutline-sm block w-full select-none overflow-hidden text-ellipsis whitespace-nowrap rounded-sm py-2 text-base font-medium hover:text-accent-light dark:hover:text-accent-dark" | ||
> | ||
• {heading.text} | ||
</a> | ||
{#if heading.children?.length} | ||
<svelte:self headings={heading.children} class="ml-5" /> | ||
{/if} | ||
{/each} | ||
</div> | ||
|
||
<style lang="scss"> | ||
div { | ||
@apply rounded-sm border border-dark/40 bg-transparent transition-[background-color,border-color]; | ||
&:hover, | ||
&.expanded { | ||
@apply border-dark/60 bg-dark/[0.025]; | ||
} | ||
} | ||
:global(.dark) { | ||
div { | ||
@apply border-light/40; | ||
&:hover, | ||
&.expanded { | ||
@apply border-light/60 bg-light/5; | ||
} | ||
} | ||
} | ||
</style> |
19 changes: 0 additions & 19 deletions
19
svelte-app/src/components/document/content/common/summary/item.svelte
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
svelte-app/src/components/document/content/common/summary/items.svelte
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script lang="ts"> | ||
import { createEventDispatcher } from 'svelte'; | ||
import { linkTo } from '$i18n'; | ||
import Hoverable from '$components/hoverable.svelte'; | ||
let hovered: boolean; | ||
const dispatch = createEventDispatcher(), | ||
type = $$props.href ? 'a' : 'button'; | ||
$: link = $$props.href | ||
? $$props.href.startsWith('/') | ||
? $linkTo($$props.href) | ||
: $$props.href | ||
: undefined; | ||
</script> | ||
|
||
<Hoverable bind:hovered> | ||
<svelte:element | ||
this={type} | ||
href={link} | ||
target={$$props.newtab ? '_blank' : undefined} | ||
rel={$$props.newtab ? 'noopener noreferrer' : undefined} | ||
class="focusOutline-sm rounded-sm from-accent-light text-dark/90 underline decoration-accent-light underline-offset-[2px] dark:text-light dark:decoration-accent-dark {hovered | ||
? 'decoration-[3px]' | ||
: 'decoration-2'}" | ||
tabindex="0" | ||
on:click={() => dispatch('click')} | ||
on:keydown={(e) => { | ||
if (e.key === 'Enter') { | ||
dispatch('click'); | ||
} | ||
}} | ||
role={type === 'a' ? 'link' : 'button'} | ||
aria-label={$$props['aria-label']} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</svelte:element> | ||
</Hoverable> |
22 changes: 2 additions & 20 deletions
22
svelte-app/src/components/portable-text/serializers/custom-link.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,11 @@ | ||
<script lang="ts"> | ||
import { linkTo } from '$i18n'; | ||
import Hoverable from '$components/hoverable.svelte'; | ||
import Link from '$components/link.svelte'; | ||
import type { MarkComponentProps } from '@portabletext/svelte'; | ||
export let portableText: MarkComponentProps; | ||
let hovered: boolean; | ||
$: ({ value, plainTextContent } = portableText); | ||
$: href = value.href as string; | ||
$: newtab = !!value.newtab; | ||
</script> | ||
|
||
<Hoverable bind:hovered> | ||
<a | ||
href={href ? $linkTo(href) : '#'} | ||
target={newtab ? '_blank' : undefined} | ||
rel={newtab ? 'noopener noreferrer' : ''} | ||
class="focusOutline-sm rounded-sm from-accent-light text-dark/90 underline decoration-accent-light underline-offset-[2px] dark:text-light dark:decoration-accent-dark {hovered | ||
? 'decoration-[3px]' | ||
: 'decoration-2'}" | ||
tabindex="0" | ||
> | ||
{plainTextContent} | ||
</a> | ||
</Hoverable> | ||
<Link href={value.href} newtab={!!value.newtab}>{plainTextContent}</Link> |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.