Skip to content

Commit

Permalink
breaking: rename syv -> dialog (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb authored Sep 3, 2024
1 parent bf76052 commit e230864
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/lib/syv.ts → src/lib/core/dialog.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ComponentProps, ComponentType, SvelteComponent } from 'svelte';
import type { Demand, LazyComponent, SyvOptions } from './types.js';
import type { Demand, LazyComponent, SyvOptions } from '../types.js';
import { mount as create, unmount } from 'svelte';

let instance: ReturnType<typeof create>;
Expand Down
3 changes: 1 addition & 2 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * as syv from './syv.js';

export * as dialog from './core/dialog.js';
export * as tooltip from './core/tooltip.js';
27 changes: 6 additions & 21 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import { syv as core } from '$lib';
import LazyLoad from '$lib/core/LazyLoad.svelte';
import { dialog } from '$lib';
import SearchBar from '$lib/core/SearchBar.svelte';
import Empty from './Empty.svelte';
Expand All @@ -13,20 +12,6 @@
</script>

<main use:outside={() => {}}>
<LazyLoad
files={[() => import('./ExampleDialog.svelte'), () => import('$lib/core/ScrollTop.svelte')]}
>
{#snippet children([
Example,
Scroll,
// @ts-expect-error
Yeah,
])}
<Example required={false} />
<Scroll />
{/snippet}
</LazyLoad>

<SearchBar items={[]} sieve={() => true} />

<textarea bind:value use:autoresize></textarea>
Expand All @@ -35,20 +20,20 @@

<button
onclick={() => {
core.mount(Empty);
dialog.mount(Empty);
// @ts-expect-error
core.mount(ExampleDialog);
core.mount(ExampleDialog, {
dialog.mount(ExampleDialog);
dialog.mount(ExampleDialog, {
required: true,
// @ts-expect-error
error: false,
});
core.load(import('./ExampleDialog.svelte'), {
dialog.load(import('./ExampleDialog.svelte'), {
required: true,
// @ts-expect-error
error: false,
});
core.load(() => import('./ExampleDialog.svelte'), {
dialog.load(() => import('./ExampleDialog.svelte'), {
required: true,
// @ts-expect-error
error: false,
Expand Down
18 changes: 18 additions & 0 deletions src/routes/Typecheck.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script lang="ts">
import LazyLoad from '$lib/core/LazyLoad.svelte';
</script>

<LazyLoad
when={false}
files={[() => import('./ExampleDialog.svelte'), () => import('$lib/core/ScrollTop.svelte')]}
>
{#snippet children([
Example,
Scroll,
// @ts-expect-error
Yeah,
])}
<Example required={false} />
<Scroll />
{/snippet}
</LazyLoad>

0 comments on commit e230864

Please sign in to comment.