-
-
Notifications
You must be signed in to change notification settings - Fork 703
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add navRoot to the equation, this enables Add form correct checks, an…
…d Slots under that route.
- Loading branch information
Showing
9 changed files
with
236 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { Content } from '../content'; | ||
|
||
export type SlotPredicate = (args: any) => boolean; | ||
|
||
export type GetSlotArgs = { | ||
content: Content; | ||
pathname: string; | ||
navRoot?: Content; | ||
}; | ||
|
||
export type GetSlotReturn = | ||
| { component: SlotComponent['component']; name: string }[] | ||
| undefined; | ||
|
||
export type SlotComponent = { | ||
component: React.ComponentType<any>; | ||
predicates?: SlotPredicate[]; | ||
}; | ||
|
||
export type SlotManager = { | ||
slots: string[]; | ||
data: Record<string, SlotComponent[]>; | ||
}; | ||
|
||
export type SlotsConfig = Record<string, SlotManager>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.