@hypen-space/web 0.4.2 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/canvas/accessibility.d.ts +47 -0
  2. package/dist/canvas/events.d.ts +87 -0
  3. package/dist/canvas/index.d.ts +11 -0
  4. package/dist/canvas/index.js +32 -14
  5. package/dist/canvas/index.js.map +7 -7
  6. package/dist/canvas/input.d.ts +63 -0
  7. package/dist/canvas/input.js +14 -2
  8. package/dist/canvas/input.js.map +3 -3
  9. package/dist/canvas/layout.d.ts +10 -0
  10. package/dist/canvas/layout.js +17 -12
  11. package/dist/canvas/layout.js.map +4 -4
  12. package/dist/canvas/paint.d.ts +14 -0
  13. package/dist/canvas/paint.js +3 -2
  14. package/dist/canvas/paint.js.map +4 -4
  15. package/dist/canvas/renderer.d.ts +99 -0
  16. package/dist/canvas/renderer.js +32 -14
  17. package/dist/canvas/renderer.js.map +7 -7
  18. package/dist/canvas/text.d.ts +22 -0
  19. package/dist/canvas/text.js +2 -2
  20. package/dist/canvas/text.js.map +2 -2
  21. package/dist/canvas/types.d.ts +96 -0
  22. package/dist/canvas/utils.d.ts +44 -0
  23. package/dist/client.d.ts +19 -0
  24. package/dist/client.js +106 -43
  25. package/dist/client.js.map +12 -11
  26. package/dist/dom/applicators/advanced-layout.d.ts +5 -0
  27. package/dist/dom/applicators/advanced-layout.js +1 -114
  28. package/dist/dom/applicators/advanced-layout.js.map +4 -5
  29. package/dist/dom/applicators/background.d.ts +5 -0
  30. package/dist/dom/applicators/border.d.ts +5 -0
  31. package/dist/dom/applicators/color.d.ts +5 -0
  32. package/dist/dom/applicators/display.d.ts +5 -0
  33. package/dist/dom/applicators/effects.d.ts +5 -0
  34. package/dist/dom/applicators/events.d.ts +8 -0
  35. package/dist/dom/applicators/events.js +55 -3
  36. package/dist/dom/applicators/events.js.map +3 -3
  37. package/dist/dom/applicators/font.d.ts +29 -0
  38. package/dist/dom/applicators/index.d.ts +76 -0
  39. package/dist/dom/applicators/index.js +55 -9
  40. package/dist/dom/applicators/index.js.map +4 -4
  41. package/dist/dom/applicators/layout.d.ts +10 -0
  42. package/dist/dom/applicators/margin.d.ts +11 -0
  43. package/dist/dom/applicators/padding.d.ts +11 -0
  44. package/dist/dom/applicators/size.d.ts +14 -0
  45. package/dist/dom/applicators/transform.d.ts +5 -0
  46. package/dist/dom/applicators/transition.d.ts +5 -0
  47. package/dist/dom/applicators/types.d.ts +6 -0
  48. package/dist/dom/applicators/typography.d.ts +5 -0
  49. package/dist/dom/canvas/index.d.ts +12 -0
  50. package/dist/dom/components/app.d.ts +8 -0
  51. package/dist/dom/components/app.js +55 -0
  52. package/dist/dom/components/app.js.map +10 -0
  53. package/dist/dom/components/audio.d.ts +5 -0
  54. package/dist/dom/components/avatar.d.ts +5 -0
  55. package/dist/dom/components/badge.d.ts +5 -0
  56. package/dist/dom/components/button.d.ts +9 -0
  57. package/dist/dom/components/card.d.ts +5 -0
  58. package/dist/dom/components/center.d.ts +9 -0
  59. package/dist/dom/components/checkbox.d.ts +5 -0
  60. package/dist/dom/components/column.d.ts +8 -0
  61. package/dist/dom/components/container.d.ts +5 -0
  62. package/dist/dom/components/divider.d.ts +5 -0
  63. package/dist/dom/components/grid.d.ts +7 -0
  64. package/dist/dom/components/heading.d.ts +5 -0
  65. package/dist/dom/components/hypenapp.d.ts +19 -0
  66. package/dist/dom/components/hypenapp.js +2 -4
  67. package/dist/dom/components/hypenapp.js.map +3 -3
  68. package/dist/dom/components/image.d.ts +5 -0
  69. package/dist/dom/components/index.d.ts +29 -0
  70. package/dist/dom/components/index.js +29 -5
  71. package/dist/dom/components/index.js.map +7 -6
  72. package/dist/dom/components/input.d.ts +5 -0
  73. package/dist/dom/components/link.d.ts +5 -0
  74. package/dist/dom/components/list.d.ts +5 -0
  75. package/dist/dom/components/paragraph.d.ts +5 -0
  76. package/dist/dom/components/progressbar.d.ts +5 -0
  77. package/dist/dom/components/route.d.ts +6 -0
  78. package/dist/dom/components/route.js +2 -2
  79. package/dist/dom/components/route.js.map +2 -2
  80. package/dist/dom/components/router.d.ts +5 -0
  81. package/dist/dom/components/row.d.ts +7 -0
  82. package/dist/dom/components/select.d.ts +5 -0
  83. package/dist/dom/components/slider.d.ts +5 -0
  84. package/dist/dom/components/spacer.d.ts +5 -0
  85. package/dist/dom/components/spinner.d.ts +5 -0
  86. package/dist/dom/components/stack.d.ts +5 -0
  87. package/dist/dom/components/switch.d.ts +5 -0
  88. package/dist/dom/components/text.d.ts +5 -0
  89. package/dist/dom/components/textarea.d.ts +5 -0
  90. package/dist/dom/components/video.d.ts +5 -0
  91. package/dist/dom/debug.d.ts +63 -0
  92. package/dist/dom/debug.js +2 -2
  93. package/dist/dom/debug.js.map +2 -2
  94. package/dist/dom/element-data.d.ts +94 -0
  95. package/dist/dom/events.d.ts +39 -0
  96. package/dist/dom/events.js +2 -2
  97. package/dist/dom/events.js.map +2 -2
  98. package/dist/dom/index.d.ts +10 -0
  99. package/dist/dom/index.js +101 -25
  100. package/dist/dom/index.js.map +12 -11
  101. package/dist/dom/renderer.d.ts +115 -0
  102. package/dist/dom/renderer.js +100 -24
  103. package/dist/dom/renderer.js.map +11 -10
  104. package/dist/hypen.d.ts +140 -0
  105. package/dist/hypen.js +106 -43
  106. package/dist/hypen.js.map +12 -11
  107. package/dist/index.d.ts +28 -0
  108. package/dist/index.js +132 -38
  109. package/dist/index.js.map +17 -16
  110. package/package.json +3 -2
  111. package/src/canvas/input.ts +23 -1
  112. package/src/dom/applicators/events.ts +71 -0
  113. package/src/dom/renderer.ts +4 -4
  114. package/src/hypen.ts +7 -24
@@ -3,10 +3,10 @@
3
3
  "sources": ["../src/canvas/utils.ts", "../src/canvas/text.ts", "../src/canvas/paint.ts"],
