= [];
+ let visible_pages: number[] = [];
let current_hover = -1;
@@ -156,8 +156,14 @@
on:mouseleave={() => handle_mouseleave()}
>
{#each sample_row as { value, component }, j}
- {#if components[j] !== undefined && component_map[components[j]] !== undefined}
-
+ {@const component_name = components[j]}
+ {#if component_name !== undefined && component_map[component_name] !== undefined}
+ |
+ import { onMount } from "svelte";
import type { Value } from "../../Audio/types";
export let value: Value;
export let type: "gallery" | "table";
- export let selected: boolean = false;
+ export let selected = false;
+
+ let size: number;
+ let el: HTMLDivElement;
+
+ function set_styles(element: HTMLElement, el_width: number): void {
+ if (!element || !el_width) return;
+ el.style.setProperty(
+ "--local-text-width",
+ `${el_width < 150 ? el_width : 200}px`
+ );
+ el.style.whiteSpace = "unset";
+ }
+
+ onMount(() => {
+ set_styles(el, size);
+ });
|