restructure $lib

This commit is contained in:
Ollie Taylor
2023-02-24 13:15:34 +00:00
parent 55c7448248
commit 29ee8f1763
12 changed files with 13 additions and 20 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ node_modules
/build /build
/.svelte-kit /.svelte-kit
/package /package
/dist
.env .env
.env.* .env.*
!.env.example !.env.example
@@ -10,4 +11,4 @@ node_modules
# Ignore files for PNPM, NPM and YARN # Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml pnpm-lock.yaml
package-lock.json package-lock.json
yarn.lock yarn.lock
@@ -4,9 +4,9 @@
__internal_audio_element, __internal_audio_element,
__internal_audio_metadata, __internal_audio_metadata,
__internal_audio_src, __internal_audio_src,
} from '$lib/components/audio/store'; } from '$lib/context/audio';
import type { PlayerElement } from '$lib/components/audio/types'; import { isBoolean, isNumber } from '$lib/types/type-guards';
import { isBoolean, isNumber } from '$lib/helper/check'; import type { PlayerElement } from '$lib/types/types';
let element: PlayerElement; let element: PlayerElement;
let currentTime = 0; let currentTime = 0;
@@ -72,5 +72,4 @@
__internal_audio_metadata.update((m) => ({ ...m, duration })); __internal_audio_metadata.update((m) => ({ ...m, duration }));
}} }}
/> />
<!-- <AudioA11yProgress {currentTime} {paused} {duration} /> -->
{/key} {/key}
-2
View File
@@ -1,2 +0,0 @@
export { default as AudioManager } from './audio.svelte';
export { audio } from './store';
@@ -1,6 +1,6 @@
import { dev } from '$app/environment'; import { dev } from '$app/environment';
import type { PlayerElement, PlayerMetadata } from '$lib/components/audio/types'; import type { PlayerElement, PlayerMetadata } from '$lib/types/types';
import { secondsToTimestamp } from '$lib/helper/seconds-to-timestamp'; import { secondsToTimestamp } from '$lib/utility/seconds-to-timestamp';
import clamp from 'just-clamp'; import clamp from 'just-clamp';
import { derived, writable } from 'svelte/store'; import { derived, writable } from 'svelte/store';
+2 -2
View File
@@ -1,2 +1,2 @@
// Reexport your entry components here export { default as AudioLoader } from '$lib/components/audio-loader.svelte';
export * from '$lib/components/audio'; export { audio } from '$lib/context/audio';
+2 -2
View File
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { AudioManager } from '$lib/components/audio'; import { AudioLoader } from '$lib';
</script> </script>
<AudioManager /> <AudioLoader />
<slot /> <slot />
+1 -1
View File
@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { audio } from '$lib/components/audio'; import { audio } from '$lib';
const sources = { const sources = {
syntax: '/example-syntax.mp3', syntax: '/example-syntax.mp3',
+1 -6
View File
@@ -1,10 +1,5 @@
<script lang="ts"> <script lang="ts">
import { audio } from '$lib/components/audio'; import { audio } from '$lib';
const sources = {
syntax: '/example-syntax.mp3',
knomii: '/example-knomii.mp3',
} as const;
let current_time = 0; let current_time = 0;
$: current_time = $audio.current_time; $: current_time = $audio.current_time;