stoplightio / json-schema-viewer

A JSON Schema viewer React component
Apache License 2.0
175 stars 37 forks source link

feat: add ability to Expand/Collapse All #260

Open weyert opened 3 months ago

weyert commented 3 months ago

Motivation and Context

Our documentation consumers wished to have the ability to quickly expand or collapse all the collapsible rows of the schema.

Description

This introduces a new property named showExpandAll (defaults to false) that display a button that allows to easily expand or collapse all rows.

The button shows up in both the breadcrumbs toolbar as above the top schema row.

Replace jotai related deprecated functions to the suggested new alternative functions to avoid the spamming of deprecation warnings in the developer console.

How Has This Been Tested?

This has been tested via fork of the component at work as part of our API reference documentation.

Screenshot(s)/recordings(s)

CleanShot 2024-07-26 at 19 01 49

Types of changes

Checklist

weyert commented 2 months ago

Any more changes needed?

weyert commented 1 month ago

Any news on this PR? Love to have it merged so I don't need mess around with a internal fork :)

john-tipper commented 2 weeks ago

What’s needed please to get this merged? We use this library as it’s brilliant but the deprecation warnings are killing our user monitoring and make the console unusable. We’d dearly like to not have to fork this internally - if there aren’t objections to this PR, please could we have this merged and released at the earliest opportunity?

lovekaizen commented 5 days ago

This library is awesome and has become an instrumental piece of a project at work. Unfortunately, we've had to fork simply to overcome these deprecation warnings, as they're quite noisy. Wondering what is needed to get this PR merged... or if it's OK to create a new PR reducing the scope of these changes to focus on updating the deprecated jotai methods, so that can be merged instead?

drjonnicholson commented 1 day ago

+1 for getting rid of the deprecation warnings. If ready please merge :)