Allow sections to be nested inside containers

This commit is contained in:
Andrew Kingston 2021-06-18 14:03:55 +01:00
parent 49abab36c9
commit ae922492f5
2 changed files with 35 additions and 37 deletions

View File

@ -9,8 +9,7 @@
const currentComponent = store.actions.components.getDefinition( const currentComponent = store.actions.components.getDefinition(
selectedComponent?._component selectedComponent?._component
) )
return currentComponent?.illegalChildren?.includes(name.toLowerCase())
return currentComponent?.illegalChildren?.includes(name)
} }
const enrichStructure = (structure, definitions) => { const enrichStructure = (structure, definitions) => {

View File

@ -62,7 +62,6 @@
"icon": "Sandbox", "icon": "Sandbox",
"hasChildren": true, "hasChildren": true,
"styleable": true, "styleable": true,
"illegalChildren": ["section"],
"showSettingsBar": true, "showSettingsBar": true,
"settings": [ "settings": [
{ {
@ -181,7 +180,7 @@
"icon": "ColumnTwoB", "icon": "ColumnTwoB",
"hasChildren": true, "hasChildren": true,
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"showEmptyState": false, "showEmptyState": false,
"settings": [ "settings": [
{ {
@ -202,7 +201,7 @@
"name": "Button", "name": "Button",
"description": "A basic html button that is ready for styling", "description": "A basic html button that is ready for styling",
"icon": "Button", "icon": "Button",
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"styleable": true, "styleable": true,
"settings": [ "settings": [
{ {
@ -227,7 +226,7 @@
"description": "A configurable data list that attaches to your backend tables.", "description": "A configurable data list that attaches to your backend tables.",
"icon": "ViewList", "icon": "ViewList",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"hasChildren": true, "hasChildren": true,
"settings": [ "settings": [
{ {
@ -256,7 +255,7 @@
"icon": "TaskList", "icon": "TaskList",
"description": "A basic card component that can contain content and actions.", "description": "A basic card component that can contain content and actions.",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -286,7 +285,7 @@
"description": "A basic card component that can contain content and actions.", "description": "A basic card component that can contain content and actions.",
"icon": "ViewColumn", "icon": "ViewColumn",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -347,7 +346,7 @@
"description": "A component for displaying paragraph text.", "description": "A component for displaying paragraph text.",
"icon": "TextParagraph", "icon": "TextParagraph",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -361,7 +360,7 @@
"icon": "TextBold", "icon": "TextBold",
"description": "A component for displaying heading text", "description": "A component for displaying heading text",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -382,7 +381,7 @@
"description": "A basic component for displaying images", "description": "A basic component for displaying images",
"icon": "Image", "icon": "Image",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -396,7 +395,7 @@
"description": "A background image", "description": "A background image",
"icon": "Images", "icon": "Images",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -454,7 +453,7 @@
"description": "A basic component for displaying icons", "description": "A basic component for displaying icons",
"icon": "Bell", "icon": "Bell",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "icon", "type": "icon",
@ -502,7 +501,7 @@
"description": "A component for handling the navigation within your app.", "description": "A component for handling the navigation within your app.",
"icon": "BreadcrumbNavigation", "icon": "BreadcrumbNavigation",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"hasChildren": true, "hasChildren": true,
"settings": [ "settings": [
{ {
@ -523,7 +522,7 @@
"description": "A basic link component for internal and external links", "description": "A basic link component for internal and external links",
"icon": "Link", "icon": "Link",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -553,7 +552,7 @@
"description": "A basic card component that can contain content and actions.", "description": "A basic card component that can contain content and actions.",
"icon": "ViewRow", "icon": "ViewRow",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -626,7 +625,7 @@
"description": "A card component for displaying numbers.", "description": "A card component for displaying numbers.",
"icon": "Card", "icon": "Card",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -653,7 +652,7 @@
"icon": "Code", "icon": "Code",
"description": "Embed content from 3rd party sources", "description": "Embed content from 3rd party sources",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -667,7 +666,7 @@
"description": "Bar chart", "description": "Bar chart",
"icon": "GraphBarVertical", "icon": "GraphBarVertical",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -768,7 +767,7 @@
"description": "Line chart", "description": "Line chart",
"icon": "GraphTrend", "icon": "GraphTrend",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -870,7 +869,7 @@
"description": "Line chart", "description": "Line chart",
"icon": "GraphAreaStacked", "icon": "GraphAreaStacked",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -984,7 +983,7 @@
"description": "Pie chart", "description": "Pie chart",
"icon": "GraphPie", "icon": "GraphPie",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -1062,7 +1061,7 @@
"description": "Donut chart", "description": "Donut chart",
"icon": "GraphDonut", "icon": "GraphDonut",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -1140,7 +1139,7 @@
"description": "Candlestick chart", "description": "Candlestick chart",
"icon": "GraphBarVerticalStacked", "icon": "GraphBarVerticalStacked",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "text", "type": "text",
@ -1223,7 +1222,7 @@
"icon": "Form", "icon": "Form",
"styleable": true, "styleable": true,
"hasChildren": true, "hasChildren": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"actions": [ "actions": [
"ValidateForm" "ValidateForm"
], ],
@ -1295,7 +1294,7 @@
"name": "Field Group", "name": "Field Group",
"icon": "Group", "icon": "Group",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"hasChildren": true, "hasChildren": true,
"settings": [ "settings": [
{ {
@ -1324,7 +1323,7 @@
"name": "Text Field", "name": "Text Field",
"icon": "Text", "icon": "Text",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "field/string", "type": "field/string",
@ -1353,7 +1352,7 @@
"name": "Number Field", "name": "Number Field",
"icon": "123", "icon": "123",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "field/number", "type": "field/number",
@ -1382,7 +1381,7 @@
"name": "Password Field", "name": "Password Field",
"icon": "LockClosed", "icon": "LockClosed",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "field/string", "type": "field/string",
@ -1411,7 +1410,7 @@
"name": "Options Picker", "name": "Options Picker",
"icon": "ViewList", "icon": "ViewList",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "field/options", "type": "field/options",
@ -1441,7 +1440,7 @@
"name": "Checkbox", "name": "Checkbox",
"icon": "Checkmark", "icon": "Checkmark",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "field/boolean", "type": "field/boolean",
@ -1470,7 +1469,7 @@
"name": "Rich Text", "name": "Rich Text",
"icon": "TextParagraph", "icon": "TextParagraph",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "field/longform", "type": "field/longform",
@ -1500,7 +1499,7 @@
"name": "Date Picker", "name": "Date Picker",
"icon": "DateInput", "icon": "DateInput",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "field/datetime", "type": "field/datetime",
@ -1535,7 +1534,7 @@
"name": "Attachment", "name": "Attachment",
"icon": "Attach", "icon": "Attach",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "field/attachment", "type": "field/attachment",
@ -1559,7 +1558,7 @@
"name": "Relationship Picker", "name": "Relationship Picker",
"icon": "TaskList", "icon": "TaskList",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"settings": [ "settings": [
{ {
"type": "field/link", "type": "field/link",
@ -1589,7 +1588,7 @@
"info": "Pagination is only available for data stored in internal tables.", "info": "Pagination is only available for data stored in internal tables.",
"icon": "Data", "icon": "Data",
"styleable": false, "styleable": false,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"hasChildren": true, "hasChildren": true,
"settings": [ "settings": [
{ {
@ -1653,7 +1652,7 @@
"name": "Table", "name": "Table",
"icon": "Table", "icon": "Table",
"styleable": true, "styleable": true,
"illegalChildren": ["Section"], "illegalChildren": ["section"],
"hasChildren": true, "hasChildren": true,
"showEmptyState": false, "showEmptyState": false,
"settings": [ "settings": [