diskfile_tabs.svelte.ts

Declarations
#

5 declarations

view source

DiskfileTabs
#

diskfile_tabs.svelte.ts view source

Manages tabs for diskfiles in the editor with preview behavior.

inheritance

extends:
  • Cell<typeof DiskfileTabsJson>

selected_tab_id

type Uuid | null

preview_tab_id

type Uuid | null

tab_order

type Array<Uuid>

recent_tab_ids

type Array<Uuid>

max_tab_history

type number

items

type IndexedCollection<DiskfileTab>

by_diskfile_id

Map for looking up tabs by their associated diskfile_id.

type Map<Uuid, DiskfileTab>

readonly

ordered_tabs

Ordered array of tabs derived directly from tab_order. Includes tabs in the explicit order plus any tabs not yet in the order.

type Array<DiskfileTab>

readonly

selected_tab

The currently selected tab.

type DiskfileTab | undefined

readonly

selected_diskfile_id

The selected tab's diskfile id.

type Uuid | null

readonly

preview_tab

The preview tab, if any.

type DiskfileTab | undefined

readonly

recent_tabs

type Array<DiskfileTab>

readonly

recently_closed_tabs

Recently closed tabs for potential reopening.

type Array<DiskfileTab>

closed_tab_diskfiles

Map of closed tab ids to their diskfile ids - used for browser navigation.

type SvelteMap<Uuid, Uuid>

readonly

constructor

type new (options: DiskfileTabsOptions): DiskfileTabs

options

find_most_recent_tab

Returns the most recently accessed tab id that still exists, excluding the specified tab id.

type (exclude_id: string & $brand<"Uuid">): (string & $brand<"Uuid">) | null

exclude_id
type string & $brand<"Uuid">
returns (string & $brand<"Uuid">) | null

select_tab

Sets the selected tab.

type (tab_id: string & $brand<"Uuid">): void

tab_id
type string & $brand<"Uuid">
returns void

preview_diskfile

Handles preview state when opening a file. If a preview tab for this file already exists, it just selects it.

type (diskfile_id: string & $brand<"Uuid">): DiskfileTab

diskfile_id
type string & $brand<"Uuid">
returns DiskfileTab

open_diskfile

Opens a diskfile as a permanent tab (not preview). If the file is already in a preview tab, promotes it to permanent.

type (diskfile_id: string & $brand<"Uuid">): DiskfileTab

diskfile_id
type string & $brand<"Uuid">
returns DiskfileTab

promote_preview_to_permanent

Promotes the current preview tab to a permanent tab.

type (): boolean

returns boolean

true if a tab was promoted, false otherwise

close_tab

Closes a tab by id.

type (tab_id: string & $brand<"Uuid">): void

tab_id
type string & $brand<"Uuid">
returns void

navigate_to_tab

Navigates to a tab by id. If the tab doesn't exist but was previously closed, creates a preview tab for that diskfile.

type (tab_id: string & $brand<"Uuid">): { resulting_tab_id: (string & $brand<"Uuid">) | null; created_preview: boolean; }

tab_id

The tab id to navigate to

type string & $brand<"Uuid">
returns { resulting_tab_id: (string & $brand<"Uuid">) | null; created_preview: boolean; }

Object containing the resulting tab id and a boolean indicating if a new tab was created

open_tab

Opens (makes permanent) a tab by id.

type (tab_id: string & $brand<"Uuid">): void

tab_id
type string & $brand<"Uuid">
returns void

reorder_tabs

Reorders tabs by dragging.

type (from_index: number, to_index: number): void

from_index
type number
to_index
type number
returns void

reopen_last_closed_tab

Reopens the last closed tab.

type (): void

returns void

close_all_tabs

Closes all tabs.

type (): void

returns void

DiskfileTabsJson
#

diskfile_tabs.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; ... 5 more ...; max_tab_history: ZodDefault<...>; }, $strict>

DiskfileTabsJsonInput
#

diskfile_tabs.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; selected_tab_id?: string | null | undefined; preview_tab_id?: string | null | undefined; tab_order?: string[] | undefined; recent_tab_ids?: string[] | undefined; max_tab_history?: number | undefined; }

DiskfileTabsOptions
#

DiskfileTabsSchema
#

Depends on
#

Imported by
#