ui/client/features/pages-editor/hooks/useLinkedCode
Cockpit client (features), v0.8. Source: ui/client/features/pages-editor/hooks/useLinkedCode.tsx.
Type Aliases#
LinkHover#
LinkHover =
object
Defined in: ui/client/features/pages-editor/hooks/useLinkedCode.tsx:8
Properties#
ref
ref:
NavReference
Defined in: ui/client/features/pages-editor/hooks/useLinkedCode.tsx:8
x
x:
number
Defined in: ui/client/features/pages-editor/hooks/useLinkedCode.tsx:8
y
y:
number
Defined in: ui/client/features/pages-editor/hooks/useLinkedCode.tsx:8
Functions#
useLinkedCode()#
useLinkedCode(
source,references,onFollow):object
Defined in: ui/client/features/pages-editor/hooks/useLinkedCode.tsx:13
Link behaviour for the read-only code view: the segments (only resolved references carry a ref), whether Ctrl/Cmd is held (links draw solid), the hover label, and the open gestures. A plain click keeps its meaning (it does not navigate); Ctrl/Cmd-click and Enter on a focused link open.
Parameters#
source
string
references
onFollow
(ref) => void
Returns#
object
hideTip
hideTip: () =>
void
Returns
void
hover
hover:
LinkHover|null
modifierHeld
modifierHeld:
boolean
onLinkClick
onLinkClick: (
e,ref) =>void
Parameters
e
MouseEvent<HTMLElement>
ref
Returns
void
onLinkKeyDown
onLinkKeyDown: (
e,ref) =>void
Parameters
e
KeyboardEvent<HTMLElement>
ref
Returns
void
segments
segments:
CodeSegment[]
showTip
showTip: (
ref,el) =>void
Parameters
ref
el
HTMLElement
Returns
void