Open Schlipak opened 2 years ago
Draft for the new JSON format
{
"version": "1.0.0",
"form_id": "WORDPRESS_POST_ID",
"fields": [],
}
Field data should follow a similar structure structure :
{
"type": "FIELD_TYPE_IDENTIFIER",
"id": "FIELD_UUID",
"rect": {
"default": { "x": 0, "y": 0, "w": 1, "h": 1 },
"breakpoints": [
{ "above": "@media min-width", "below": "@media max-width", "x": 0, "y": 0, "w": 1, "h": 1 },
{ "above": "@media min-width", "below": "@media max-width", "x": 0, "y": 0, "w": 1, "h": 1 },
]
},
"properties": { "...FIELD_SETTINGS" }
}
Dependent group field :
{
"type": "dependent_group",
"id": "FIELD_UUID",
"rect": { "...FIELD_RECT" },
"children": [ "...FIELDS_WITHOUT_RECT" ]
}
Dependent field:
{
"...FIELD_STRUCT",
"dependent": {
"enabled": true,
"predicate": [
// OR conditions
{
// AND conditions
"conditions": [
{ "field": "FIELD_ID", "operator": "equals", "value": "..." },
{ "field": "FIELD_ID", "operator": "not equals", "value": "..." },
{ "field": "FIELD_ID", "operator": "contains", "value": "..." },
{ "field": "FIELD_ID", "operator": "not contains", "value": "..." },
{ "field": "FIELD_ID", "operator": "like", "value": "..." },
{ "field": "FIELD_ID", "operator": "not like", "value": "..." }
]
},
{
"conditions": ["..."]
}
]
}
}
→ Maintain a separate parser implementation for each breaking change version for the JSON to internal object representation conversion.
Notes for the v1.0 roadmap
Form structure format
Rework a standardized versioned format, write an RFC. It will probably not be compatible with the current beta format.
Front-end
Back-end
mvpf-form
custom post type is manually set to "translate" in the settings. However, form IDs are not automatically translated by the plugin and must be done by the user)Admin UI
Rework the entire UI inside a single React app, with MobX-backed state.
Useful links