You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/website/docs/extending/plugin-api.mdx
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,13 +91,17 @@ Returns a callback that clears the current selection. Use this when a plugin flo
91
91
92
92
### `useSelectedSource()`
93
93
94
-
Returns the currently selected `ComponentSource | null`. This is a convenience for accessing just the source location.
94
+
Returns the currently selected `ComponentSource | null`. Each source includes source-mapped file coordinates and pre-computed project-relative and absolute paths.
95
95
96
96
```ts
97
97
interfaceComponentSource {
98
98
fileName:string
99
99
lineNumber:number
100
100
columnNumber:number
101
+
/** Path relative to the project root, e.g. "src/App.tsx" */
102
+
relativePath:string
103
+
/** Absolute filesystem path, e.g. "/Users/you/project/src/App.tsx" */
104
+
absolutePath:string
101
105
}
102
106
```
103
107
@@ -121,26 +125,23 @@ function MyToolbarButton() {
0 commit comments