Code Monkey home page Code Monkey logo

json-edit-react's People

Contributors

carlosnz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

json-edit-react's Issues

More sophisticated theming

Would like to extend it to have more potential control (e.g. being able to specify font weights and styles for each token), but without over-complicating the system.

Search functionality

I actually don't want to add any additional UI to the component itself, but I think it would be good to accept a "search" prop and then filter accordingly. I'd even handle the debouncing, so the external Search input can be pretty simple.

Error upon saving edited value

Getting this upon saving edited value

Uncaught (in promise) TypeError: Object(...) is not a function
    le index.esm.js:1
    onEdit index.esm.js:1
    v index.esm.js:1
    v index.esm.js:1
    onEdit index.esm.js:1
    L index.esm.js:1
    React 14
    unstable_runWithPriority scheduler.development.js:468
    React 4

the implementation

<JsonEditor
                   data={{ test: 1, test2: 2, test3: 3 }}
                    // enableClipboard={true}
                    // restrictEdit={false}
                    // restrictDelete={true}
                    // restrictAdd={true}
                    // restrictTypeSelection={true}
                    onEdit={(data)=>{
                             console.log(TAG,"OnEdit...");
                    }}
                    onUpdate={(data) => {
                           console.log(TAG, "OnUpdate :", data);
                    }}
 />

Localisation

Keep it simple, but should be able to pass a localised strings object to the component so English strings can be replaced.

Alternative line wrapping option for large arrays & small arrays

Rather than this:
Screenshot 2023-06-02 at 11 29 33 AM

Something like this would look better:

>hoursSchedule: [ 24 items
  0, 1, 2, 3, 4, 5, 6, 
  7, 8, 9, 10, 11, 12,
  13, 14, 15, 16, 17,
  18, 19, 20, 21, 22,
  23
]

Would affect both the collection layout and the JSON.stringify() display when editing, so not trivial to do nicely.

Similarly for "small" arrays, it would look nicer if they were all on one line.

Custom Nodes should still be able to use the standard editor

Currently, if you pass a custom node, it can no longer be edited using json-edit-react (you would have to integrate your own editor). We should make this an option, and when editing the contents will just be interpreted normally (i.e. as a string, boolean, etc.)

Edit object keys

Currently you have to just delete one, then make a new one with the same value. Direct editing of keys might be useful.

Custom Nodes

This is mainly just so I can build a UI for FigTreeEvaluator without having to start from scratch.

Idea is for this component to accept an additional prop, customNodes, which is an array of:

{
  condition: FilterFunction,
  component: React.Component
}

Then for any field in the json-edit-react data object, if the "condition" criteria is met, we return the "component", which handles its own internal logic for how to render and process the data field.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.