From 24648e8e4399de0d346b09a49a8780344cb2347b Mon Sep 17 00:00:00 2001 From: kiosion Date: Fri, 9 Feb 2024 08:47:47 -0500 Subject: [PATCH] chore: Clean up utils, helpers, PT serializer props --- svelte-app/src/components/code-block.svelte | 2 +- .../controls/language-toggle.svelte | 2 +- .../components/controls/theme-toggle.svelte | 2 +- .../components/document/content/footer.svelte | 4 +- .../components/document/content/header.svelte | 10 +-- .../src/components/document/route.svelte | 4 +- .../src/components/empty-content.svelte | 2 +- svelte-app/src/components/footer.svelte | 2 +- svelte-app/src/components/header.svelte | 2 +- svelte-app/src/components/icon.svelte | 2 +- svelte-app/src/components/images/image.svelte | 2 +- svelte-app/src/components/link.svelte | 2 +- .../src/components/lists/list-item.svelte | 12 ++-- .../src/components/lists/year-list.svelte | 2 +- .../src/components/nav/base-link.svelte | 2 +- .../src/components/nav/header-link.svelte | 2 +- .../components/portable-text/footnote.svelte | 2 +- .../portable-text/portable-text.svelte | 4 +- .../serializers/custom-highlight.svelte | 8 +++ .../serializers/custom-paragraph.svelte | 8 +++ .../serializers/custom-quote.svelte | 8 +++ .../portable-text/serializers/divider.svelte | 6 ++ .../serializers/list-item.svelte | 8 +++ .../serializers/null-mark.svelte | 8 +++ .../portable-text/serializers/ol-item.svelte | 8 +++ .../serializers/ol-wrapper.svelte | 8 +++ .../serializers/ul-wrapper.svelte | 8 +++ svelte-app/src/lib/data.ts | 21 ++++++ svelte-app/src/lib/date.ts | 63 +++++++++++++++++- svelte-app/src/lib/helpers/date.ts | 64 ------------------- svelte-app/src/lib/helpers/emoji.ts | 17 ----- svelte-app/src/lib/helpers/scrollTo.ts | 19 ------ svelte-app/src/lib/{helpers => }/i18n.ts | 0 .../src/lib/{helpers => }/navigation.ts | 25 +++++++- .../src/lib/{helpers => }/responsive.ts | 0 .../src/lib/{helpers/image.ts => sanity.ts} | 0 svelte-app/src/lib/store.ts | 2 +- svelte-app/src/lib/try-fetch.ts | 21 ------ svelte-app/src/lib/utils.ts | 40 ++++++++++++ svelte-app/src/lib/views.ts | 21 ------ svelte-app/src/routes/+error.svelte | 2 +- svelte-app/src/routes/+layout.svelte | 2 +- .../src/routes/[[lang=lang]]/+page.svelte | 4 +- .../routes/[[lang=lang]]/blog/+page.svelte | 4 +- .../src/routes/[[lang=lang]]/etc/+page.svelte | 4 +- .../routes/[[lang=lang]]/work/+page.svelte | 4 +- .../routes/[[lang=lang]]/work/[slug]/+page.ts | 2 +- svelte-app/svelte.config.js | 11 ++-- svelte-app/tests/unit/i18n.test.ts | 2 +- svelte-app/tsconfig.json | 20 ------ 50 files changed, 265 insertions(+), 213 deletions(-) delete mode 100644 svelte-app/src/lib/helpers/date.ts delete mode 100644 svelte-app/src/lib/helpers/emoji.ts delete mode 100644 svelte-app/src/lib/helpers/scrollTo.ts rename svelte-app/src/lib/{helpers => }/i18n.ts (100%) rename svelte-app/src/lib/{helpers => }/navigation.ts (51%) rename svelte-app/src/lib/{helpers => }/responsive.ts (100%) rename svelte-app/src/lib/{helpers/image.ts => sanity.ts} (100%) delete mode 100644 svelte-app/src/lib/try-fetch.ts create mode 100644 svelte-app/src/lib/utils.ts delete mode 100644 svelte-app/src/lib/views.ts diff --git a/svelte-app/src/components/code-block.svelte b/svelte-app/src/components/code-block.svelte index 145e46c89..0f36dd3a6 100644 --- a/svelte-app/src/components/code-block.svelte +++ b/svelte-app/src/components/code-block.svelte @@ -2,8 +2,8 @@ import { onDestroy, onMount } from 'svelte'; import { browser } from '$app/environment'; - import { t } from '$i18n'; import { BASE_ANIMATION_DURATION } from '$lib/consts'; + import { t } from '$lib/i18n'; import Settings from '$lib/settings'; import { genericAsyncImport, getLangType } from '$components/code-block/imports'; diff --git a/svelte-app/src/components/controls/language-toggle.svelte b/svelte-app/src/components/controls/language-toggle.svelte index 5a3e42690..6109e247c 100644 --- a/svelte-app/src/components/controls/language-toggle.svelte +++ b/svelte-app/src/components/controls/language-toggle.svelte @@ -1,8 +1,8 @@ diff --git a/svelte-app/src/components/footer.svelte b/svelte-app/src/components/footer.svelte index c2993f199..493586707 100644 --- a/svelte-app/src/components/footer.svelte +++ b/svelte-app/src/components/footer.svelte @@ -1,6 +1,6 @@ + diff --git a/svelte-app/src/components/portable-text/serializers/custom-paragraph.svelte b/svelte-app/src/components/portable-text/serializers/custom-paragraph.svelte index 8f72b2fc4..328f49e03 100644 --- a/svelte-app/src/components/portable-text/serializers/custom-paragraph.svelte +++ b/svelte-app/src/components/portable-text/serializers/custom-paragraph.svelte @@ -1,3 +1,11 @@ + +