Skip to content

Commit 54fc534

Browse files
committed
Tweaks
1 parent 32423d8 commit 54fc534

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

frontend/viewer/.storybook/decorators/FWLiteDecorator.svelte

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@
2525
import {InMemoryApiService} from '$lib/in-memory-api-service';
2626
import {setupServiceProvider} from '$lib/services/service-provider';
2727
import {setupDotnetServiceProvider} from '$lib/services/service-provider-dotnet';
28-
import {useEventBus} from '$lib/services/event-bus';
29-
import {Button, XButton} from '$lib/components/ui/button';
28+
import {XButton} from '$lib/components/ui/button';
3029
3130
let { children }: { children: Snippet } = $props();
3231
33-
3432
setupServiceProvider();
3533
setupDotnetServiceProvider();
36-
useEventBus();
3734
InMemoryApiService.setup();
3835
initView();
3936
const storyContext = useSvelteStoryContext();
@@ -43,13 +40,14 @@
4340
viewPicker = false,
4441
resizable = true,
4542
showValue = undefined,
43+
value: paramValue,
4644
} = storyContext.parameters.fwlite ?? {};
4745
48-
const value = $derived(storyContext.parameters.fwlite?.value ?? storyContext.args?.value);
46+
const value = $derived(paramValue ?? storyContext.parameters.fwlite?.value ?? storyContext.args?.value);
4947
5048
export const lineSeparator = '\u2028';
5149
52-
let hideValue = $state(false);
50+
let hideValue = $state(showValue !== true);
5351
</script>
5452

5553
<ResizablePaneGroup direction="horizontal" class="!overflow-visible">

frontend/viewer/.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {StorybookConfig} from '@storybook/svelte-vite';
33
const config: StorybookConfig = {
44
"stories": [
55
"../src/**/*.mdx",
6-
"../src/**/*.stories.@(js|ts|svelte)"
6+
"../src/**/*.stories.@(ts|svelte)"
77
],
88
"addons": [
99
"@storybook/addon-svelte-csf",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export type FwliteStoryParameters = {
2+
themePicker?: boolean,
3+
viewPicker?: boolean,
4+
resizable?: boolean,
5+
showValue?: boolean,
6+
value?: unknown,
7+
};
8+
9+
export function fwliteStoryParameters(params: Partial<FwliteStoryParameters>): {fwlite: FwliteStoryParameters} {
10+
return {fwlite: params};
11+
}

0 commit comments

Comments
 (0)