leva icon indicating copy to clipboard operation
leva copied to clipboard

refactor(leva): export the InputContext

Open dineshsalunke opened this issue 2 years ago • 9 comments

In reference to this issue #265

In scenarios where some one wants to use leva as backbone with their own custom UI. We would need the InputContext to be exposed.

dineshsalunke avatar Nov 03 '21 14:11 dineshsalunke

⚠️ No Changeset found

Latest commit: ceaf9bcc3a5a9b3df1752ecbb52da1c4684f3027

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Nov 03 '21 14:11 changeset-bot[bot]

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pmndrs/leva/GJU4yZkNa15RcYXhjuWKW2Hqi2Xf
✅ Preview: https://leva-git-fork-dineshsalunke-expose-internals-pmndrs.vercel.app

vercel[bot] avatar Nov 03 '21 14:11 vercel[bot]

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ceaf9bcc3a5a9b3df1752ecbb52da1c4684f3027:

Sandbox Source
leva-minimal Configuration
leva-busy Configuration
leva-scroll Configuration
leva-advanced-panels Configuration
leva-ui Configuration
leva-theme Configuration
leva-transient Configuration
leva-plugin-plot Configuration
leva-plugin-bezier Configuration
leva-plugin-spring Configuration
leva-custom-plugin Configuration

codesandbox-ci[bot] avatar Nov 03 '21 14:11 codesandbox-ci[bot]

Could you add a file in the docs explaining how you'd go about consuming this?

gsimone avatar Nov 03 '21 15:11 gsimone

@gsimone I have added a doc page can you go through it once and let me know if there are any changes required

Note : I am not very good at writing docs, so please excuse me :D

dineshsalunke avatar Nov 03 '21 17:11 dineshsalunke

@dbismut what do you think about this?

gsimone avatar Nov 04 '21 08:11 gsimone

Would there be a way to see this PR in action?

At this point Leva development has a bit stalled, and ideally would need a major API refactor with that sorts of use cases in mind from the ground up (initially Leva was just supposed to be tweak pane built for React 😅).

dbismut avatar Nov 04 '21 09:11 dbismut

@dbismut Yes agreed we might need a lot of API changes if we want to make leva a more generalized or complicated UI library. But that's the thing I don't think we should make leva more generalized or complicated ( I love leva for its simplicity )

I don't feel leva should be more complicated and handle a lot of uses cases or support more features. But instead my thought is it should be just be a bit more extensible.

We are working on a lot of internal tools, for which we need a lot of menus but we just want to design our own UI and forget about rest of things and I think this is completely possible with leva only if we expose certain functionalities in certain ways.

We are internally working with leva and patching it with things which we need as and when we bump into requirements. We would be happy to share the changes that we are internally doing to make our use cases possible if there is some interest.

Infact I can open another PR with detailed plan and ideas on the work, if its ok

dineshsalunke avatar Nov 04 '21 13:11 dineshsalunke

Sorry for the late response ( We had biggest festival of india DIWALI ).

So HERE is a very quick thing I cooked up to show it in action and also an approach we are taking for certain this right now. There are things that could be cleaned up and well structured probably but this is what we could come up with for now

dineshsalunke avatar Nov 06 '21 12:11 dineshsalunke