4
4
  "sourcesContent": [
5
5
  "/**\n * Canvas Renderer Utilities\n *\n * Common utility functions\n */\n\nimport type { BoxSpacing, Rectangle, Point, VirtualNode } from \"./types.js\";\n\n/**\n * Parse spacing value (margin, padding)\n * Supports: number, \"10\", \"10 20\", \"10 20 30 40\"\n */\nexport function parseSpacing(value: any): BoxSpacing {\n if (typeof value === \"number\") {\n return { top: value, right: value, bottom: value, left: value };\n }\n\n if (typeof value === \"string\") {\n const parts = value.split(/\\s+/).map((v) => parseFloat(v) || 0);\n if (parts.length === 1) {\n return { top: parts[0], right: parts[0], bottom: parts[0], left: parts[0] };\n }\n if (parts.length === 2) {\n return { top: parts[0], right: parts[1], bottom: parts[0], left: parts[1] };\n }\n if (parts.length === 4) {\n return { top: parts[0], right: parts[1], bottom: parts[2], left: parts[3] };\n }\n }\n\n if (typeof value === \"object\" && value !== null) {\n return {\n top: parseFloat(value.top) || 0,\n right: parseFloat(value.right) || 0,\n bottom: parseFloat(value.bottom) || 0,\n left: parseFloat(value.left) || 0,\n };\n }\n\n return { top: 0, right: 0, bottom: 0, left: 0 };\n}\n\n/**\n * Parse size value (width, height)\n * Returns pixel value or null for \"auto\"\n */\nexport function parseSize(value: any): number | null {\n if (typeof value === \"number\") return value;\n if (typeof value === \"string\") {\n if (value === \"auto\") return null;\n const num = parseFloat(value);\n return isNaN(num) ? null : num;\n }\n return null;\n}\n\n/**\n * Check if point is inside rectangle\n */\nexport function isPointInRect(point: Point, rect: Rectangle): boolean {\n return (\n point.x >= rect.x &&\n point.x <= rect.x + rect.width &&\n point.y >= rect.y &&\n point.y <= rect.y + rect.height\n );\n}\n\n/**\n * Check if point is inside rounded rectangle\n */\nexport function isPointInRoundedRect(\n point: Point,\n rect: Rectangle,\n radius: number\n): boolean {\n const { x, y, width, height } = rect;\n\n // Quick reject if outside bounding box\n if (!isPointInRect(point, rect)) return false;\n\n // No radius means simple rectangle\n if (radius <= 0) return true;\n\n const px = point.x;\n const py = point.y;\n\n // Check corners\n // Top-left\n if (px < x + radius && py < y + radius) {\n return Math.pow(px - (x + radius), 2) + Math.pow(py - (y + radius), 2) <= Math.pow(radius, 2);\n }\n\n // Top-right\n if (px > x + width - radius && py < y + radius) {\n return (\n Math.pow(px - (x + width - radius), 2) + Math.pow(py - (y + radius), 2) <=\n Math.pow(radius, 2)\n );\n }\n\n // Bottom-left\n if (px < x + radius && py > y + height - radius) {\n return (\n Math.pow(px - (x + radius), 2) + Math.pow(py - (y + height - radius), 2) <=\n Math.pow(radius, 2)\n );\n }\n\n // Bottom-right\n if (px > x + width - radius && py > y + height - radius) {\n return (\n Math.pow(px - (x + width - radius), 2) + Math.pow(py - (y + height - radius), 2) <=\n Math.pow(radius, 2)\n );\n }\n\n // Inside rectangle\n return true;\n}\n\n/**\n * Merge rectangles into bounding box\n */\nexport function mergeRects(rects: Rectangle[]): Rectangle | null {\n if (rects.length === 0) return null;\n if (rects.length === 1) return rects[0];\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (const rect of rects) {\n minX = Math.min(minX, rect.x);\n minY = Math.min(minY, rect.y);\n maxX = Math.max(maxX, rect.x + rect.width);\n maxY = Math.max(maxY, rect.y + rect.height);\n }\n\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n}\n\n/**\n * Create a canvas font string from font style\n */\nexport function createFontString(\n fontSize: number,\n fontWeight: string | number,\n fontFamily: string\n): string {\n return `${fontWeight} ${fontSize}px ${fontFamily}`;\n}\n\n/**\n * Walk tree depth-first\n */\nexport function walkTree(node: VirtualNode, callback: (node: VirtualNode) => void): void {\n callback(node);\n for (const child of node.children) {\n walkTree(child, callback);\n }\n}\n\n/**\n * Find node by ID in tree\n */\nexport function findNodeById(root: VirtualNode, id: string): VirtualNode | null {\n if (root.id === id) return root;\n\n for (const child of root.children) {\n const found = findNodeById(child, id);\n if (found) return found;\n }\n\n return null;\n}\n\n/**\n * Get absolute bounds of node (including transformations)\n */\nexport function getAbsoluteBounds(node: VirtualNode): Rectangle | null {\n if (!node.layout) return null;\n\n let x = node.layout.x;\n let y = node.layout.y;\n\n // Walk up tree to accumulate offsets\n let current = node.parent;\n while (current && current.layout) {\n x += current.layout.contentX;\n y += current.layout.contentY;\n current = current.parent;\n }\n\n return {\n x,\n y,\n width: node.layout.width,\n height: node.layout.height,\n };\n}\n\n\n\n\n\n\n\n\n\n\n\n",
6
- "/**\n * Text Rendering System\n *\n * Text measurement, wrapping, and rendering\n */\n\nimport type { FontStyle, TextMetrics, TextStyle } from \"./types.js\";\nimport { createFontString } from \"./utils.js\";\nimport { frameworkLoggers } from \"@hypen-space/core\";\n\nconst log = frameworkLoggers.canvas;\n\n/**\n * Text metrics cache\n */\nconst textMetricsCache = new Map<string, TextMetrics>();\n\n/**\n * Get cache key for text metrics\n */\nfunction getCacheKey(text: string, fontStyle: FontStyle, maxWidth?: number): string {\n return `${text}|${fontStyle.fontSize}|${fontStyle.fontWeight}|${fontStyle.fontFamily}|${maxWidth || \"auto\"}`;\n}\n\n/**\n * Measure text dimensions\n */\nexport function measureText(\n ctx: CanvasRenderingContext2D,\n text: string,\n fontStyle: FontStyle,\n maxWidth?: number\n): TextMetrics {\n const cacheKey = getCacheKey(text, fontStyle, maxWidth);\n const cached = textMetricsCache.get(cacheKey);\n if (cached) return cached;\n\n const font = createFontString(fontStyle.fontSize, fontStyle.fontWeight, fontStyle.fontFamily);\n ctx.save();\n ctx.font = font;\n\n const lineHeight = fontStyle.lineHeight || fontStyle.fontSize * 1.2;\n\n // No wrapping needed\n if (!maxWidth) {\n const metrics = ctx.measureText(text);\n const result: TextMetrics = {\n width: metrics.width,\n height: lineHeight,\n lines: [text],\n lineHeight,\n };\n ctx.restore();\n textMetricsCache.set(cacheKey, result);\n return result;\n }\n\n // Wrap text\n const lines = wrapText(ctx, text, maxWidth);\n const width = Math.max(...lines.map((line) => ctx.measureText(line).width));\n const height = lines.length * lineHeight;\n\n const result: TextMetrics = {\n width,\n height,\n lines,\n lineHeight,\n };\n\n ctx.restore();\n textMetricsCache.set(cacheKey, result);\n return result;\n}\n\n/**\n * Wrap text to fit within maxWidth\n */\nfunction wrapText(ctx: CanvasRenderingContext2D, text: string, maxWidth: number): string[] {\n const lines: string[] = [];\n const paragraphs = text.split(\"\\n\");\n\n for (const paragraph of paragraphs) {\n const words = paragraph.split(\" \");\n let currentLine = \"\";\n\n for (const word of words) {\n const testLine = currentLine ? `${currentLine} ${word}` : word;\n const metrics = ctx.measureText(testLine);\n\n if (metrics.width > maxWidth && currentLine) {\n lines.push(currentLine);\n currentLine = word;\n } else {\n currentLine = testLine;\n }\n }\n\n if (currentLine) {\n lines.push(currentLine);\n }\n }\n\n return lines.length > 0 ? lines : [\"\"];\n}\n\n/**\n * Render text with style\n */\nexport function renderText(\n ctx: CanvasRenderingContext2D,\n text: string,\n x: number,\n y: number,\n width: number,\n height: number,\n style: TextStyle\n): void {\n const font = createFontString(style.fontSize, style.fontWeight, style.fontFamily);\n ctx.save();\n ctx.font = font;\n ctx.fillStyle = style.color;\n ctx.textBaseline = \"top\";\n\n const metrics = measureText(ctx, text, style, width);\n\n // Calculate starting Y based on vertical alignment\n let startY = y;\n if (style.verticalAlign === \"middle\") {\n startY = y + (height - metrics.height) / 2;\n } else if (style.verticalAlign === \"bottom\") {\n startY = y + height - metrics.height;\n }\n\n // Render each line\n for (let i = 0; i < metrics.lines.length; i++) {\n const line = metrics.lines[i];\n const lineY = startY + i * metrics.lineHeight;\n\n // Calculate X based on text alignment\n let lineX = x;\n if (style.textAlign === \"center\") {\n const lineWidth = ctx.measureText(line).width;\n lineX = x + (width - lineWidth) / 2;\n } else if (style.textAlign === \"right\") {\n const lineWidth = ctx.measureText(line).width;\n lineX = x + width - lineWidth;\n }\n\n ctx.fillText(line, lineX, lineY);\n }\n\n ctx.restore();\n}\n\n/**\n * Clear text metrics cache\n */\nexport function clearTextCache(): void {\n textMetricsCache.clear();\n}\n\n/**\n * Preload font to ensure it's available\n */\nexport async function loadFont(fontFamily: string, fontWeight: string | number = \"normal\"): Promise<void> {\n if (!(\"fonts\" in document)) return;\n\n const font = `${fontWeight} 16px ${fontFamily}`;\n try {\n await document.fonts.load(font);\n } catch (error) {\n log.warn(`Failed to load font: ${font}`, error);\n }\n}\n\n\n\n\n\n\n\n\n\n\n\n",
7
- "/**\n * Paint System\n *\n * Drawing virtual nodes to canvas\n */\n\nimport type { VirtualNode, PainterFunction } from \"./types.js\";\nimport { renderText } from \"./text.js\";\n\n/**\n * Custom painters registry\n */\nconst customPainters = new Map<string, PainterFunction>();\n\n/**\n * Register a custom painter for a component type\n */\nexport function registerPainter(type: string, painter: PainterFunction): void {\n customPainters.set(type.toLowerCase(), painter);\n}\n\n/**\n * Paint a virtual node and its children\n */\nexport function paintNode(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n if (!node.visible || !node.layout) return;\n\n ctx.save();\n\n // Apply transforms\n applyTransforms(ctx, node);\n\n // Apply opacity\n if (node.opacity < 1) {\n ctx.globalAlpha = node.opacity;\n }\n\n // Check for custom painter\n const customPainter = customPainters.get(node.type.toLowerCase());\n if (customPainter) {\n customPainter(ctx, node);\n ctx.restore();\n return;\n }\n\n // Default painting based on type\n switch (node.type.toLowerCase()) {\n case \"column\":\n case \"row\":\n case \"stack\":\n paintContainer(ctx, node);\n break;\n case \"text\":\n paintText(ctx, node);\n break;\n case \"button\":\n paintButton(ctx, node);\n break;\n case \"input\":\n paintInput(ctx, node);\n break;\n case \"image\":\n paintImage(ctx, node);\n break;\n case \"spacer\":\n // Spacer is invisible, just takes up space\n break;\n case \"divider\":\n case \"separator\":\n paintDivider(ctx, node);\n break;\n case \"checkbox\":\n paintCheckbox(ctx, node);\n break;\n case \"radio\":\n paintRadio(ctx, node);\n break;\n case \"switch\":\n case \"toggle\":\n paintSwitch(ctx, node);\n break;\n case \"slider\":\n paintSlider(ctx, node);\n break;\n case \"progress\":\n case \"progressbar\":\n paintProgress(ctx, node);\n break;\n case \"spinner\":\n case \"loading\":\n paintSpinner(ctx, node);\n break;\n case \"card\":\n paintCard(ctx, node);\n break;\n case \"badge\":\n paintBadge(ctx, node);\n break;\n case \"avatar\":\n paintAvatar(ctx, node);\n break;\n case \"icon\":\n paintIcon(ctx, node);\n break;\n case \"link\":\n paintLink(ctx, node);\n break;\n case \"container\":\n case \"box\":\n paintContainer(ctx, node);\n break;\n default:\n paintContainer(ctx, node);\n }\n\n ctx.restore();\n\n // Paint children\n for (const child of node.children) {\n paintNode(ctx, child);\n }\n\n // Restore context if overflow clipping was applied\n if ((node as any)._needsRestore) {\n ctx.restore();\n delete (node as any)._needsRestore;\n }\n}\n\n/**\n * Paint a container (Column, Row, Stack, Box)\n */\nfunction paintContainer(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n const radius = layout.border.radius;\n\n // Apply shadow if specified\n const shadow = props.shadow || props.boxShadow;\n if (shadow) {\n applyShadow(ctx, shadow);\n }\n\n // Draw background\n const backgroundColor = props.backgroundColor || props.background;\n if (backgroundColor) {\n // Support for gradients\n if (typeof backgroundColor === \"string\" && backgroundColor.includes(\"gradient\")) {\n ctx.fillStyle = parseGradient(ctx, backgroundColor, x, y, width, height);\n } else {\n ctx.fillStyle = backgroundColor;\n }\n\n if (radius > 0) {\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n } else {\n ctx.fillRect(x, y, width, height);\n }\n }\n\n // Reset shadow for border\n if (shadow) {\n ctx.shadowColor = \"transparent\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n }\n\n // Draw border\n if (layout.border.width > 0 && layout.border.color !== \"transparent\") {\n ctx.strokeStyle = layout.border.color;\n ctx.lineWidth = layout.border.width;\n if (radius > 0) {\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.stroke();\n } else {\n ctx.strokeRect(x, y, width, height);\n }\n }\n\n // Apply overflow clipping for children\n const overflow = props.overflow || \"visible\";\n if (overflow === \"hidden\" || overflow === \"scroll\" || overflow === \"auto\") {\n ctx.save();\n ctx.beginPath();\n if (radius > 0) {\n drawRoundedRect(ctx, x, y, width, height, radius);\n } else {\n ctx.rect(x, y, width, height);\n }\n ctx.clip();\n\n // Mark that we need to restore later\n (node as any)._needsRestore = true;\n }\n}\n\n/**\n * Paint text node\n */\nfunction paintText(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n let text = String(props[0] || props.text || \"\");\n const color = props.color || \"#000000\";\n const fontSize = parseFloat(props.fontSize) || 16;\n const fontWeight = props.fontWeight || \"normal\";\n const fontFamily = props.fontFamily || \"system-ui, sans-serif\";\n const textAlign = props.textAlign || \"left\";\n const lineHeight = parseFloat(props.lineHeight) || fontSize * 1.2;\n const textDecoration = props.textDecoration || \"none\";\n const textTransform = props.textTransform || \"none\";\n const letterSpacing = parseFloat(props.letterSpacing) || 0;\n\n // Apply text transform\n if (textTransform === \"uppercase\") {\n text = text.toUpperCase();\n } else if (textTransform === \"lowercase\") {\n text = text.toLowerCase();\n } else if (textTransform === \"capitalize\") {\n text = text.replace(/\\b\\w/g, (char) => char.toUpperCase());\n }\n\n // Apply text shadow if specified\n const textShadow = props.textShadow || props.shadow;\n if (textShadow) {\n applyShadow(ctx, textShadow);\n }\n\n // Handle letter spacing\n const x = layout.x + layout.contentX;\n const y = layout.y + layout.contentY;\n\n if (letterSpacing !== 0) {\n // Manual letter spacing\n ctx.fillStyle = color;\n ctx.font = `${fontWeight} ${fontSize}px ${fontFamily}`;\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"top\";\n\n let currentX = x;\n for (let i = 0; i < text.length; i++) {\n ctx.fillText(text[i], currentX, y);\n currentX += ctx.measureText(text[i]).width;\n // Add letter spacing after each character except the last\n if (i < text.length - 1) {\n currentX += letterSpacing;\n }\n }\n\n // Text decoration with letter spacing (now correct width)\n if (textDecoration !== \"none\") {\n applyTextDecoration(ctx, textDecoration, color, x, y, currentX - x, fontSize);\n }\n } else {\n // Normal text rendering\n renderText(\n ctx,\n text,\n x,\n y,\n layout.contentWidth,\n layout.contentHeight,\n {\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign: textAlign as any,\n verticalAlign: \"top\",\n lineHeight,\n }\n );\n\n // Text decoration (need to set font again for measurement)\n if (textDecoration !== \"none\") {\n ctx.font = `${fontWeight} ${fontSize}px ${fontFamily}`;\n const textWidth = ctx.measureText(text).width;\n applyTextDecoration(ctx, textDecoration, color, x, y, textWidth, fontSize);\n }\n }\n\n // Reset shadow\n if (textShadow) {\n ctx.shadowColor = \"transparent\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n }\n}\n\n/**\n * Paint button node\n */\nfunction paintButton(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n const radius = layout.border.radius || 4;\n\n // Apply shadow if specified\n const shadow = props.shadow || props.boxShadow;\n if (shadow) {\n applyShadow(ctx, shadow);\n }\n\n // Background color based on state\n let backgroundColor = props.backgroundColor || \"#007bff\";\n if (node.hovered) {\n backgroundColor = props.hoverColor || \"#0056b3\";\n }\n if (node.focused) {\n backgroundColor = props.focusColor || \"#004085\";\n }\n\n // Support gradients for button background\n if (typeof backgroundColor === \"string\" && backgroundColor.includes(\"gradient\")) {\n ctx.fillStyle = parseGradient(ctx, backgroundColor, x, y, width, height);\n } else {\n ctx.fillStyle = backgroundColor;\n }\n\n // Draw button background\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n\n // Reset shadow for border\n if (shadow) {\n ctx.shadowColor = \"transparent\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n }\n\n // Draw border\n if (layout.border.width > 0) {\n ctx.strokeStyle = layout.border.color;\n ctx.lineWidth = layout.border.width;\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.stroke();\n }\n\n // Paint children (typically Text)\n for (const child of node.children) {\n paintNode(ctx, child);\n }\n}\n\n/**\n * Paint input node\n */\nfunction paintInput(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n const radius = layout.border.radius || 4;\n\n // Background\n ctx.fillStyle = props.backgroundColor || \"#ffffff\";\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n\n // Border (thicker if focused)\n const borderColor = node.focused ? \"#007bff\" : (layout.border.color || \"#cccccc\");\n const borderWidth = node.focused ? 2 : (layout.border.width || 1);\n ctx.strokeStyle = borderColor;\n ctx.lineWidth = borderWidth;\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.stroke();\n\n // Input value text\n const value = props.value || \"\";\n const placeholder = props.placeholder || \"\";\n const text = value || placeholder;\n const textColor = value ? (props.color || \"#000000\") : \"#999999\";\n\n if (text) {\n const fontSize = parseFloat(props.fontSize) || 16;\n const fontWeight = props.fontWeight || \"normal\";\n const fontFamily = props.fontFamily || \"system-ui, sans-serif\";\n const lineHeight = parseFloat(props.lineHeight) || fontSize * 1.2;\n\n renderText(\n ctx,\n text,\n layout.x + layout.contentX,\n layout.y + layout.contentY,\n layout.contentWidth,\n layout.contentHeight,\n {\n color: textColor,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign: \"left\",\n verticalAlign: \"middle\",\n lineHeight,\n }\n );\n }\n}\n\n/**\n * Paint image node\n */\nfunction paintImage(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const src = props.src || props[0];\n if (!src) return;\n\n // TODO: Load and cache images\n // For now, just draw a placeholder\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n\n ctx.fillStyle = \"#e0e0e0\";\n ctx.fillRect(x, y, width, height);\n\n ctx.strokeStyle = \"#999999\";\n ctx.lineWidth = 1;\n ctx.strokeRect(x, y, width, height);\n\n // Draw \"IMG\" text\n ctx.fillStyle = \"#666666\";\n ctx.font = \"14px sans-serif\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(\"IMG\", x + width / 2, y + height / 2);\n}\n\n/**\n * Draw rounded rectangle path\n */\nfunction drawRoundedRect(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n width: number,\n height: number,\n radius: number\n): void {\n if (radius <= 0) {\n ctx.rect(x, y, width, height);\n return;\n }\n\n ctx.beginPath();\n ctx.moveTo(x + radius, y);\n ctx.lineTo(x + width - radius, y);\n ctx.arcTo(x + width, y, x + width, y + radius, radius);\n ctx.lineTo(x + width, y + height - radius);\n ctx.arcTo(x + width, y + height, x + width - radius, y + height, radius);\n ctx.lineTo(x + radius, y + height);\n ctx.arcTo(x, y + height, x, y + height - radius, radius);\n ctx.lineTo(x, y + radius);\n ctx.arcTo(x, y, x + radius, y, radius);\n ctx.closePath();\n}\n\n/**\n * Apply shadow to canvas context\n * Supports both simple and CSS-like shadow syntax:\n * - Simple: \"2 2 4 rgba(0,0,0,0.3)\"\n * - CSS-like: \"2px 2px 4px rgba(0,0,0,0.3)\"\n * - Named: {offsetX: 2, offsetY: 2, blur: 4, color: \"rgba(0,0,0,0.3)\"}\n */\nfunction applyShadow(ctx: CanvasRenderingContext2D, shadow: any): void {\n if (typeof shadow === \"string\") {\n // Parse CSS-like shadow string: \"offsetX offsetY blur color\"\n const parts = shadow.trim().split(/\\s+/);\n if (parts.length >= 3) {\n const offsetX = parseFloat(parts[0]);\n const offsetY = parseFloat(parts[1]);\n const blur = parseFloat(parts[2]);\n const color = parts.slice(3).join(\" \") || \"rgba(0,0,0,0.3)\";\n\n ctx.shadowOffsetX = offsetX;\n ctx.shadowOffsetY = offsetY;\n ctx.shadowBlur = blur;\n ctx.shadowColor = color;\n }\n } else if (typeof shadow === \"object\") {\n // Object syntax\n ctx.shadowOffsetX = shadow.offsetX || 0;\n ctx.shadowOffsetY = shadow.offsetY || 0;\n ctx.shadowBlur = shadow.blur || 0;\n ctx.shadowColor = shadow.color || \"rgba(0,0,0,0.3)\";\n }\n}\n\n/**\n * Parse gradient string and create canvas gradient\n * Supports:\n * - linear-gradient(direction, color1, color2, ...)\n * - radial-gradient(color1, color2, ...)\n */\nfunction parseGradient(\n ctx: CanvasRenderingContext2D,\n gradientStr: string,\n x: number,\n y: number,\n width: number,\n height: number\n): CanvasGradient | string {\n // Simple gradient parsing\n if (gradientStr.startsWith(\"linear-gradient\")) {\n // Extract content between parentheses\n const match = gradientStr.match(/linear-gradient\\((.*)\\)/);\n if (!match) return gradientStr;\n\n const parts = match[1].split(\",\").map((s) => s.trim());\n\n // Determine direction (default to bottom)\n let x0 = x, y0 = y, x1 = x, y1 = y + height;\n let colorStart = 0;\n\n if (parts[0].includes(\"deg\") || parts[0].includes(\"to \")) {\n colorStart = 1;\n const direction = parts[0];\n\n if (direction.includes(\"to right\") || direction === \"90deg\") {\n x1 = x + width;\n y1 = y;\n } else if (direction.includes(\"to left\") || direction === \"270deg\") {\n x0 = x + width;\n x1 = x;\n y0 = y;\n y1 = y;\n } else if (direction.includes(\"to top\") || direction === \"0deg\") {\n y0 = y + height;\n y1 = y;\n }\n // Default is \"to bottom\" which we already set\n }\n\n const gradient = ctx.createLinearGradient(x0, y0, x1, y1);\n\n // Add color stops\n const colors = parts.slice(colorStart);\n colors.forEach((color, i) => {\n const stop = i / (colors.length - 1);\n gradient.addColorStop(stop, color.trim());\n });\n\n return gradient;\n } else if (gradientStr.startsWith(\"radial-gradient\")) {\n // Extract content between parentheses\n const match = gradientStr.match(/radial-gradient\\((.*)\\)/);\n if (!match) return gradientStr;\n\n const parts = match[1].split(\",\").map((s) => s.trim());\n\n // Create radial gradient from center\n const centerX = x + width / 2;\n const centerY = y + height / 2;\n const radius = Math.max(width, height) / 2;\n\n const gradient = ctx.createRadialGradient(centerX, centerY, 0, centerX, centerY, radius);\n\n // Add color stops\n parts.forEach((color, i) => {\n const stop = i / (parts.length - 1);\n gradient.addColorStop(stop, color.trim());\n });\n\n return gradient;\n }\n\n return gradientStr;\n}\n\n/**\n * Apply CSS-like transforms to canvas context\n * Supports:\n * - translate(x, y)\n * - rotate(angle)\n * - scale(x, y)\n * - skew(x, y)\n * - transform: \"translate(10, 20) rotate(45) scale(1.5)\"\n */\nfunction applyTransforms(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const props = node.props;\n const layout = node.layout!;\n\n // Get transform origin (default to center)\n const originX = parseFloat(props.transformOriginX) || 0.5;\n const originY = parseFloat(props.transformOriginY) || 0.5;\n\n const centerX = layout.x + layout.width * originX;\n const centerY = layout.y + layout.height * originY;\n\n // Check for individual transform properties\n const translateX = parseFloat(props.translateX) || 0;\n const translateY = parseFloat(props.translateY) || 0;\n const rotate = parseFloat(props.rotate) || 0; // in degrees\n const scaleX = parseFloat(props.scaleX) || parseFloat(props.scale) || 1;\n const scaleY = parseFloat(props.scaleY) || parseFloat(props.scale) || 1;\n const skewX = parseFloat(props.skewX) || parseFloat(props.skew) || 0; // in degrees\n const skewY = parseFloat(props.skewY) || 0; // in degrees\n\n // Apply transforms in order: translate to origin, scale, rotate, skew, translate back, translate by offset\n if (translateX !== 0 || translateY !== 0 || rotate !== 0 || scaleX !== 1 || scaleY !== 1 || skewX !== 0 || skewY !== 0) {\n // Move to transform origin\n ctx.translate(centerX, centerY);\n\n // Apply scale\n if (scaleX !== 1 || scaleY !== 1) {\n ctx.scale(scaleX, scaleY);\n }\n\n // Apply rotation (convert degrees to radians)\n if (rotate !== 0) {\n ctx.rotate((rotate * Math.PI) / 180);\n }\n\n // Apply skew using transform matrix\n if (skewX !== 0 || skewY !== 0) {\n const skewXRad = (skewX * Math.PI) / 180;\n const skewYRad = (skewY * Math.PI) / 180;\n ctx.transform(1, Math.tan(skewYRad), Math.tan(skewXRad), 1, 0, 0);\n }\n\n // Move back from origin and apply translation\n ctx.translate(-centerX + translateX, -centerY + translateY);\n }\n\n // Also support compound transform string (optional, for future extensibility)\n if (props.transform && typeof props.transform === \"string\") {\n parseTransformString(ctx, props.transform, centerX, centerY);\n }\n}\n\n/**\n * Parse and apply a CSS-like transform string\n */\nfunction parseTransformString(\n ctx: CanvasRenderingContext2D,\n transformStr: string,\n originX: number,\n originY: number\n): void {\n // Simple transform parsing - matches translate(), rotate(), scale()\n const transforms = transformStr.match(/(\\w+)\\(([^)]+)\\)/g);\n if (!transforms) return;\n\n ctx.translate(originX, originY);\n\n for (const transform of transforms) {\n const match = transform.match(/(\\w+)\\(([^)]+)\\)/);\n if (!match) continue;\n\n const [, func, args] = match;\n const values = args.split(\",\").map((v) => parseFloat(v.trim()));\n\n switch (func.toLowerCase()) {\n case \"translate\":\n ctx.translate(values[0] || 0, values[1] || 0);\n break;\n case \"rotate\":\n ctx.rotate((values[0] * Math.PI) / 180);\n break;\n case \"scale\":\n ctx.scale(values[0] || 1, values[1] || values[0] || 1);\n break;\n }\n }\n\n ctx.translate(-originX, -originY);\n}\n\n/**\n * Paint divider/separator node\n */\nfunction paintDivider(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const orientation = props.orientation || \"horizontal\";\n const color = props.color || props.backgroundColor || \"#e0e0e0\";\n const thickness = parseFloat(props.thickness) || 1;\n\n ctx.strokeStyle = color;\n ctx.lineWidth = thickness;\n ctx.beginPath();\n\n if (orientation === \"vertical\") {\n const x = layout.x + layout.width / 2;\n ctx.moveTo(x, layout.y);\n ctx.lineTo(x, layout.y + layout.height);\n } else {\n const y = layout.y + layout.height / 2;\n ctx.moveTo(layout.x, y);\n ctx.lineTo(layout.x + layout.width, y);\n }\n\n ctx.stroke();\n}\n\n/**\n * Paint checkbox node\n */\nfunction paintCheckbox(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const size = Math.min(layout.width, layout.height);\n const x = layout.x;\n const y = layout.y;\n\n // Properly parse boolean values (handle string \"false\")\n const checkedValue = props.checked !== undefined ? props.checked : props.value;\n const checked = checkedValue === true || checkedValue === \"true\" || (checkedValue !== false && checkedValue !== \"false\" && !!checkedValue);\n\n const radius = parseFloat(props.borderRadius) || 2;\n\n // Background\n const bgColor = checked ? (props.checkedColor || \"#007bff\") : (props.backgroundColor || \"#ffffff\");\n ctx.fillStyle = bgColor;\n drawRoundedRect(ctx, x, y, size, size, radius);\n ctx.fill();\n\n // Border\n const borderColor = checked ? (props.checkedColor || \"#007bff\") : (props.borderColor || \"#cccccc\");\n ctx.strokeStyle = borderColor;\n ctx.lineWidth = node.focused ? 2 : 1;\n drawRoundedRect(ctx, x, y, size, size, radius);\n ctx.stroke();\n\n // Checkmark\n if (checked) {\n ctx.strokeStyle = props.checkColor || \"#ffffff\";\n ctx.lineWidth = 2;\n ctx.lineCap = \"round\";\n ctx.lineJoin = \"round\";\n\n const padding = size * 0.25;\n ctx.beginPath();\n ctx.moveTo(x + padding, y + size / 2);\n ctx.lineTo(x + size * 0.4, y + size - padding);\n ctx.lineTo(x + size - padding, y + padding);\n ctx.stroke();\n }\n}\n\n/**\n * Paint radio button node\n */\nfunction paintRadio(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const size = Math.min(layout.width, layout.height);\n const centerX = layout.x + size / 2;\n const centerY = layout.y + size / 2;\n const radius = size / 2;\n\n // Properly parse boolean values (handle string \"false\")\n const checkedValue = props.checked !== undefined ? props.checked : props.value;\n const checked = checkedValue === true || checkedValue === \"true\" || (checkedValue !== false && checkedValue !== \"false\" && !!checkedValue);\n\n // Outer circle background\n const bgColor = props.backgroundColor || \"#ffffff\";\n ctx.fillStyle = bgColor;\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n ctx.fill();\n\n // Outer circle border\n const borderColor = checked ? (props.checkedColor || \"#007bff\") : (props.borderColor || \"#cccccc\");\n ctx.strokeStyle = borderColor;\n ctx.lineWidth = node.focused ? 2 : 1;\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n ctx.stroke();\n\n // Inner filled circle when checked\n if (checked) {\n ctx.fillStyle = props.checkedColor || \"#007bff\";\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius * 0.5, 0, Math.PI * 2);\n ctx.fill();\n }\n}\n\n/**\n * Paint switch/toggle node\n */\nfunction paintSwitch(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const width = layout.width;\n const height = layout.height;\n const x = layout.x;\n const y = layout.y;\n\n // Properly parse boolean values (handle string \"false\")\n const checkedValue = props.checked !== undefined ? props.checked : props.value;\n const checked = checkedValue === true || checkedValue === \"true\" || (checkedValue !== false && checkedValue !== \"false\" && !!checkedValue);\n\n const radius = height / 2;\n\n // Track background\n const trackColor = checked ? (props.checkedColor || \"#4caf50\") : (props.backgroundColor || \"#cccccc\");\n ctx.fillStyle = trackColor;\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n\n // Thumb (circle)\n const thumbRadius = radius * 0.8;\n const thumbX = checked ? (x + width - radius) : (x + radius);\n const thumbY = y + radius;\n\n ctx.fillStyle = props.thumbColor || \"#ffffff\";\n ctx.beginPath();\n ctx.arc(thumbX, thumbY, thumbRadius, 0, Math.PI * 2);\n ctx.fill();\n\n // Thumb shadow\n if (props.shadow !== false) {\n ctx.shadowColor = \"rgba(0,0,0,0.2)\";\n ctx.shadowBlur = 2;\n ctx.shadowOffsetY = 1;\n ctx.beginPath();\n ctx.arc(thumbX, thumbY, thumbRadius, 0, Math.PI * 2);\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetY = 0;\n }\n}\n\n/**\n * Paint slider node\n */\nfunction paintSlider(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const width = layout.width;\n const height = layout.height;\n const x = layout.x;\n const y = layout.y;\n\n const min = parseFloat(props.min) || 0;\n const max = parseFloat(props.max) || 100;\n const value = parseFloat(props.value) || min;\n const percentage = (value - min) / (max - min);\n\n const trackHeight = parseFloat(props.trackHeight) || 4;\n const thumbSize = parseFloat(props.thumbSize) || 16;\n const trackY = y + (height - trackHeight) / 2;\n\n // Track background\n ctx.fillStyle = props.trackColor || \"#e0e0e0\";\n drawRoundedRect(ctx, x, trackY, width, trackHeight, trackHeight / 2);\n ctx.fill();\n\n // Track fill\n const fillWidth = width * percentage;\n const fillColor = props.fillColor || props.color || \"#007bff\";\n\n // Support gradient fills\n if (typeof fillColor === \"string\" && fillColor.includes(\"gradient\")) {\n ctx.fillStyle = parseGradient(ctx, fillColor, x, trackY, fillWidth, trackHeight);\n } else {\n ctx.fillStyle = fillColor;\n }\n\n drawRoundedRect(ctx, x, trackY, fillWidth, trackHeight, trackHeight / 2);\n ctx.fill();\n\n // Thumb\n const thumbX = x + fillWidth;\n const thumbY = y + height / 2;\n\n ctx.fillStyle = props.thumbColor || \"#007bff\";\n ctx.beginPath();\n ctx.arc(thumbX, thumbY, thumbSize / 2, 0, Math.PI * 2);\n ctx.fill();\n\n // Thumb border\n ctx.strokeStyle = \"#ffffff\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.arc(thumbX, thumbY, thumbSize / 2, 0, Math.PI * 2);\n ctx.stroke();\n}\n\n/**\n * Paint progress bar node\n */\nfunction paintProgress(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const width = layout.width;\n const height = layout.height;\n const x = layout.x;\n const y = layout.y;\n\n const min = parseFloat(props.min) || 0;\n const max = parseFloat(props.max) || 100;\n const value = parseFloat(props.value) || 0;\n const percentage = Math.min(Math.max((value - min) / (max - min), 0), 1);\n const radius = layout.border.radius || height / 2;\n\n // Background\n ctx.fillStyle = props.backgroundColor || \"#e0e0e0\";\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n\n // Progress fill\n if (percentage > 0) {\n const fillWidth = width * percentage;\n\n // Support gradient fills\n const fillColor = props.fillColor || props.color || \"#007bff\";\n if (typeof fillColor === \"string\" && fillColor.includes(\"gradient\")) {\n ctx.fillStyle = parseGradient(ctx, fillColor, x, y, fillWidth, height);\n } else {\n ctx.fillStyle = fillColor;\n }\n\n drawRoundedRect(ctx, x, y, fillWidth, height, radius);\n ctx.fill();\n }\n\n // Optional text label\n if (props.showLabel) {\n const label = props.label || `${Math.round(percentage * 100)}%`;\n ctx.fillStyle = props.labelColor || \"#ffffff\";\n ctx.font = `${props.fontSize || 12}px ${props.fontFamily || \"sans-serif\"}`;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(label, x + width / 2, y + height / 2);\n }\n}\n\n/**\n * Paint spinner/loading node\n */\nfunction paintSpinner(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const size = Math.min(layout.width, layout.height);\n const centerX = layout.x + size / 2;\n const centerY = layout.y + size / 2;\n const radius = size / 2 - 4;\n const thickness = parseFloat(props.thickness) || 4;\n const color = props.color || \"#007bff\";\n\n // Use timestamp for animation if available\n const rotation = (Date.now() / 1000) * Math.PI; // Rotate based on time\n\n ctx.strokeStyle = color;\n ctx.lineWidth = thickness;\n ctx.lineCap = \"round\";\n\n // Draw circular arc\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, rotation, rotation + Math.PI * 1.5);\n ctx.stroke();\n\n // Fade out effect\n ctx.globalAlpha = 0.3;\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n ctx.stroke();\n ctx.globalAlpha = 1;\n}\n\n/**\n * Paint card node\n */\nfunction paintCard(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n const radius = layout.border.radius || 8;\n\n // Default card shadow\n const shadow = props.shadow || props.boxShadow || \"0 2 8 rgba(0,0,0,0.1)\";\n applyShadow(ctx, shadow);\n\n // Background\n const backgroundColor = props.backgroundColor || \"#ffffff\";\n if (typeof backgroundColor === \"string\" && backgroundColor.includes(\"gradient\")) {\n ctx.fillStyle = parseGradient(ctx, backgroundColor, x, y, width, height);\n } else {\n ctx.fillStyle = backgroundColor;\n }\n\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n\n // Reset shadow\n ctx.shadowColor = \"transparent\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n\n // Border\n if (layout.border.width > 0) {\n ctx.strokeStyle = layout.border.color;\n ctx.lineWidth = layout.border.width;\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.stroke();\n }\n\n // Paint children\n for (const child of node.children) {\n paintNode(ctx, child);\n }\n}\n\n/**\n * Paint badge node\n */\nfunction paintBadge(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n const radius = layout.border.radius || height / 2;\n\n // Background\n const backgroundColor = props.backgroundColor || \"#dc3545\";\n ctx.fillStyle = backgroundColor;\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n\n // Text content\n const text = String(props[0] || props.text || \"\");\n if (text) {\n ctx.fillStyle = props.color || \"#ffffff\";\n ctx.font = `${props.fontWeight || \"bold\"} ${props.fontSize || 10}px ${props.fontFamily || \"sans-serif\"}`;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(text, x + width / 2, y + height / 2);\n }\n}\n\n/**\n * Paint avatar node\n */\nfunction paintAvatar(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const size = Math.min(layout.width, layout.height);\n const centerX = layout.x + size / 2;\n const centerY = layout.y + size / 2;\n const radius = size / 2;\n\n // Clip to circle\n ctx.save();\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n ctx.clip();\n\n // Background\n const backgroundColor = props.backgroundColor || \"#cccccc\";\n ctx.fillStyle = backgroundColor;\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n ctx.fill();\n\n // Text initials if provided\n const text = String(props[0] || props.text || props.initials || \"\");\n if (text) {\n ctx.fillStyle = props.color || \"#ffffff\";\n ctx.font = `${props.fontWeight || \"bold\"} ${props.fontSize || size / 2.5}px ${props.fontFamily || \"sans-serif\"}`;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(text, centerX, centerY);\n }\n\n ctx.restore();\n\n // Border\n if (layout.border.width > 0) {\n ctx.strokeStyle = layout.border.color;\n ctx.lineWidth = layout.border.width;\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n ctx.stroke();\n }\n}\n\n/**\n * Paint icon node (simple placeholder - real icons would need SVG path support)\n */\nfunction paintIcon(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const size = Math.min(layout.width, layout.height);\n const x = layout.x;\n const y = layout.y;\n const color = props.color || \"#000000\";\n const iconName = props.icon || props.name || \"circle\";\n\n ctx.fillStyle = color;\n ctx.strokeStyle = color;\n ctx.lineWidth = 2;\n\n // Simple icon shapes\n switch (iconName.toLowerCase()) {\n case \"circle\":\n ctx.beginPath();\n ctx.arc(x + size / 2, y + size / 2, size / 3, 0, Math.PI * 2);\n ctx.fill();\n break;\n\n case \"square\":\n const padding = size * 0.2;\n ctx.fillRect(x + padding, y + padding, size - padding * 2, size - padding * 2);\n break;\n\n case \"star\":\n drawStar(ctx, x + size / 2, y + size / 2, 5, size / 3, size / 6);\n ctx.fill();\n break;\n\n case \"check\":\n case \"checkmark\":\n const p = size * 0.2;\n ctx.beginPath();\n ctx.moveTo(x + p, y + size / 2);\n ctx.lineTo(x + size * 0.4, y + size - p);\n ctx.lineTo(x + size - p, y + p);\n ctx.stroke();\n break;\n\n case \"x\":\n case \"close\":\n const pd = size * 0.2;\n ctx.beginPath();\n ctx.moveTo(x + pd, y + pd);\n ctx.lineTo(x + size - pd, y + size - pd);\n ctx.moveTo(x + size - pd, y + pd);\n ctx.lineTo(x + pd, y + size - pd);\n ctx.stroke();\n break;\n\n default:\n // Default: filled circle\n ctx.beginPath();\n ctx.arc(x + size / 2, y + size / 2, size / 3, 0, Math.PI * 2);\n ctx.fill();\n }\n}\n\n/**\n * Paint link node\n */\nfunction paintLink(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const text = String(props[0] || props.text || \"\");\n const color = node.hovered ? (props.hoverColor || \"#0056b3\") : (props.color || \"#007bff\");\n const fontSize = parseFloat(props.fontSize) || 16;\n const fontWeight = props.fontWeight || \"normal\";\n const fontFamily = props.fontFamily || \"system-ui, sans-serif\";\n const textDecoration = props.textDecoration !== undefined ? props.textDecoration : \"underline\";\n\n ctx.fillStyle = color;\n ctx.font = `${fontWeight} ${fontSize}px ${fontFamily}`;\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"top\";\n\n const x = layout.x + layout.contentX;\n const y = layout.y + layout.contentY;\n\n ctx.fillText(text, x, y);\n\n // Underline\n if (textDecoration === \"underline\") {\n const textWidth = ctx.measureText(text).width;\n ctx.strokeStyle = color;\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(x, y + fontSize + 2);\n ctx.lineTo(x + textWidth, y + fontSize + 2);\n ctx.stroke();\n }\n}\n\n/**\n * Apply text decoration (underline, line-through, etc.)\n */\nfunction applyTextDecoration(\n ctx: CanvasRenderingContext2D,\n decoration: string,\n color: string,\n x: number,\n y: number,\n width: number,\n fontSize: number\n): void {\n ctx.strokeStyle = color;\n ctx.lineWidth = Math.max(1, fontSize / 16);\n\n ctx.beginPath();\n\n if (decoration === \"underline\") {\n const underlineY = y + fontSize + 2;\n ctx.moveTo(x, underlineY);\n ctx.lineTo(x + width, underlineY);\n } else if (decoration === \"line-through\" || decoration === \"strikethrough\") {\n const lineThroughY = y + fontSize / 2;\n ctx.moveTo(x, lineThroughY);\n ctx.lineTo(x + width, lineThroughY);\n } else if (decoration === \"overline\") {\n ctx.moveTo(x, y);\n ctx.lineTo(x + width, y);\n }\n\n ctx.stroke();\n}\n\n/**\n * Apply overflow clipping\n */\nfunction applyOverflowClip(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const props = node.props;\n const overflow = props.overflow || \"visible\";\n\n if (overflow === \"hidden\" || overflow === \"scroll\" || overflow === \"auto\") {\n const layout = node.layout!;\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n const radius = layout.border.radius;\n\n ctx.save();\n ctx.beginPath();\n\n if (radius > 0) {\n drawRoundedRect(ctx, x, y, width, height, radius);\n } else {\n ctx.rect(x, y, width, height);\n }\n\n ctx.clip();\n }\n}\n\n/**\n * Helper: Draw a star shape\n */\nfunction drawStar(\n ctx: CanvasRenderingContext2D,\n cx: number,\n cy: number,\n spikes: number,\n outerRadius: number,\n innerRadius: number\n): void {\n let rot = (Math.PI / 2) * 3;\n let x = cx;\n let y = cy;\n const step = Math.PI / spikes;\n\n ctx.beginPath();\n ctx.moveTo(cx, cy - outerRadius);\n\n for (let i = 0; i < spikes; i++) {\n x = cx + Math.cos(rot) * outerRadius;\n y = cy + Math.sin(rot) * outerRadius;\n ctx.lineTo(x, y);\n rot += step;\n\n x = cx + Math.cos(rot) * innerRadius;\n y = cy + Math.sin(rot) * innerRadius;\n ctx.lineTo(x, y);\n rot += step;\n }\n\n ctx.lineTo(cx, cy - outerRadius);\n ctx.closePath();\n}\n\n\n\n\n\n\n\n\n\n"
6
+ "/**\n * Text Rendering System\n *\n * Text measurement, wrapping, and rendering\n */\n\nimport type { FontStyle, TextMetrics, TextStyle } from \"./types.js\";\nimport { createFontString } from \"./utils.js\";\nimport { frameworkLoggers } from \"@hypen-space/core/logger\";\n\nconst log = frameworkLoggers.canvas;\n\n/**\n * Text metrics cache\n */\nconst textMetricsCache = new Map<string, TextMetrics>();\n\n/**\n * Get cache key for text metrics\n */\nfunction getCacheKey(text: string, fontStyle: FontStyle, maxWidth?: number): string {\n return `${text}|${fontStyle.fontSize}|${fontStyle.fontWeight}|${fontStyle.fontFamily}|${maxWidth || \"auto\"}`;\n}\n\n/**\n * Measure text dimensions\n */\nexport function measureText(\n ctx: CanvasRenderingContext2D,\n text: string,\n fontStyle: FontStyle,\n maxWidth?: number\n): TextMetrics {\n const cacheKey = getCacheKey(text, fontStyle, maxWidth);\n const cached = textMetricsCache.get(cacheKey);\n if (cached) return cached;\n\n const font = createFontString(fontStyle.fontSize, fontStyle.fontWeight, fontStyle.fontFamily);\n ctx.save();\n ctx.font = font;\n\n const lineHeight = fontStyle.lineHeight || fontStyle.fontSize * 1.2;\n\n // No wrapping needed\n if (!maxWidth) {\n const metrics = ctx.measureText(text);\n const result: TextMetrics = {\n width: metrics.width,\n height: lineHeight,\n lines: [text],\n lineHeight,\n };\n ctx.restore();\n textMetricsCache.set(cacheKey, result);\n return result;\n }\n\n // Wrap text\n const lines = wrapText(ctx, text, maxWidth);\n const width = Math.max(...lines.map((line) => ctx.measureText(line).width));\n const height = lines.length * lineHeight;\n\n const result: TextMetrics = {\n width,\n height,\n lines,\n lineHeight,\n };\n\n ctx.restore();\n textMetricsCache.set(cacheKey, result);\n return result;\n}\n\n/**\n * Wrap text to fit within maxWidth\n */\nfunction wrapText(ctx: CanvasRenderingContext2D, text: string, maxWidth: number): string[] {\n const lines: string[] = [];\n const paragraphs = text.split(\"\\n\");\n\n for (const paragraph of paragraphs) {\n const words = paragraph.split(\" \");\n let currentLine = \"\";\n\n for (const word of words) {\n const testLine = currentLine ? `${currentLine} ${word}` : word;\n const metrics = ctx.measureText(testLine);\n\n if (metrics.width > maxWidth && currentLine) {\n lines.push(currentLine);\n currentLine = word;\n } else {\n currentLine = testLine;\n }\n }\n\n if (currentLine) {\n lines.push(currentLine);\n }\n }\n\n return lines.length > 0 ? lines : [\"\"];\n}\n\n/**\n * Render text with style\n */\nexport function renderText(\n ctx: CanvasRenderingContext2D,\n text: string,\n x: number,\n y: number,\n width: number,\n height: number,\n style: TextStyle\n): void {\n const font = createFontString(style.fontSize, style.fontWeight, style.fontFamily);\n ctx.save();\n ctx.font = font;\n ctx.fillStyle = style.color;\n ctx.textBaseline = \"top\";\n\n const metrics = measureText(ctx, text, style, width);\n\n // Calculate starting Y based on vertical alignment\n let startY = y;\n if (style.verticalAlign === \"middle\") {\n startY = y + (height - metrics.height) / 2;\n } else if (style.verticalAlign === \"bottom\") {\n startY = y + height - metrics.height;\n }\n\n // Render each line\n for (let i = 0; i < metrics.lines.length; i++) {\n const line = metrics.lines[i];\n const lineY = startY + i * metrics.lineHeight;\n\n // Calculate X based on text alignment\n let lineX = x;\n if (style.textAlign === \"center\") {\n const lineWidth = ctx.measureText(line).width;\n lineX = x + (width - lineWidth) / 2;\n } else if (style.textAlign === \"right\") {\n const lineWidth = ctx.measureText(line).width;\n lineX = x + width - lineWidth;\n }\n\n ctx.fillText(line, lineX, lineY);\n }\n\n ctx.restore();\n}\n\n/**\n * Clear text metrics cache\n */\nexport function clearTextCache(): void {\n textMetricsCache.clear();\n}\n\n/**\n * Preload font to ensure it's available\n */\nexport async function loadFont(fontFamily: string, fontWeight: string | number = \"normal\"): Promise<void> {\n if (!(\"fonts\" in document)) return;\n\n const font = `${fontWeight} 16px ${fontFamily}`;\n try {\n await document.fonts.load(font);\n } catch (error) {\n log.warn(`Failed to load font: ${font}`, error);\n }\n}\n\n\n\n\n\n\n\n\n\n\n\n",
7
+ "/**\n * Paint System\n *\n * Drawing virtual nodes to canvas\n */\n\nimport type { VirtualNode, PainterFunction } from \"./types.js\";\nimport { renderText } from \"./text.js\";\n\n/**\n * Custom painters registry\n */\nconst customPainters = new Map<string, PainterFunction>();\n\n/**\n * Register a custom painter for a component type\n */\nexport function registerPainter(type: string, painter: PainterFunction): void {\n customPainters.set(type.toLowerCase(), painter);\n}\n\n/**\n * Paint a virtual node and its children\n */\nexport function paintNode(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n if (!node.visible || !node.layout) return;\n\n ctx.save();\n\n // Apply transforms\n applyTransforms(ctx, node);\n\n // Apply opacity\n if (node.opacity < 1) {\n ctx.globalAlpha = node.opacity;\n }\n\n // Check for custom painter\n const customPainter = customPainters.get(node.type.toLowerCase());\n if (customPainter) {\n customPainter(ctx, node);\n ctx.restore();\n return;\n }\n\n // Default painting based on type\n switch (node.type.toLowerCase()) {\n case \"column\":\n case \"row\":\n case \"stack\":\n paintContainer(ctx, node);\n break;\n case \"text\":\n paintText(ctx, node);\n break;\n case \"button\":\n paintButton(ctx, node);\n break;\n case \"input\":\n paintInput(ctx, node);\n break;\n case \"image\":\n paintImage(ctx, node);\n break;\n case \"spacer\":\n // Spacer is invisible, just takes up space\n break;\n case \"divider\":\n case \"separator\":\n paintDivider(ctx, node);\n break;\n case \"checkbox\":\n paintCheckbox(ctx, node);\n break;\n case \"radio\":\n paintRadio(ctx, node);\n break;\n case \"switch\":\n case \"toggle\":\n paintSwitch(ctx, node);\n break;\n case \"slider\":\n paintSlider(ctx, node);\n break;\n case \"progress\":\n case \"progressbar\":\n paintProgress(ctx, node);\n break;\n case \"spinner\":\n case \"loading\":\n paintSpinner(ctx, node);\n break;\n case \"card\":\n paintCard(ctx, node);\n break;\n case \"badge\":\n paintBadge(ctx, node);\n break;\n case \"avatar\":\n paintAvatar(ctx, node);\n break;\n case \"icon\":\n paintIcon(ctx, node);\n break;\n case \"link\":\n paintLink(ctx, node);\n break;\n case \"app\":\n case \"container\":\n case \"box\":\n paintContainer(ctx, node);\n break;\n default:\n paintContainer(ctx, node);\n }\n\n ctx.restore();\n\n // Paint children\n for (const child of node.children) {\n paintNode(ctx, child);\n }\n\n // Restore context if overflow clipping was applied\n if ((node as any)._needsRestore) {\n ctx.restore();\n delete (node as any)._needsRestore;\n }\n}\n\n/**\n * Paint a container (Column, Row, Stack, Box)\n */\nfunction paintContainer(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n const radius = layout.border.radius;\n\n // Apply shadow if specified\n const shadow = props.shadow || props.boxShadow;\n if (shadow) {\n applyShadow(ctx, shadow);\n }\n\n // Draw background\n const backgroundColor = props.backgroundColor || props.background;\n if (backgroundColor) {\n // Support for gradients\n if (typeof backgroundColor === \"string\" && backgroundColor.includes(\"gradient\")) {\n ctx.fillStyle = parseGradient(ctx, backgroundColor, x, y, width, height);\n } else {\n ctx.fillStyle = backgroundColor;\n }\n\n if (radius > 0) {\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n } else {\n ctx.fillRect(x, y, width, height);\n }\n }\n\n // Reset shadow for border\n if (shadow) {\n ctx.shadowColor = \"transparent\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n }\n\n // Draw border\n if (layout.border.width > 0 && layout.border.color !== \"transparent\") {\n ctx.strokeStyle = layout.border.color;\n ctx.lineWidth = layout.border.width;\n if (radius > 0) {\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.stroke();\n } else {\n ctx.strokeRect(x, y, width, height);\n }\n }\n\n // Apply overflow clipping for children\n const overflow = props.overflow || \"visible\";\n if (overflow === \"hidden\" || overflow === \"scroll\" || overflow === \"auto\") {\n ctx.save();\n ctx.beginPath();\n if (radius > 0) {\n drawRoundedRect(ctx, x, y, width, height, radius);\n } else {\n ctx.rect(x, y, width, height);\n }\n ctx.clip();\n\n // Mark that we need to restore later\n (node as any)._needsRestore = true;\n }\n}\n\n/**\n * Paint text node\n */\nfunction paintText(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n let text = String(props[0] || props.text || \"\");\n const color = props.color || \"#000000\";\n const fontSize = parseFloat(props.fontSize) || 16;\n const fontWeight = props.fontWeight || \"normal\";\n const fontFamily = props.fontFamily || \"system-ui, sans-serif\";\n const textAlign = props.textAlign || \"left\";\n const lineHeight = parseFloat(props.lineHeight) || fontSize * 1.2;\n const textDecoration = props.textDecoration || \"none\";\n const textTransform = props.textTransform || \"none\";\n const letterSpacing = parseFloat(props.letterSpacing) || 0;\n\n // Apply text transform\n if (textTransform === \"uppercase\") {\n text = text.toUpperCase();\n } else if (textTransform === \"lowercase\") {\n text = text.toLowerCase();\n } else if (textTransform === \"capitalize\") {\n text = text.replace(/\\b\\w/g, (char) => char.toUpperCase());\n }\n\n // Apply text shadow if specified\n const textShadow = props.textShadow || props.shadow;\n if (textShadow) {\n applyShadow(ctx, textShadow);\n }\n\n // Handle letter spacing\n const x = layout.x + layout.contentX;\n const y = layout.y + layout.contentY;\n\n if (letterSpacing !== 0) {\n // Manual letter spacing\n ctx.fillStyle = color;\n ctx.font = `${fontWeight} ${fontSize}px ${fontFamily}`;\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"top\";\n\n let currentX = x;\n for (let i = 0; i < text.length; i++) {\n ctx.fillText(text[i], currentX, y);\n currentX += ctx.measureText(text[i]).width;\n // Add letter spacing after each character except the last\n if (i < text.length - 1) {\n currentX += letterSpacing;\n }\n }\n\n // Text decoration with letter spacing (now correct width)\n if (textDecoration !== \"none\") {\n applyTextDecoration(ctx, textDecoration, color, x, y, currentX - x, fontSize);\n }\n } else {\n // Normal text rendering\n renderText(\n ctx,\n text,\n x,\n y,\n layout.contentWidth,\n layout.contentHeight,\n {\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign: textAlign as any,\n verticalAlign: \"top\",\n lineHeight,\n }\n );\n\n // Text decoration (need to set font again for measurement)\n if (textDecoration !== \"none\") {\n ctx.font = `${fontWeight} ${fontSize}px ${fontFamily}`;\n const textWidth = ctx.measureText(text).width;\n applyTextDecoration(ctx, textDecoration, color, x, y, textWidth, fontSize);\n }\n }\n\n // Reset shadow\n if (textShadow) {\n ctx.shadowColor = \"transparent\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n }\n}\n\n/**\n * Paint button node\n */\nfunction paintButton(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n const radius = layout.border.radius || 4;\n\n // Apply shadow if specified\n const shadow = props.shadow || props.boxShadow;\n if (shadow) {\n applyShadow(ctx, shadow);\n }\n\n // Background color based on state\n let backgroundColor = props.backgroundColor || \"#007bff\";\n if (node.hovered) {\n backgroundColor = props.hoverColor || \"#0056b3\";\n }\n if (node.focused) {\n backgroundColor = props.focusColor || \"#004085\";\n }\n\n // Support gradients for button background\n if (typeof backgroundColor === \"string\" && backgroundColor.includes(\"gradient\")) {\n ctx.fillStyle = parseGradient(ctx, backgroundColor, x, y, width, height);\n } else {\n ctx.fillStyle = backgroundColor;\n }\n\n // Draw button background\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n\n // Reset shadow for border\n if (shadow) {\n ctx.shadowColor = \"transparent\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n }\n\n // Draw border\n if (layout.border.width > 0) {\n ctx.strokeStyle = layout.border.color;\n ctx.lineWidth = layout.border.width;\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.stroke();\n }\n\n // Paint children (typically Text)\n for (const child of node.children) {\n paintNode(ctx, child);\n }\n}\n\n/**\n * Paint input node\n */\nfunction paintInput(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n const radius = layout.border.radius || 4;\n\n // Background\n ctx.fillStyle = props.backgroundColor || \"#ffffff\";\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n\n // Border (thicker if focused)\n const borderColor = node.focused ? \"#007bff\" : (layout.border.color || \"#cccccc\");\n const borderWidth = node.focused ? 2 : (layout.border.width || 1);\n ctx.strokeStyle = borderColor;\n ctx.lineWidth = borderWidth;\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.stroke();\n\n // Input value text\n const value = props.value || \"\";\n const placeholder = props.placeholder || \"\";\n const text = value || placeholder;\n const textColor = value ? (props.color || \"#000000\") : \"#999999\";\n\n if (text) {\n const fontSize = parseFloat(props.fontSize) || 16;\n const fontWeight = props.fontWeight || \"normal\";\n const fontFamily = props.fontFamily || \"system-ui, sans-serif\";\n const lineHeight = parseFloat(props.lineHeight) || fontSize * 1.2;\n\n renderText(\n ctx,\n text,\n layout.x + layout.contentX,\n layout.y + layout.contentY,\n layout.contentWidth,\n layout.contentHeight,\n {\n color: textColor,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign: \"left\",\n verticalAlign: \"middle\",\n lineHeight,\n }\n );\n }\n}\n\n/**\n * Paint image node\n */\nfunction paintImage(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const src = props.src || props[0];\n if (!src) return;\n\n // TODO: Load and cache images\n // For now, just draw a placeholder\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n\n ctx.fillStyle = \"#e0e0e0\";\n ctx.fillRect(x, y, width, height);\n\n ctx.strokeStyle = \"#999999\";\n ctx.lineWidth = 1;\n ctx.strokeRect(x, y, width, height);\n\n // Draw \"IMG\" text\n ctx.fillStyle = \"#666666\";\n ctx.font = \"14px sans-serif\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(\"IMG\", x + width / 2, y + height / 2);\n}\n\n/**\n * Draw rounded rectangle path\n */\nfunction drawRoundedRect(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n width: number,\n height: number,\n radius: number\n): void {\n if (radius <= 0) {\n ctx.rect(x, y, width, height);\n return;\n }\n\n ctx.beginPath();\n ctx.moveTo(x + radius, y);\n ctx.lineTo(x + width - radius, y);\n ctx.arcTo(x + width, y, x + width, y + radius, radius);\n ctx.lineTo(x + width, y + height - radius);\n ctx.arcTo(x + width, y + height, x + width - radius, y + height, radius);\n ctx.lineTo(x + radius, y + height);\n ctx.arcTo(x, y + height, x, y + height - radius, radius);\n ctx.lineTo(x, y + radius);\n ctx.arcTo(x, y, x + radius, y, radius);\n ctx.closePath();\n}\n\n/**\n * Apply shadow to canvas context\n * Supports both simple and CSS-like shadow syntax:\n * - Simple: \"2 2 4 rgba(0,0,0,0.3)\"\n * - CSS-like: \"2px 2px 4px rgba(0,0,0,0.3)\"\n * - Named: {offsetX: 2, offsetY: 2, blur: 4, color: \"rgba(0,0,0,0.3)\"}\n */\nfunction applyShadow(ctx: CanvasRenderingContext2D, shadow: any): void {\n if (typeof shadow === \"string\") {\n // Parse CSS-like shadow string: \"offsetX offsetY blur color\"\n const parts = shadow.trim().split(/\\s+/);\n if (parts.length >= 3) {\n const offsetX = parseFloat(parts[0]);\n const offsetY = parseFloat(parts[1]);\n const blur = parseFloat(parts[2]);\n const color = parts.slice(3).join(\" \") || \"rgba(0,0,0,0.3)\";\n\n ctx.shadowOffsetX = offsetX;\n ctx.shadowOffsetY = offsetY;\n ctx.shadowBlur = blur;\n ctx.shadowColor = color;\n }\n } else if (typeof shadow === \"object\") {\n // Object syntax\n ctx.shadowOffsetX = shadow.offsetX || 0;\n ctx.shadowOffsetY = shadow.offsetY || 0;\n ctx.shadowBlur = shadow.blur || 0;\n ctx.shadowColor = shadow.color || \"rgba(0,0,0,0.3)\";\n }\n}\n\n/**\n * Parse gradient string and create canvas gradient\n * Supports:\n * - linear-gradient(direction, color1, color2, ...)\n * - radial-gradient(color1, color2, ...)\n */\nfunction parseGradient(\n ctx: CanvasRenderingContext2D,\n gradientStr: string,\n x: number,\n y: number,\n width: number,\n height: number\n): CanvasGradient | string {\n // Simple gradient parsing\n if (gradientStr.startsWith(\"linear-gradient\")) {\n // Extract content between parentheses\n const match = gradientStr.match(/linear-gradient\\((.*)\\)/);\n if (!match) return gradientStr;\n\n const parts = match[1].split(\",\").map((s) => s.trim());\n\n // Determine direction (default to bottom)\n let x0 = x, y0 = y, x1 = x, y1 = y + height;\n let colorStart = 0;\n\n if (parts[0].includes(\"deg\") || parts[0].includes(\"to \")) {\n colorStart = 1;\n const direction = parts[0];\n\n if (direction.includes(\"to right\") || direction === \"90deg\") {\n x1 = x + width;\n y1 = y;\n } else if (direction.includes(\"to left\") || direction === \"270deg\") {\n x0 = x + width;\n x1 = x;\n y0 = y;\n y1 = y;\n } else if (direction.includes(\"to top\") || direction === \"0deg\") {\n y0 = y + height;\n y1 = y;\n }\n // Default is \"to bottom\" which we already set\n }\n\n const gradient = ctx.createLinearGradient(x0, y0, x1, y1);\n\n // Add color stops\n const colors = parts.slice(colorStart);\n colors.forEach((color, i) => {\n const stop = i / (colors.length - 1);\n gradient.addColorStop(stop, color.trim());\n });\n\n return gradient;\n } else if (gradientStr.startsWith(\"radial-gradient\")) {\n // Extract content between parentheses\n const match = gradientStr.match(/radial-gradient\\((.*)\\)/);\n if (!match) return gradientStr;\n\n const parts = match[1].split(\",\").map((s) => s.trim());\n\n // Create radial gradient from center\n const centerX = x + width / 2;\n const centerY = y + height / 2;\n const radius = Math.max(width, height) / 2;\n\n const gradient = ctx.createRadialGradient(centerX, centerY, 0, centerX, centerY, radius);\n\n // Add color stops\n parts.forEach((color, i) => {\n const stop = i / (parts.length - 1);\n gradient.addColorStop(stop, color.trim());\n });\n\n return gradient;\n }\n\n return gradientStr;\n}\n\n/**\n * Apply CSS-like transforms to canvas context\n * Supports:\n * - translate(x, y)\n * - rotate(angle)\n * - scale(x, y)\n * - skew(x, y)\n * - transform: \"translate(10, 20) rotate(45) scale(1.5)\"\n */\nfunction applyTransforms(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const props = node.props;\n const layout = node.layout!;\n\n // Get transform origin (default to center)\n const originX = parseFloat(props.transformOriginX) || 0.5;\n const originY = parseFloat(props.transformOriginY) || 0.5;\n\n const centerX = layout.x + layout.width * originX;\n const centerY = layout.y + layout.height * originY;\n\n // Check for individual transform properties\n const translateX = parseFloat(props.translateX) || 0;\n const translateY = parseFloat(props.translateY) || 0;\n const rotate = parseFloat(props.rotate) || 0; // in degrees\n const scaleX = parseFloat(props.scaleX) || parseFloat(props.scale) || 1;\n const scaleY = parseFloat(props.scaleY) || parseFloat(props.scale) || 1;\n const skewX = parseFloat(props.skewX) || parseFloat(props.skew) || 0; // in degrees\n const skewY = parseFloat(props.skewY) || 0; // in degrees\n\n // Apply transforms in order: translate to origin, scale, rotate, skew, translate back, translate by offset\n if (translateX !== 0 || translateY !== 0 || rotate !== 0 || scaleX !== 1 || scaleY !== 1 || skewX !== 0 || skewY !== 0) {\n // Move to transform origin\n ctx.translate(centerX, centerY);\n\n // Apply scale\n if (scaleX !== 1 || scaleY !== 1) {\n ctx.scale(scaleX, scaleY);\n }\n\n // Apply rotation (convert degrees to radians)\n if (rotate !== 0) {\n ctx.rotate((rotate * Math.PI) / 180);\n }\n\n // Apply skew using transform matrix\n if (skewX !== 0 || skewY !== 0) {\n const skewXRad = (skewX * Math.PI) / 180;\n const skewYRad = (skewY * Math.PI) / 180;\n ctx.transform(1, Math.tan(skewYRad), Math.tan(skewXRad), 1, 0, 0);\n }\n\n // Move back from origin and apply translation\n ctx.translate(-centerX + translateX, -centerY + translateY);\n }\n\n // Also support compound transform string (optional, for future extensibility)\n if (props.transform && typeof props.transform === \"string\") {\n parseTransformString(ctx, props.transform, centerX, centerY);\n }\n}\n\n/**\n * Parse and apply a CSS-like transform string\n */\nfunction parseTransformString(\n ctx: CanvasRenderingContext2D,\n transformStr: string,\n originX: number,\n originY: number\n): void {\n // Simple transform parsing - matches translate(), rotate(), scale()\n const transforms = transformStr.match(/(\\w+)\\(([^)]+)\\)/g);\n if (!transforms) return;\n\n ctx.translate(originX, originY);\n\n for (const transform of transforms) {\n const match = transform.match(/(\\w+)\\(([^)]+)\\)/);\n if (!match) continue;\n\n const [, func, args] = match;\n const values = args.split(\",\").map((v) => parseFloat(v.trim()));\n\n switch (func.toLowerCase()) {\n case \"translate\":\n ctx.translate(values[0] || 0, values[1] || 0);\n break;\n case \"rotate\":\n ctx.rotate((values[0] * Math.PI) / 180);\n break;\n case \"scale\":\n ctx.scale(values[0] || 1, values[1] || values[0] || 1);\n break;\n }\n }\n\n ctx.translate(-originX, -originY);\n}\n\n/**\n * Paint divider/separator node\n */\nfunction paintDivider(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const orientation = props.orientation || \"horizontal\";\n const color = props.color || props.backgroundColor || \"#e0e0e0\";\n const thickness = parseFloat(props.thickness) || 1;\n\n ctx.strokeStyle = color;\n ctx.lineWidth = thickness;\n ctx.beginPath();\n\n if (orientation === \"vertical\") {\n const x = layout.x + layout.width / 2;\n ctx.moveTo(x, layout.y);\n ctx.lineTo(x, layout.y + layout.height);\n } else {\n const y = layout.y + layout.height / 2;\n ctx.moveTo(layout.x, y);\n ctx.lineTo(layout.x + layout.width, y);\n }\n\n ctx.stroke();\n}\n\n/**\n * Paint checkbox node\n */\nfunction paintCheckbox(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const size = Math.min(layout.width, layout.height);\n const x = layout.x;\n const y = layout.y;\n\n // Properly parse boolean values (handle string \"false\")\n const checkedValue = props.checked !== undefined ? props.checked : props.value;\n const checked = checkedValue === true || checkedValue === \"true\" || (checkedValue !== false && checkedValue !== \"false\" && !!checkedValue);\n\n const radius = parseFloat(props.borderRadius) || 2;\n\n // Background\n const bgColor = checked ? (props.checkedColor || \"#007bff\") : (props.backgroundColor || \"#ffffff\");\n ctx.fillStyle = bgColor;\n drawRoundedRect(ctx, x, y, size, size, radius);\n ctx.fill();\n\n // Border\n const borderColor = checked ? (props.checkedColor || \"#007bff\") : (props.borderColor || \"#cccccc\");\n ctx.strokeStyle = borderColor;\n ctx.lineWidth = node.focused ? 2 : 1;\n drawRoundedRect(ctx, x, y, size, size, radius);\n ctx.stroke();\n\n // Checkmark\n if (checked) {\n ctx.strokeStyle = props.checkColor || \"#ffffff\";\n ctx.lineWidth = 2;\n ctx.lineCap = \"round\";\n ctx.lineJoin = \"round\";\n\n const padding = size * 0.25;\n ctx.beginPath();\n ctx.moveTo(x + padding, y + size / 2);\n ctx.lineTo(x + size * 0.4, y + size - padding);\n ctx.lineTo(x + size - padding, y + padding);\n ctx.stroke();\n }\n}\n\n/**\n * Paint radio button node\n */\nfunction paintRadio(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const size = Math.min(layout.width, layout.height);\n const centerX = layout.x + size / 2;\n const centerY = layout.y + size / 2;\n const radius = size / 2;\n\n // Properly parse boolean values (handle string \"false\")\n const checkedValue = props.checked !== undefined ? props.checked : props.value;\n const checked = checkedValue === true || checkedValue === \"true\" || (checkedValue !== false && checkedValue !== \"false\" && !!checkedValue);\n\n // Outer circle background\n const bgColor = props.backgroundColor || \"#ffffff\";\n ctx.fillStyle = bgColor;\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n ctx.fill();\n\n // Outer circle border\n const borderColor = checked ? (props.checkedColor || \"#007bff\") : (props.borderColor || \"#cccccc\");\n ctx.strokeStyle = borderColor;\n ctx.lineWidth = node.focused ? 2 : 1;\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n ctx.stroke();\n\n // Inner filled circle when checked\n if (checked) {\n ctx.fillStyle = props.checkedColor || \"#007bff\";\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius * 0.5, 0, Math.PI * 2);\n ctx.fill();\n }\n}\n\n/**\n * Paint switch/toggle node\n */\nfunction paintSwitch(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const width = layout.width;\n const height = layout.height;\n const x = layout.x;\n const y = layout.y;\n\n // Properly parse boolean values (handle string \"false\")\n const checkedValue = props.checked !== undefined ? props.checked : props.value;\n const checked = checkedValue === true || checkedValue === \"true\" || (checkedValue !== false && checkedValue !== \"false\" && !!checkedValue);\n\n const radius = height / 2;\n\n // Track background\n const trackColor = checked ? (props.checkedColor || \"#4caf50\") : (props.backgroundColor || \"#cccccc\");\n ctx.fillStyle = trackColor;\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n\n // Thumb (circle)\n const thumbRadius = radius * 0.8;\n const thumbX = checked ? (x + width - radius) : (x + radius);\n const thumbY = y + radius;\n\n ctx.fillStyle = props.thumbColor || \"#ffffff\";\n ctx.beginPath();\n ctx.arc(thumbX, thumbY, thumbRadius, 0, Math.PI * 2);\n ctx.fill();\n\n // Thumb shadow\n if (props.shadow !== false) {\n ctx.shadowColor = \"rgba(0,0,0,0.2)\";\n ctx.shadowBlur = 2;\n ctx.shadowOffsetY = 1;\n ctx.beginPath();\n ctx.arc(thumbX, thumbY, thumbRadius, 0, Math.PI * 2);\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetY = 0;\n }\n}\n\n/**\n * Paint slider node\n */\nfunction paintSlider(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const width = layout.width;\n const height = layout.height;\n const x = layout.x;\n const y = layout.y;\n\n const min = parseFloat(props.min) || 0;\n const max = parseFloat(props.max) || 100;\n const value = parseFloat(props.value) || min;\n const percentage = (value - min) / (max - min);\n\n const trackHeight = parseFloat(props.trackHeight) || 4;\n const thumbSize = parseFloat(props.thumbSize) || 16;\n const trackY = y + (height - trackHeight) / 2;\n\n // Track background\n ctx.fillStyle = props.trackColor || \"#e0e0e0\";\n drawRoundedRect(ctx, x, trackY, width, trackHeight, trackHeight / 2);\n ctx.fill();\n\n // Track fill\n const fillWidth = width * percentage;\n const fillColor = props.fillColor || props.color || \"#007bff\";\n\n // Support gradient fills\n if (typeof fillColor === \"string\" && fillColor.includes(\"gradient\")) {\n ctx.fillStyle = parseGradient(ctx, fillColor, x, trackY, fillWidth, trackHeight);\n } else {\n ctx.fillStyle = fillColor;\n }\n\n drawRoundedRect(ctx, x, trackY, fillWidth, trackHeight, trackHeight / 2);\n ctx.fill();\n\n // Thumb\n const thumbX = x + fillWidth;\n const thumbY = y + height / 2;\n\n ctx.fillStyle = props.thumbColor || \"#007bff\";\n ctx.beginPath();\n ctx.arc(thumbX, thumbY, thumbSize / 2, 0, Math.PI * 2);\n ctx.fill();\n\n // Thumb border\n ctx.strokeStyle = \"#ffffff\";\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.arc(thumbX, thumbY, thumbSize / 2, 0, Math.PI * 2);\n ctx.stroke();\n}\n\n/**\n * Paint progress bar node\n */\nfunction paintProgress(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const width = layout.width;\n const height = layout.height;\n const x = layout.x;\n const y = layout.y;\n\n const min = parseFloat(props.min) || 0;\n const max = parseFloat(props.max) || 100;\n const value = parseFloat(props.value) || 0;\n const percentage = Math.min(Math.max((value - min) / (max - min), 0), 1);\n const radius = layout.border.radius || height / 2;\n\n // Background\n ctx.fillStyle = props.backgroundColor || \"#e0e0e0\";\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n\n // Progress fill\n if (percentage > 0) {\n const fillWidth = width * percentage;\n\n // Support gradient fills\n const fillColor = props.fillColor || props.color || \"#007bff\";\n if (typeof fillColor === \"string\" && fillColor.includes(\"gradient\")) {\n ctx.fillStyle = parseGradient(ctx, fillColor, x, y, fillWidth, height);\n } else {\n ctx.fillStyle = fillColor;\n }\n\n drawRoundedRect(ctx, x, y, fillWidth, height, radius);\n ctx.fill();\n }\n\n // Optional text label\n if (props.showLabel) {\n const label = props.label || `${Math.round(percentage * 100)}%`;\n ctx.fillStyle = props.labelColor || \"#ffffff\";\n ctx.font = `${props.fontSize || 12}px ${props.fontFamily || \"sans-serif\"}`;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(label, x + width / 2, y + height / 2);\n }\n}\n\n/**\n * Paint spinner/loading node\n */\nfunction paintSpinner(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const size = Math.min(layout.width, layout.height);\n const centerX = layout.x + size / 2;\n const centerY = layout.y + size / 2;\n const radius = size / 2 - 4;\n const thickness = parseFloat(props.thickness) || 4;\n const color = props.color || \"#007bff\";\n\n // Use timestamp for animation if available\n const rotation = (Date.now() / 1000) * Math.PI; // Rotate based on time\n\n ctx.strokeStyle = color;\n ctx.lineWidth = thickness;\n ctx.lineCap = \"round\";\n\n // Draw circular arc\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, rotation, rotation + Math.PI * 1.5);\n ctx.stroke();\n\n // Fade out effect\n ctx.globalAlpha = 0.3;\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n ctx.stroke();\n ctx.globalAlpha = 1;\n}\n\n/**\n * Paint card node\n */\nfunction paintCard(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n const radius = layout.border.radius || 8;\n\n // Default card shadow\n const shadow = props.shadow || props.boxShadow || \"0 2 8 rgba(0,0,0,0.1)\";\n applyShadow(ctx, shadow);\n\n // Background\n const backgroundColor = props.backgroundColor || \"#ffffff\";\n if (typeof backgroundColor === \"string\" && backgroundColor.includes(\"gradient\")) {\n ctx.fillStyle = parseGradient(ctx, backgroundColor, x, y, width, height);\n } else {\n ctx.fillStyle = backgroundColor;\n }\n\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n\n // Reset shadow\n ctx.shadowColor = \"transparent\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n\n // Border\n if (layout.border.width > 0) {\n ctx.strokeStyle = layout.border.color;\n ctx.lineWidth = layout.border.width;\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.stroke();\n }\n\n // Paint children\n for (const child of node.children) {\n paintNode(ctx, child);\n }\n}\n\n/**\n * Paint badge node\n */\nfunction paintBadge(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n const radius = layout.border.radius || height / 2;\n\n // Background\n const backgroundColor = props.backgroundColor || \"#dc3545\";\n ctx.fillStyle = backgroundColor;\n drawRoundedRect(ctx, x, y, width, height, radius);\n ctx.fill();\n\n // Text content\n const text = String(props[0] || props.text || \"\");\n if (text) {\n ctx.fillStyle = props.color || \"#ffffff\";\n ctx.font = `${props.fontWeight || \"bold\"} ${props.fontSize || 10}px ${props.fontFamily || \"sans-serif\"}`;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(text, x + width / 2, y + height / 2);\n }\n}\n\n/**\n * Paint avatar node\n */\nfunction paintAvatar(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const size = Math.min(layout.width, layout.height);\n const centerX = layout.x + size / 2;\n const centerY = layout.y + size / 2;\n const radius = size / 2;\n\n // Clip to circle\n ctx.save();\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n ctx.clip();\n\n // Background\n const backgroundColor = props.backgroundColor || \"#cccccc\";\n ctx.fillStyle = backgroundColor;\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n ctx.fill();\n\n // Text initials if provided\n const text = String(props[0] || props.text || props.initials || \"\");\n if (text) {\n ctx.fillStyle = props.color || \"#ffffff\";\n ctx.font = `${props.fontWeight || \"bold\"} ${props.fontSize || size / 2.5}px ${props.fontFamily || \"sans-serif\"}`;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(text, centerX, centerY);\n }\n\n ctx.restore();\n\n // Border\n if (layout.border.width > 0) {\n ctx.strokeStyle = layout.border.color;\n ctx.lineWidth = layout.border.width;\n ctx.beginPath();\n ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n ctx.stroke();\n }\n}\n\n/**\n * Paint icon node (simple placeholder - real icons would need SVG path support)\n */\nfunction paintIcon(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const size = Math.min(layout.width, layout.height);\n const x = layout.x;\n const y = layout.y;\n const color = props.color || \"#000000\";\n const iconName = props.icon || props.name || \"circle\";\n\n ctx.fillStyle = color;\n ctx.strokeStyle = color;\n ctx.lineWidth = 2;\n\n // Simple icon shapes\n switch (iconName.toLowerCase()) {\n case \"circle\":\n ctx.beginPath();\n ctx.arc(x + size / 2, y + size / 2, size / 3, 0, Math.PI * 2);\n ctx.fill();\n break;\n\n case \"square\":\n const padding = size * 0.2;\n ctx.fillRect(x + padding, y + padding, size - padding * 2, size - padding * 2);\n break;\n\n case \"star\":\n drawStar(ctx, x + size / 2, y + size / 2, 5, size / 3, size / 6);\n ctx.fill();\n break;\n\n case \"check\":\n case \"checkmark\":\n const p = size * 0.2;\n ctx.beginPath();\n ctx.moveTo(x + p, y + size / 2);\n ctx.lineTo(x + size * 0.4, y + size - p);\n ctx.lineTo(x + size - p, y + p);\n ctx.stroke();\n break;\n\n case \"x\":\n case \"close\":\n const pd = size * 0.2;\n ctx.beginPath();\n ctx.moveTo(x + pd, y + pd);\n ctx.lineTo(x + size - pd, y + size - pd);\n ctx.moveTo(x + size - pd, y + pd);\n ctx.lineTo(x + pd, y + size - pd);\n ctx.stroke();\n break;\n\n default:\n // Default: filled circle\n ctx.beginPath();\n ctx.arc(x + size / 2, y + size / 2, size / 3, 0, Math.PI * 2);\n ctx.fill();\n }\n}\n\n/**\n * Paint link node\n */\nfunction paintLink(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const layout = node.layout!;\n const props = node.props;\n\n const text = String(props[0] || props.text || \"\");\n const color = node.hovered ? (props.hoverColor || \"#0056b3\") : (props.color || \"#007bff\");\n const fontSize = parseFloat(props.fontSize) || 16;\n const fontWeight = props.fontWeight || \"normal\";\n const fontFamily = props.fontFamily || \"system-ui, sans-serif\";\n const textDecoration = props.textDecoration !== undefined ? props.textDecoration : \"underline\";\n\n ctx.fillStyle = color;\n ctx.font = `${fontWeight} ${fontSize}px ${fontFamily}`;\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"top\";\n\n const x = layout.x + layout.contentX;\n const y = layout.y + layout.contentY;\n\n ctx.fillText(text, x, y);\n\n // Underline\n if (textDecoration === \"underline\") {\n const textWidth = ctx.measureText(text).width;\n ctx.strokeStyle = color;\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(x, y + fontSize + 2);\n ctx.lineTo(x + textWidth, y + fontSize + 2);\n ctx.stroke();\n }\n}\n\n/**\n * Apply text decoration (underline, line-through, etc.)\n */\nfunction applyTextDecoration(\n ctx: CanvasRenderingContext2D,\n decoration: string,\n color: string,\n x: number,\n y: number,\n width: number,\n fontSize: number\n): void {\n ctx.strokeStyle = color;\n ctx.lineWidth = Math.max(1, fontSize / 16);\n\n ctx.beginPath();\n\n if (decoration === \"underline\") {\n const underlineY = y + fontSize + 2;\n ctx.moveTo(x, underlineY);\n ctx.lineTo(x + width, underlineY);\n } else if (decoration === \"line-through\" || decoration === \"strikethrough\") {\n const lineThroughY = y + fontSize / 2;\n ctx.moveTo(x, lineThroughY);\n ctx.lineTo(x + width, lineThroughY);\n } else if (decoration === \"overline\") {\n ctx.moveTo(x, y);\n ctx.lineTo(x + width, y);\n }\n\n ctx.stroke();\n}\n\n/**\n * Apply overflow clipping\n */\nfunction applyOverflowClip(ctx: CanvasRenderingContext2D, node: VirtualNode): void {\n const props = node.props;\n const overflow = props.overflow || \"visible\";\n\n if (overflow === \"hidden\" || overflow === \"scroll\" || overflow === \"auto\") {\n const layout = node.layout!;\n const x = layout.x;\n const y = layout.y;\n const width = layout.width;\n const height = layout.height;\n const radius = layout.border.radius;\n\n ctx.save();\n ctx.beginPath();\n\n if (radius > 0) {\n drawRoundedRect(ctx, x, y, width, height, radius);\n } else {\n ctx.rect(x, y, width, height);\n }\n\n ctx.clip();\n }\n}\n\n/**\n * Helper: Draw a star shape\n */\nfunction drawStar(\n ctx: CanvasRenderingContext2D,\n cx: number,\n cy: number,\n spikes: number,\n outerRadius: number,\n innerRadius: number\n): void {\n let rot = (Math.PI / 2) * 3;\n let x = cx;\n let y = cy;\n const step = Math.PI / spikes;\n\n ctx.beginPath();\n ctx.moveTo(cx, cy - outerRadius);\n\n for (let i = 0; i < spikes; i++) {\n x = cx + Math.cos(rot) * outerRadius;\n y = cy + Math.sin(rot) * outerRadius;\n ctx.lineTo(x, y);\n rot += step;\n\n x = cx + Math.cos(rot) * innerRadius;\n y = cy + Math.sin(rot) * innerRadius;\n ctx.lineTo(x, y);\n rot += step;\n }\n\n ctx.lineTo(cx, cy - outerRadius);\n ctx.closePath();\n}\n\n\n\n\n\n\n\n\n\n"
8
8
  ],
