const UNIVERSAL_WORKSPACE_ID = "universalworkspaceid"; const WORKSPACE_COMPONENTS_NAME = "workspaceComponents"; function addVariableToMain({ id = null, variable = {name: "", type: "String", value: ""}, afterComponentWithId = null, }) { let html = ``; if (afterComponentWithId === null) { html += `
`; html += `
`; } html += `
`; html += ` `; html += ` `; html += ` `; html += `
`; html += `
`; html += `
${variable.name}
`; html += `
`; html += `
`; html += ` `; html += `
`; html += `
`; html += `
`; if (afterComponentWithId === null) { html += `
`; html += `
`; } if (afterComponentWithId == null) { $main.append(html); } else { $(html).insertAfter(`#workspaceVariableDiv${afterComponentWithId}`); } variable.usages.push(document.getElementById(`workspaceVariableDiv${id}`)); } function attributeValueToMain({ id = null, variable = {name: "", type: "String", value: ""}, }) { let html = ``; html += `
`; html += `
`; html += `
`; html += ` `; html += ` `; html += ` `; html += `
`; html += `
`; html += `
${variable.name} =
`; html += `
`; html += `
`; html += ` `; html += `
`; html += `
`; html += `
`; html += `
`; html += `
`; $main.append(html); variable.attributions.push(document.getElementById(`workspaceVariableDiv${id}`)); } function deleteVariableFromMain(id = null) { $(`#workspaceVariableDiv${id}`).remove(); }