-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extend functionality of
usePortableText
- Loading branch information
Showing
21 changed files
with
329 additions
and
205 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
"astro-portabletext": minor | ||
--- | ||
|
||
Feat: `usePortableText(node)` utility function returns new properties and some have been deprecated. | ||
|
||
Refer to the `utils docs` for usage. | ||
|
||
**Added** | ||
|
||
| Property | Type | Description | | ||
| :------------------------------ | :--------- | :------------------------------------------------------------------------------------------------------------------------------- | | ||
| getDefaultComponent | `function` | Returns the `default` component related to the passed in `node`. Use this when you need to fall back to the `default` component. | | ||
| getUnknownComponent | `function` | Returns the counterpart `unknown(Block\|List\|ListItem\|Mark\|Type)` component related to the passed in `node`. | | ||
| notifyMissingComponentHandler | `function` | Calls `onMissingComponent` handler. Pass in a `string` to override `default` message. | | ||
|
||
**Deprecated** | ||
|
||
| Property | Type | Description | | ||
| :------------------------------ | :--------- | :------------------------------------------------------------------------------------------------------------------------------- | | ||
| next | `function` | Use `getDefaultComponent` | | ||
| onMissingComponent | `function` | Use `notifyMissingComponentHandler` | |
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.