Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/pages-editor/hooks/useReferenceTrail

Cockpit client (features), next. Source: ui/client/features/pages-editor/hooks/useReferenceTrail.tsx.

Type Aliases#

RootLoader#

RootLoader = (feature, file) => Promise<NavView>

Defined in: ui/client/features/pages-editor/hooks/useReferenceTrail.tsx:17

Reads the first view of a trail: a page of the editor (the default), or a file the Flow view drew.

Parameters#

feature

string

file

string

Returns#

Promise<NavView>

Functions#

useReferenceTrail()#

useReferenceTrail(feature, file, contentHash, loadRoot?): object

Defined in: ui/client/features/pages-editor/hooks/useReferenceTrail.tsx:55

Click-to-navigate for the Pages editor: the open page is the first step of a trail; following a resolved reference opens its file as the next step; Alt+Left / Alt+Right walk the trail. References are resolved by the server once per file render, so every reference this hands out either has a target or is never offered as a link.

Parameters#

feature

string

file

string

contentHash

string

loadRoot?

RootLoader = getNavPage

Returns#

object

back

back: () => void

Returns

void

current

current: TrailStep | null = step

error

error: string | null = state.error

follow

follow: (ref) => void

Parameters
ref

NavReference

Returns

void

forward

forward: () => void

Returns

void

hopError

hopError: string | null = state.hopError

index

index: number = trail.index

items

items: TrailItem[]

loading

loading: boolean = state.loading

openSource

openSource: (file, line, column) => void

Parameters
file

string

line

number | null

column

number | null

Returns

void

select

select: (index) => void

Parameters
index

number

Returns

void

steps

steps: TrailStep[] = trail.steps

unlinked

unlinked: object[]