9
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,SAAS,YAAY,CAAC,OAAwB;AAAA,EACnD,IAAI,OAAO,UAAU,UAAU;AAAA,IAC7B,OAAO,EAAE,KAAK,OAAO,OAAO,OAAO,QAAQ,OAAO,MAAM,MAAM;AAAA,EAChE;AAAA,EAEA,IAAI,OAAO,UAAU,UAAU;AAAA,IAC7B,MAAM,QAAQ,MAAM,MAAM,KAAK,EAAE,IAAI,CAAC,MAAM,WAAW,CAAC,KAAK,CAAC;AAAA,IAC9D,IAAI,MAAM,WAAW,GAAG;AAAA,MACtB,OAAO,EAAE,KAAK,MAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,MAAM,IAAI,MAAM,MAAM,GAAG;AAAA,IAC5E;AAAA,IACA,IAAI,MAAM,WAAW,GAAG;AAAA,MACtB,OAAO,EAAE,KAAK,MAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,MAAM,IAAI,MAAM,MAAM,GAAG;AAAA,IAC5E;AAAA,IACA,IAAI,M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/B,IAAI,UAAU;AAAA;",
10
+ "debugId": "07A6963F6299A38264756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Canvas Renderer
3
+ *
4
+ * Main renderer class that orchestrates layout, painting, and events
5
+ */
6
+ import type { Renderer } from "@hypen-space/core/renderer";
7
+ import type { Patch } from "@hypen-space/core/types";
8
+ interface IEngine {
9
+ dispatchAction(name: string, payload?: any): void;
10
+ }
11
+ import type { VirtualNode, CanvasRendererOptions, PainterFunction } from "./types.js";
12
+ /**
13
+ * Canvas Renderer
14
+ */
15
+ export declare class CanvasRenderer implements Renderer {
16
+ private canvas;
17
+ private ctx;
18
+ private engine;
19
+ private options;
20
+ private rootNode;
21
+ private nodes;
22
+ private eventManager;
23
+ private inputOverlay;
24
+ private accessibilityLayer;
25
+ private rafId;
26
+ private needsRedraw;
27
+ private frameCount;
28
+ private lastFrameTime;
29
+ constructor(canvas: HTMLCanvasElement, engine: IEngine, options?: Partial<CanvasRendererOptions>);
30
+ /**
31
+ * Setup HiDPI rendering
32
+ */
33
+ private setupHiDPI;
34
+ /**
35
+ * Apply patches from engine
36
+ */
37
+ applyPatches(patches: Patch[]): void;
38
+ /**
39
+ * Apply single patch
40
+ */
41
+ private applyPatch;
42
+ /**
43
+ * Create new virtual node
44
+ */
45
+ private onCreate;
46
+ /**
47
+ * Set property on node
48
+ */
49
+ private onSetProp;
50
+ /**
51
+ * Set text on node
52
+ */
53
+ private onSetText;
54
+ /**
55
+ * Insert node into tree
56
+ */
57
+ private onInsert;
58
+ /**
59
+ * Move node in tree
60
+ */
61
+ private onMove;
62
+ /**
63
+ * Remove node from tree
64
+ */
65
+ private onRemove;
66
+ /**
67
+ * Schedule redraw
68
+ */
69
+ private scheduleRedraw;
70
+ /**
71
+ * Main render function
72
+ */
73
+ private render;
74
+ /**
75
+ * Draw layout bounds for debugging
76
+ */
77
+ private drawLayoutBounds;
78
+ /**
79
+ * Get node by ID
80
+ */
81
+ getNode(id: string): VirtualNode | undefined;
82
+ /**
83
+ * Clear renderer
84
+ */
85
+ clear(): void;
86
+ /**
87
+ * Register custom painter
88
+ */
89
+ registerPainter(type: string, painter: PainterFunction): void;
90
+ /**
91
+ * Set renderer options
92
+ */
93
+ setOptions(options: Partial<CanvasRendererOptions>): void;
94
+ /**
95
+ * Destroy renderer
96
+ */
97
+ destroy(): void;
98
+ }
99
+ export {};
@@ -151,7 +151,7 @@ function getAbsoluteBounds(node) {
151
151
  }
