(title)
| 2057 | } |
| 2058 | |
| 2059 | function safeFnNameFromTitle(title) { |
| 2060 | const base = String(title || "Screen").replace(/[^a-zA-Z0-9]+/g, " ").trim(); |
| 2061 | const camel = base |
| 2062 | .split(/\s+/g) |
| 2063 | .filter(Boolean) |
| 2064 | .map((w) => w.charAt(0).toUpperCase() + w.slice(1)) |
| 2065 | .join(""); |
| 2066 | return "draw" + (camel || "Screen"); |
| 2067 | } |
| 2068 | |
| 2069 | function createElementWithDefaults(type, overrides = {}) { |
| 2070 | const defaultStroke = getContrastingColor(bgColor); |