Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support editor input/data definitions in structure.json #95

Closed
steve2507 opened this issue May 6, 2021 · 0 comments
Closed

Support editor input/data definitions in structure.json #95

steve2507 opened this issue May 6, 2021 · 0 comments
Assignees
Milestone

Comments

@steve2507
Copy link
Contributor

steve2507 commented May 6, 2021

The node editor contents are mostly used to expose input fields to store in the flow, being consumed by the node.data map.
This could be made much simpler for nodepack developers, by simply allowing a similar structure to be added to the structure.json;

{
  "name": "my-node",
  "dataStructure": {
    "my-data-field": {
      "type": "text", // text, textarea, password, select, checkbox, number
      "required": true,
      "placeholder": "my input", // optional
      "label": "some label",  // optional, refer to placeholder || editorData[x]
      "options": [], // only applies to type=select
      "pattern": "$.*?regex" // optional
      "min": 0, // optional, only applies to type=number
      "max": 10, // optional, only applies to type=number
      "minlength": 1, // optional, only applies to type=text, password
      "maxlength": 2 // optional, only applies to type=text, password
    }
  }
}

In the example above, the field value would be accessible in the node through NODE.data['my-data-field']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant