// Customizable command palette for advanced users // Opens with cmd+k or ctrl+k by default // https://github.com/excid3/ninja-keys import { Controller } from "@hotwired/stimulus" import { destroy } from '@rails/request.js' export default class extends Controller { static targets = ["container"] static values = { vars: String, projectId: String, } connect() { const vars = JSON.parse(this.varsValue) vars.forEach(v => { this._add(v.name, v.value, v.id) }) } add(e) { e.preventDefault(); this._add("", "") } _add(name, value, id=null) { const container = this.containerTarget; const div = document.createElement("div"); // Make the value 3x the width of the name div.innerHTML = `