# @embedpdf/svelte — ./toolbar BarChild [TypeAliasDeclaration] (from packages/core/ui/src/schema.ts): export type BarChild = BarItem | CustomItem | string; BarGroup [InterfaceDeclaration] (from packages/core/ui/src/schema.ts): export interface BarGroup{ readonly id: string; readonly labelKey?: string; readonly role?: 'buttons' | 'tabs'; readonly shed?: boolean; readonly collapse?: 'menu' | 'select'; readonly importance?: Importance; readonly dependent?: boolean; readonly items: readonly BarChild[]; } BarItem [InterfaceDeclaration] (from packages/core/ui/src/schema.ts): export interface BarItem{ readonly command: string; readonly variants?: readonly Variant[]; readonly importance?: Importance; readonly emphasis?: Emphasis; } BarSchema [InterfaceDeclaration] (from packages/core/ui/src/schema.ts): export interface BarSchema{ readonly id: string; readonly sections: BarSections; } BarSections [InterfaceDeclaration] (from packages/core/ui/src/schema.ts): export interface BarSections{ readonly start?: readonly BarGroup[]; readonly center?: readonly BarGroup[]; readonly end?: readonly BarGroup[]; } CollapsedGroupView [TypeAliasDeclaration] (from packages/framework/svelte/src/toolbar/views.ts): export type CollapsedGroupView = CollapsedGroupViewOf; CustomItem [InterfaceDeclaration] (from packages/core/ui/src/schema.ts): export interface CustomItem{ readonly slot: string; readonly variants?: readonly string[]; readonly terminal?: string; readonly importance?: Importance; readonly grow?: boolean; } CustomSlotContext [InterfaceDeclaration] (from packages/core/ui/src/toolbar-layout.ts): export interface CustomSlotContext{ layer: 'live' | 'measure'; measure: (length: number) => void; } DEFAULT_IMPORTANCE [VariableDeclaration] (from packages/core/ui/src/schema.ts): DEFAULT_IMPORTANCE: Importance = 3 GroupDisclosureView [TypeAliasDeclaration] (from packages/framework/svelte/src/toolbar/views.ts): export type GroupDisclosureView = GroupDisclosureViewOf; Importance [TypeAliasDeclaration] (from packages/core/ui/src/schema.ts): export type Importance = 1 | 2 | 3 | 4 | 5; OverflowMenuView [TypeAliasDeclaration] (from packages/framework/svelte/src/toolbar/views.ts): export type OverflowMenuView = OverflowMenuViewOf; OverflowRow [TypeAliasDeclaration] (from packages/core/ui/src/projection.ts): export type OverflowRow = |{ readonly kind: 'command'; readonly command: string} |{ readonly kind: 'submenu'; readonly command: string; readonly menu: string} ; OverflowSection [InterfaceDeclaration] (from packages/core/ui/src/projection.ts): export interface OverflowSection{ readonly labelKey?: string; readonly role?: 'radio'; readonly rows: readonly OverflowRow[]; } PINNED [VariableDeclaration] (from packages/core/ui/src/schema.ts): PINNED: Importance = 5 StripView [TypeAliasDeclaration] (from packages/framework/svelte/src/toolbar/strip.svelte.ts): export type StripView = StripViewOf; StripViewGroup [TypeAliasDeclaration] (from packages/framework/svelte/src/toolbar/strip.svelte.ts): export type StripViewGroup = StripViewGroupOf; Toolbar [SvelteComponent] (from packages/framework/svelte/src/toolbar/Toolbar.svelte): props ToolbarProps; defaults { orientation: 'horizontal', gap: 8, separatorWidth: 1} ToolbarProps [InterfaceDeclaration] (from packages/framework/svelte/src/toolbar/props.ts): export interface ToolbarProps{ bar: BarSchema; orientation?: 'horizontal' | 'vertical'; gap?: number; separatorWidth?: number; 'aria-label'?: string; class?: string; style?: string; command?: Snippet<[command: ResolvedCommand, variant: string, run: () => void]>; custom?: Snippet<[name: string, variant: string, ctx: CustomSlotContext]>; collapsed?: Snippet<[view: CollapsedGroupView]>; groupTrigger?: Snippet<[view: GroupDisclosureView]>; separator?: Snippet; overflowTrigger?: Snippet<[isOpen: boolean, toggle: () => void]>; overflowMenu?: Snippet<[view: OverflowMenuView]>; } Variant [TypeAliasDeclaration] (from packages/core/ui/src/schema.ts): export type Variant = 'icon+label' | 'icon' | 'label'; custom [FunctionDeclaration] (from packages/core/ui/src/schema.ts): export function custom( slot: string, terminal?: string, options?: Omit, ): CustomItem{ return terminal === undefined ?{ slot, ...options} :{ slot, terminal, ...options} ; } group [FunctionDeclaration] (from packages/core/ui/src/schema.ts): export function group( id: string, items: readonly BarChild[], options?: Omit, ): BarGroup{ return{ id, ...options, items} ; } item [FunctionDeclaration] (from packages/core/ui/src/schema.ts): export function item(command: string, options?: Omit): BarItem{ return{ command, ...options} ; } useStripView [FunctionDeclaration] (from packages/framework/svelte/src/toolbar/strip.svelte.ts): export function useStripView( bar: MaybeGetter, ): CurrentValue{ const commands = useCapability(CommandsToken); const documentId = useDocumentId(); const normalized = $derived.by(() =>{ const schema = valueOf(bar); return schema ? normalizeBar(schema) : null; } ); const groups = useKernelValue( () => normalized ? stripGroupsOf(normalized, (id) => commands.resolveCommand(id, documentId.current ?? undefined), ) : NO_GROUPS, sameGroups, ); return currentOf( derivedValue(() => groups.current.length === 0 ? null :{ groups: groups.current, execute: (id: string) => void commands.execute(id, { documentId: documentId.current ?? undefined} ), } , ), ); }