152
152
 
153
153
  // src/canvas/text.ts
154
- import { frameworkLoggers } from "@hypen-space/core";
154
+ import { frameworkLoggers } from "@hypen-space/core/logger";
155
155
  var log = frameworkLoggers.canvas;
156
156
  var textMetricsCache = new Map;
157
157
  function getCacheKey(text, fontStyle, maxWidth) {
@@ -287,7 +287,12 @@ function computeLayout(ctx, node, availableWidth, availableHeight, x = 0, y = 0)
287
287
  let width = parseSize(props.width);
288
288
  let height = parseSize(props.height);
289
289
  const type = node.type.toLowerCase();
290
- if (type === "spacer") {
290
+ if (type === "app") {
291
+ if (width === null)
292
+ width = availableAfterMargin.width;
293
+ if (height === null)
294
+ height = availableAfterMargin.height;
295
+ } else if (type === "spacer") {
291
296
  if (width === null)
292
297
  width = availableAfterMargin.width;
293
298
  if (height === null)
@@ -410,10 +415,10 @@ function layoutChildren(ctx, parent) {
410
415
  return;
411
416
  }
412
417
  const flexDirection = props.flexDirection || (parent.type === "column" ? "column" : "row");
413
- const justifyContent = props.justifyContent || "flex-start";
414
- const alignItems = props.alignItems || "flex-start";
415
- const gap = parseFloat(props.gap) || 0;
416
418
  const isColumn = flexDirection === "column";
419
+ const justifyContent = isColumn ? props.verticalAlignment || "flex-start" : props.horizontalAlignment || "flex-start";
420
+ const alignItems = isColumn ? props.horizontalAlignment || "flex-start" : props.verticalAlignment || "flex-start";
421
+ const gap = parseFloat(props.gap) || 0;
417
422
  const availableWidth = layout.contentWidth;
418
423
  const availableHeight = layout.contentHeight;
419
424
  const childInfo = [];
@@ -526,8 +531,8 @@ function layoutChildren(ctx, parent) {
526
531
  function layoutStackChildren(ctx, parent) {
527
532
  const layout = parent.layout;
528
533
  const props = parent.props;
529
- const alignItems = props.alignItems || "flex-start";
530
- const justifyContent = props.justifyContent || "flex-start";
534
+ const horizontalAlignment = props.horizontalAlignment || "flex-start";
535
+ const verticalAlignment = props.verticalAlignment || "flex-start";
531
536
  const availableWidth = layout.contentWidth;
532
537
  const availableHeight = layout.contentHeight;
533
538
  for (const child of parent.children) {
@@ -535,14 +540,14 @@ function layoutStackChildren(ctx, parent) {
535
540
  const childLayout = child.layout;
536
541
  let x = 0;
537
542
  let y = 0;
538
- if (alignItems === "center") {
543
+ if (horizontalAlignment === "center") {
539
544
  x = (availableWidth - childLayout.width) / 2;
540
- } else if (alignItems === "flex-end") {
545
+ } else if (horizontalAlignment === "flex-end") {
541
546
  x = availableWidth - childLayout.width;
542
547
  }
543
- if (justifyContent === "center") {
548
+ if (verticalAlignment === "center") {
544
549
  y = (availableHeight - childLayout.height) / 2;
545
- } else if (justifyContent === "flex-end") {
550
+ } else if (verticalAlignment === "flex-end") {
546
551
  y = availableHeight - childLayout.height;
547
552
  }
548
553
  childLayout.x = layout.x + layout.contentX + x;
@@ -629,6 +634,7 @@ function paintNode(ctx, node) {
629
634
  case "link":
630
635
  paintLink(ctx, node);
631
636
  break;
637
+ case "app":
632
638
  case "container":
633
639
  case "box":
634
640
  paintContainer(ctx, node);
@@ -1607,13 +1613,17 @@ class InputOverlay {
1607
1613
  overlay = null;
1608
1614
  focusedNode = null;
1609
1615
  onChangeCallback = null;
1616
+ bindPath = null;
1617
+ engine = null;
1610
1618
  constructor(container) {
1611
1619
  this.container = container || {};
1612
1620
  }
1613
- showInput(node, canvasBounds, onChange) {
1621
+ showInput(node, canvasBounds, onChange, engine) {
1614
1622
  if (typeof document === "undefined")
1615
1623
  return;
1616
1624
  this.hideInput();
1625
+ this.bindPath = node.props.bind || null;
1626
+ this.engine = engine || null;
1617
1627
  const bounds = getAbsoluteBounds(node);
1618
1628
  if (!bounds)
1619
1629
  return;
@@ -1637,6 +1647,8 @@ class InputOverlay {
1637
1647
  }
1638
1648
  this.focusedNode = null;
1639
1649
  this.onChangeCallback = null;
1650
+ this.bindPath = null;
1651
+ this.engine = null;
1640
1652
  }
1641
1653
  updatePosition(node, canvasBounds) {
1642
1654
  if (!this.overlay || node !== this.focusedNode)
@@ -1698,6 +1710,12 @@ class InputOverlay {
1698
1710
  return;
1699
1711
  const value = this.overlay.value;
1700
1712
  this.onChangeCallback(value);
1713
+ if (this.bindPath && this.engine) {
1714
+ this.engine.dispatchAction("__hypen_bind", {
1715
+ path: this.bindPath,
1716
+ value
1717
+ });
1718
+ }
1701
1719
  }
1702
1720
  onBlur() {
1703
1721
  this.hideInput();
@@ -1867,7 +1885,7 @@ class AccessibilityLayer {
1867
1885
  }
1868
1886
 
1869
1887
  // src/canvas/renderer.ts
1870
- import { frameworkLoggers as frameworkLoggers2 } from "@hypen-space/core";
1888
+ import { frameworkLoggers as frameworkLoggers2 } from "@hypen-space/core/logger";
1871
1889
  var log2 = frameworkLoggers2.canvas;
1872
1890
  var DEFAULT_OPTIONS = {
1873
1891
  devicePixelRatio: typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1,
@@ -2121,4 +2139,4 @@ export {
2121
2139
  CanvasRenderer
2122
2140
  };
2123
2141
 
2124
- //# debugId=C32BFB334FF2F14064756E2164756E21
2142
+ //# debugId=BE7E20D4D1A9D99264756E2164756E21