@infineon/design-system-mcp 41.10.0 → 41.11.0

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-10-16T08:46:04",
2
+ "timestamp": "2026-10-19T10:36:59",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.45.0",
@@ -8857,7 +8857,7 @@
8857
8857
  "filePath": "src/components/select/multi-select/multiselect.tsx",
8858
8858
  "encapsulation": "shadow",
8859
8859
  "tag": "ifx-multiselect",
8860
- "readme": "# ifx-multiselect\r\n\r\n\r\n\r",
8860
+ "readme": "# ifx-multiselect\n\n## Grouping options\n\nUse `ifx-multiselect-group` to organize related options under a heading without adding another selectable item.\n\n- An `ifx-multiselect-option` with children is a hierarchical, selectable parent. It displays a checkbox and expand/collapse control.\n- An `ifx-multiselect-group` provides visual and semantic grouping only. It is not selectable or expandable.\n\n```html\n<ifx-multiselect label=\"KPIs\">\n <ifx-multiselect-option value=\"all\">All KPIs</ifx-multiselect-option>\n\n <ifx-multiselect-group label=\"Revenue\">\n <ifx-multiselect-option value=\"revenue-total\">\n Total revenue\n </ifx-multiselect-option>\n <ifx-multiselect-option value=\"revenue-region\">\n Revenue by region\n </ifx-multiselect-option>\n </ifx-multiselect-group>\n</ifx-multiselect>\n```\n\n",
8861
8861
  "docs": "",
8862
8862
  "docsTags": [],
8863
8863
  "usage": {},
@@ -9743,11 +9743,89 @@
9743
9743
  ]
9744
9744
  }
9745
9745
  },
9746
+ {
9747
+ "filePath": "src/components/select/multi-select/multiselect-group.tsx",
9748
+ "encapsulation": "shadow",
9749
+ "tag": "ifx-multiselect-group",
9750
+ "readme": "# ifx-multiselect\n\n## Grouping options\n\nUse `ifx-multiselect-group` to organize related options under a heading without adding another selectable item.\n\n- An `ifx-multiselect-option` with children is a hierarchical, selectable parent. It displays a checkbox and expand/collapse control.\n- An `ifx-multiselect-group` provides visual and semantic grouping only. It is not selectable or expandable.\n\n```html\n<ifx-multiselect label=\"KPIs\">\n <ifx-multiselect-option value=\"all\">All KPIs</ifx-multiselect-option>\n\n <ifx-multiselect-group label=\"Revenue\">\n <ifx-multiselect-option value=\"revenue-total\">\n Total revenue\n </ifx-multiselect-option>\n <ifx-multiselect-option value=\"revenue-region\">\n Revenue by region\n </ifx-multiselect-option>\n </ifx-multiselect-group>\n</ifx-multiselect>\n```\n\n",
9751
+ "docs": "Visually and semantically groups multiselect options under a heading.\nUnlike a multiselect option with children, a group is not selectable or expandable.",
9752
+ "docsTags": [],
9753
+ "usage": {},
9754
+ "props": [
9755
+ {
9756
+ "name": "disabled",
9757
+ "type": "boolean",
9758
+ "complexType": {
9759
+ "original": "boolean",
9760
+ "resolved": "boolean",
9761
+ "references": {}
9762
+ },
9763
+ "mutable": false,
9764
+ "attr": "disabled",
9765
+ "reflectToAttr": true,
9766
+ "docs": "Whether the group is disabled.",
9767
+ "docsTags": [
9768
+ {
9769
+ "name": "default",
9770
+ "text": "false"
9771
+ }
9772
+ ],
9773
+ "default": "false",
9774
+ "values": [
9775
+ {
9776
+ "type": "boolean"
9777
+ }
9778
+ ],
9779
+ "optional": false,
9780
+ "required": false,
9781
+ "getter": false,
9782
+ "setter": false
9783
+ },
9784
+ {
9785
+ "name": "label",
9786
+ "type": "string",
9787
+ "complexType": {
9788
+ "original": "string",
9789
+ "resolved": "string",
9790
+ "references": {}
9791
+ },
9792
+ "mutable": false,
9793
+ "attr": "label",
9794
+ "reflectToAttr": false,
9795
+ "docs": "Label displayed above the group's options.",
9796
+ "docsTags": [],
9797
+ "values": [
9798
+ {
9799
+ "type": "string"
9800
+ }
9801
+ ],
9802
+ "optional": false,
9803
+ "required": false,
9804
+ "getter": false,
9805
+ "setter": false
9806
+ }
9807
+ ],
9808
+ "methods": [],
9809
+ "events": [],
9810
+ "listeners": [],
9811
+ "styles": [],
9812
+ "slots": [
9813
+ {
9814
+ "name": "",
9815
+ "docs": "The default slot"
9816
+ }
9817
+ ],
9818
+ "parts": [],
9819
+ "states": [],
9820
+ "dependents": [],
9821
+ "dependencies": [],
9822
+ "dependencyGraph": {}
9823
+ },
9746
9824
  {
9747
9825
  "filePath": "src/components/select/multi-select/multiselect-option.tsx",
9748
9826
  "encapsulation": "shadow",
9749
9827
  "tag": "ifx-multiselect-option",
9750
- "readme": "# ifx-multiselect\r\n\r\n\r\n\r",
9828
+ "readme": "# ifx-multiselect\n\n## Grouping options\n\nUse `ifx-multiselect-group` to organize related options under a heading without adding another selectable item.\n\n- An `ifx-multiselect-option` with children is a hierarchical, selectable parent. It displays a checkbox and expand/collapse control.\n- An `ifx-multiselect-group` provides visual and semantic grouping only. It is not selectable or expandable.\n\n```html\n<ifx-multiselect label=\"KPIs\">\n <ifx-multiselect-option value=\"all\">All KPIs</ifx-multiselect-option>\n\n <ifx-multiselect-group label=\"Revenue\">\n <ifx-multiselect-option value=\"revenue-total\">\n Total revenue\n </ifx-multiselect-option>\n <ifx-multiselect-option value=\"revenue-region\">\n Revenue by region\n </ifx-multiselect-option>\n </ifx-multiselect-group>\n</ifx-multiselect>\n```\n\n",
9751
9829
  "docs": "",
9752
9830
  "docsTags": [],
9753
9831
  "usage": {},
package/dist/index.js CHANGED
@@ -159,7 +159,7 @@ Examples:
159
159
  `);
160
160
  }
161
161
  function showVersion() {
162
- console.log(`dds-mcp version ${"41.10.0"}`);
162
+ console.log(`dds-mcp version ${"41.11.0"}`);
163
163
  }
164
164
  async function handleCli(args) {
165
165
  const command = args[0];
@@ -539,9 +539,9 @@ ${eventHandlers}
539
539
  isFirstOfType.set(tag, true);
540
540
  }
541
541
  const attrs = Object.entries(struct.attributes).map(([key, value]) => this.toAngularAttribute(key, value, componentInfo, tag)).filter((attr) => attr !== null);
542
- const shouldAddEvents = componentInfo.events.length > 0 && (struct.children && struct.children.length > 0 ? tag !== componentInfo.component : tag.includes(componentInfo.component));
543
- if (shouldAddEvents && isFirst) {
544
- componentInfo.events.forEach((event) => {
542
+ if (isFirst && componentInfo.events.length > 0) {
543
+ const relevantEvents = componentInfo.events.filter((event) => event.sourceComponent ? event.sourceComponent === tag : tag === componentInfo.component);
544
+ relevantEvents.forEach((event) => {
545
545
  const angularEventName = toAngularEventName(event.name);
546
546
  const handlerName = toHandlerFunctionName(event.name);
547
547
  attrs.push(`(${angularEventName})="${handlerName}($any($event))"`);
@@ -1048,10 +1048,10 @@ ${template}
1048
1048
  }
1049
1049
  return [key, propValue];
1050
1050
  }).filter(Boolean);
1051
- const shouldAddEvents = componentInfo.events.length > 0 && (struct.children && struct.children.length > 0 ? struct.tag !== componentInfo.component : struct.tag.includes(componentInfo.component));
1052
1051
  const eventProps = [];
1053
- if (shouldAddEvents && isFirst) {
1054
- componentInfo.events.forEach((event) => {
1052
+ if (isFirst && componentInfo.events.length > 0) {
1053
+ const relevantEvents = componentInfo.events.filter((event) => event.sourceComponent ? event.sourceComponent === struct.tag : struct.tag === componentInfo.component);
1054
+ relevantEvents.forEach((event) => {
1055
1055
  const handlerName = toHandlerFunctionName(event.name);
1056
1056
  eventProps.push([`@${event.name}`, `"${handlerName}"`]);
1057
1057
  });
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/cli/setup.ts", "../src/cli/index.ts", "../src/runtime/dds.ts", "../src/sources/examples.ts", "../src/sources/foundations.ts", "../src/sources/stencilDocs.ts", "../../dds-tooling/dist/utils/string-utils.js", "../../dds-tooling/dist/formatters/angular-formatter.js", "../../dds-tooling/dist/formatters/html-formatter.js", "../../dds-tooling/dist/formatters/react-formatter.js", "../../dds-tooling/dist/formatters/vue-formatter.js", "../../dds-tooling/dist/story-renderer.js", "../../dds-tooling/dist/utils/dom-utils.js", "../../dds-tooling/dist/story-parser.js", "../src/views/frameworkNotes.ts", "../src/views/markdown.ts"],
4
- "sourcesContent": ["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\n\nimport { z } from \"zod\";\nimport { handleCli } from \"./cli/index.js\";\nimport {\n\tbuildComponentIndex,\n\tgetComponentDoc,\n\tgetDdsVersion,\n\tgetSource,\n} from \"./runtime/dds.js\";\nimport { normalizeComponentName } from \"./views/frameworkNotes.js\";\n\nconst FrameworkSchema = z.enum([\"html\", \"react\", \"vue\", \"angular\"]);\nconst IncludeSchema = z.enum([\n\t\"properties\",\n\t\"events\",\n\t\"slots\",\n\t\"css\",\n\t\"examples\",\n]);\n\nconst ListComponentsInputSchema = z\n\t.object({\n\t\tframework: FrameworkSchema.default(\"react\").describe(\n\t\t\t\"Target framework (defaults to React if unspecified)\",\n\t\t),\n\t})\n\t.strict();\n\nconst GetComponentInputSchema = z\n\t.object({\n\t\tcomponent: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.describe(\n\t\t\t\t'Component name (e.g. \"ifx-button\", \"ifx-text-field\"). If unsure, use infineon_list_components first.',\n\t\t\t),\n\t\tframework: FrameworkSchema.default(\"react\").describe(\n\t\t\t\"Framework (defaults to React)\",\n\t\t),\n\t\tinclude: z\n\t\t\t.array(IncludeSchema)\n\t\t\t.optional()\n\t\t\t.describe(\"Optional: Limit response sections (default: all)\"),\n\t})\n\t.strict();\n\nconst GetFoundationInputSchema = z\n\t.object({\n\t\tstory: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.describe(\n\t\t\t\t'Story slug, e.g. \"foundations/color\", \"setup/gettingstarted\", or \"setup/framework-integration/react\"',\n\t\t\t),\n\t})\n\t.strict();\n\nexport async function startServer() {\n\tconst server = new McpServer({\n\t\tname: \"infineon-design-system\",\n\t\tversion: \"1.0.0\",\n\t\tdescription:\n\t\t\t\"Infineon Design System (DDS) - Official component library and design foundations. Use these tools whenever implementing UI components (buttons, forms, inputs, cards, layouts) or styling in Infineon projects. Provides React, Vue, Angular, and HTML components with design tokens, spacing, colors, and typography guidelines.\",\n\t});\n\n\tserver.registerTool(\n\t\t\"infineon_list_components\",\n\t\t{\n\t\t\tdescription:\n\t\t\t\t'List all available Infineon Design System (DDS) components for a framework. **Use this when:**\\n- User asks \"what components are available?\"\\n- Starting a new feature and need to browse options\\n- User doesn\\'t know the exact component name\\n- Need to show component catalog\\n\\nReturns: Markdown table with component names and descriptions',\n\t\t\tinputSchema: ListComponentsInputSchema,\n\t\t},\n\t\tasync ({ framework }) => {\n\t\t\tconst version = await getDdsVersion();\n\t\t\tconst md = await buildComponentIndex({\n\t\t\t\tversion,\n\t\t\t\tframework,\n\t\t\t});\n\n\t\t\treturn { content: [{ type: \"text\", text: md }] };\n\t\t},\n\t);\n\n\tserver.registerTool(\n\t\t\"infineon_get_component_docs\",\n\t\t{\n\t\t\tdescription:\n\t\t\t\t\"Get comprehensive Infineon DDS component documentation including props, events, slots, styling, and code examples. **Primary tool for component implementation.**\\n\\n**Always use when:**\\n- User wants to add ANY UI element (button, input, dropdown, card, etc.)\\n- Questions about component properties or events\\n- Need usage examples or code snippets\\n- Styling/theming questions\\n\\n**This is the DEFAULT tool for component-related questions.**\",\n\t\t\tinputSchema: GetComponentInputSchema,\n\t\t},\n\t\tasync ({ component, framework, include }) => {\n\t\t\tconst version = await getDdsVersion();\n\t\t\tconst md = await getComponentDoc({\n\t\t\t\tversion,\n\t\t\t\tcomponent: normalizeComponentName(component),\n\t\t\t\tframework,\n\t\t\t\tinclude: include ?? [\n\t\t\t\t\t\"properties\",\n\t\t\t\t\t\"events\",\n\t\t\t\t\t\"slots\",\n\t\t\t\t\t\"css\",\n\t\t\t\t\t\"examples\",\n\t\t\t\t],\n\t\t\t});\n\n\t\t\treturn { content: [{ type: \"text\", text: md }] };\n\t\t},\n\t);\n\n\tserver.registerTool(\n\t\t\"infineon_list_foundations\",\n\t\t{\n\t\t\tdescription:\n\t\t\t\t\"List Infineon Design System foundations (colors, typography, spacing, icons, etc.) and setup guides. **Use when:**\\n- User asks about design tokens, colors, spacing\\n- Questions about setup/installation\\n- Need design system guidelines\\n- Typography or theming questions\",\n\t\t\tinputSchema: z.object({}),\n\t\t},\n\t\tasync () => {\n\t\t\tconst source = await getSource();\n\t\t\tconst foundations = source.foundations || new Map();\n\n\t\t\tconst categories = new Map<string, string[]>();\n\t\t\tfor (const [slug, story] of foundations) {\n\t\t\t\tif (!categories.has(story.category)) {\n\t\t\t\t\tcategories.set(story.category, []);\n\t\t\t\t}\n\t\t\t\tconst categoryArray = categories.get(story.category);\n\t\t\t\tif (categoryArray) {\n\t\t\t\t\tcategoryArray.push(`- **${slug}**: ${story.title}`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst lines: string[] = [\"# DDS Foundation Stories & Guides\", \"\"];\n\t\t\tfor (const [category, stories] of categories) {\n\t\t\t\tlines.push(`## ${category}`, \"\", ...stories, \"\");\n\t\t\t}\n\n\t\t\treturn { content: [{ type: \"text\", text: lines.join(\"\\n\") }] };\n\t\t},\n\t);\n\n\tserver.registerTool(\n\t\t\"infineon_get_foundation_docs\",\n\t\t{\n\t\t\tdescription:\n\t\t\t\t\"Get detailed documentation for design foundations (color palettes, spacing scale, typography) or setup guides. **Use for:**\\n- Color/spacing token questions\\n- Typography scale and font usage\\n- Getting started guides\\n- Framework-specific setup guides for React, Angular, Vue, and HTML\\n- Design principles and accessibility\\n\\nInput: story slug from infineon_list_foundations (e.g. 'foundations/color' or 'setup/framework-integration/react')\",\n\t\t\tinputSchema: GetFoundationInputSchema,\n\t\t},\n\t\tasync ({ story }) => {\n\t\t\tconst source = await getSource();\n\t\t\tconst foundations = source.foundations || new Map();\n\t\t\tconst foundationStory = foundations.get(story.toLowerCase());\n\n\t\t\tif (!foundationStory) {\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\ttext: `Foundation story \"${story}\" not found. Use infineon_list_foundations to see available stories.`,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst md = [\n\t\t\t\t`# ${foundationStory.title}`,\n\t\t\t\t\"\",\n\t\t\t\t`*Category: ${foundationStory.category}*`,\n\t\t\t\t\"\",\n\t\t\t\tfoundationStory.content,\n\t\t\t].join(\"\\n\");\n\n\t\t\treturn { content: [{ type: \"text\", text: md }] };\n\t\t},\n\t);\n\n\tconst transport = new StdioServerTransport();\n\tawait server.connect(transport);\n}\n\n// Handle CLI commands or start the server\nasync function main() {\n\tconst args = process.argv.slice(2);\n\tconst result = await handleCli(args);\n\n\tif (result === \"continue\") {\n\t\tawait startServer();\n\t}\n}\n\nmain().catch((error) => {\n\tconsole.error(\"Error:\", error);\n\tprocess.exit(1);\n});\n", "import { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { createInterface } from \"node:readline\";\n\ninterface McpConfig {\n\tservers?: {\n\t\t[key: string]: {\n\t\t\tcommand: string;\n\t\t\targs?: string[];\n\t\t\tenv?: Record<string, string>;\n\t\t};\n\t};\n}\n\nfunction getWorkspaceConfigPath(): string {\n\treturn join(process.cwd(), \".vscode\");\n}\n\nfunction isInWorkspace(): boolean {\n\t// Check if we're in a directory that looks like a workspace\n\tconst possibleWorkspaceMarkers = [\n\t\t\".git\",\n\t\t\".vscode\",\n\t\t\"package.json\",\n\t\t\"pnpm-workspace.yaml\",\n\t\t\"lerna.json\",\n\t];\n\n\treturn possibleWorkspaceMarkers.some((marker) =>\n\t\texistsSync(join(process.cwd(), marker)),\n\t);\n}\n\nasync function askQuestion(question: string): Promise<string> {\n\tconst rl = createInterface({\n\t\tinput: process.stdin,\n\t\toutput: process.stdout,\n\t});\n\n\treturn new Promise((resolve) => {\n\t\trl.question(question, (answer) => {\n\t\t\trl.close();\n\t\t\tresolve(answer.trim());\n\t\t});\n\t});\n}\n\nfunction getMcpCommand() {\n\t// Use npx --no to require local installation (doesn't auto-download)\n\t// This ensures the DDS version matches the MCP version\n\treturn {\n\t\tcommand: \"npx\",\n\t\targs: [\"--no\", \"@infineon/design-system-mcp\"],\n\t};\n}\n\nexport async function runSetup(): Promise<void> {\n\tconsole.log(\"\uD83D\uDE80 DDS MCP Setup\\n\");\n\tconsole.log(\n\t\t\"This will configure the DDS MCP server in VS Code for this workspace.\\n\",\n\t);\n\n\t// Check if in a workspace\n\tif (!isInWorkspace()) {\n\t\tconsole.error(\"\u274C Error: Not in a workspace directory.\");\n\t\tconsole.error(\n\t\t\t\" Please run this command from your project root (where package.json is located).\",\n\t\t);\n\t\tprocess.exit(1);\n\t}\n\n\tconst configDir = getWorkspaceConfigPath();\n\tconst mcpConfigPath = join(configDir, \"mcp.json\");\n\n\tconsole.log(`\uD83D\uDCC2 Configuration file: ${mcpConfigPath}`);\n\n\t// Ensure the config directory exists\n\tif (!existsSync(configDir)) {\n\t\tconsole.log(`Creating directory: ${configDir}`);\n\t\tmkdirSync(configDir, { recursive: true });\n\t}\n\n\t// Read existing config or create new one\n\tlet config: McpConfig = {};\n\n\tif (existsSync(mcpConfigPath)) {\n\t\tconsole.log(`\\nReading existing configuration...`);\n\t\ttry {\n\t\t\tconst content = readFileSync(mcpConfigPath, \"utf-8\");\n\t\t\tconfig = JSON.parse(content);\n\t\t} catch {\n\t\t\tconsole.error(\n\t\t\t\t\"\u26A0\uFE0F Warning: Could not parse existing mcp.json. Creating a backup.\",\n\t\t\t);\n\t\t\tconst backupPath = `${mcpConfigPath}.backup.${Date.now()}`;\n\t\t\twriteFileSync(backupPath, readFileSync(mcpConfigPath));\n\t\t\tconsole.log(` Backup saved to: ${backupPath}`);\n\t\t}\n\t}\n\n\t// Initialize servers if it doesn't exist\n\tif (!config.servers) {\n\t\tconfig.servers = {};\n\t}\n\n\t// Check if design-system is already configured\n\tif (config.servers[\"design-system\"]) {\n\t\tconst answer = await askQuestion(\n\t\t\t\"\\n\u26A0\uFE0F DDS MCP is already configured. Do you want to overwrite it? (y/N): \",\n\t\t);\n\t\tif (answer.toLowerCase() !== \"y\") {\n\t\t\tconsole.log(\"\\n\u2705 Setup cancelled. Existing configuration preserved.\");\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Check if locally installed\n\tconst localInstalled = existsSync(\n\t\tjoin(process.cwd(), \"node_modules\", \"@infineon\", \"design-system-mcp\"),\n\t);\n\n\t// Add DDS MCP configuration\n\tconst mcpCommand = getMcpCommand();\n\tconfig.servers[\"design-system\"] = {\n\t\tcommand: mcpCommand.command,\n\t\targs: mcpCommand.args,\n\t};\n\n\t// Write the updated config\n\tconsole.log(\"\\n\uD83D\uDCDD Writing configuration...\");\n\twriteFileSync(mcpConfigPath, JSON.stringify(config, null, 2), \"utf-8\");\n\n\tconsole.log(`\u2705 Configuration saved to: ${mcpConfigPath}`);\n\tconsole.log(\"\\n\uD83D\uDCCB Configuration added:\");\n\tconsole.log(\n\t\tJSON.stringify(\n\t\t\t{ servers: { \"design-system\": config.servers[\"design-system\"] } },\n\t\t\tnull,\n\t\t\t2,\n\t\t),\n\t);\n\n\tconsole.log(\"\\n\uD83C\uDF89 Setup complete!\");\n\tconsole.log(\"\\n\uD83D\uDCD6 Next steps:\");\n\n\tif (!localInstalled) {\n\t\tconsole.log(\" \u26A0\uFE0F Local installation not detected. Install the package:\");\n\t\tconsole.log(\" pnpm add -D @infineon/design-system-mcp\");\n\t\tconsole.log(\n\t\t\t\" \uD83D\uDCA1 Tip: Install the same version as your DDS package for compatibility\",\n\t\t);\n\t\tconsole.log(\"\");\n\t}\n\n\tconsole.log(\" 1. Restart VS Code or GitHub Copilot\");\n\tconsole.log(\n\t\t\" 2. The DDS MCP server should now be available to your AI assistant\",\n\t);\n\tconsole.log(\n\t\t\"\\n\uD83D\uDCA1 Tip: Commit .vscode/mcp.json and package.json to share this setup with your team\",\n\t);\n\tconsole.log(\n\t\t\"\\n\uD83D\uDCA1 Tip: You can test the tools using @mcp in GitHub Copilot Chat\",\n\t);\n\tconsole.log(' Example: \"@mcp infineon_list_components for react\"');\n\tconsole.log(' Or just ask: \"Add an Infineon button to my form\"');\n\tconsole.log();\n}\n", "import { runSetup } from \"./setup.js\";\n\n// Injected at build time by esbuild\ndeclare const __PACKAGE_VERSION__: string;\n\nfunction showHelp(): void {\n\tconsole.log(`Infineon Design System MCP Integration\n\nUsage:\n dds-mcp Start the MCP server (stdio mode)\n dds-mcp setup Configure the MCP server in your workspace\n dds-mcp --help, -h Show this help message\n dds-mcp --version, -v Show version information\n\nCommands:\n setup Configure .vscode/mcp.json for this workspace\n (Must be run from your project root)\n\nExamples:\n # Install in your project\n pnpm add -D @infineon/design-system-mcp\n \n # Run setup wizard\n dds-mcp setup\n \n # Start the MCP server (usually called automatically by VS Code)\n dds-mcp\n`);\n}\n\nfunction showVersion(): void {\n\tconsole.log(`dds-mcp version ${__PACKAGE_VERSION__}`);\n}\n\nexport async function handleCli(args: string[]): Promise<\"exit\" | \"continue\"> {\n\tconst command = args[0];\n\n\tswitch (command) {\n\t\tcase \"setup\":\n\t\t\tawait runSetup();\n\t\t\treturn \"exit\";\n\n\t\tcase \"--help\":\n\t\tcase \"-h\":\n\t\tcase \"help\":\n\t\t\tshowHelp();\n\t\t\treturn \"exit\";\n\n\t\tcase \"--version\":\n\t\tcase \"-v\":\n\t\tcase \"version\":\n\t\t\tshowVersion();\n\t\t\treturn \"exit\";\n\n\t\tcase undefined:\n\t\t\t// No command provided, start the server\n\t\t\treturn \"continue\";\n\n\t\tdefault:\n\t\t\tconsole.error(`Unknown command: ${command}`);\n\t\t\tconsole.error('Run \"dds-mcp --help\" for usage information');\n\t\t\tprocess.exit(1);\n\t}\n}\n", "import { readFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { loadBundledExamples } from \"../sources/examples.js\";\nimport { loadFoundationStories } from \"../sources/foundations.js\";\nimport { loadStencilDocs } from \"../sources/stencilDocs.js\";\nimport {\n\trenderComponentDocMarkdown,\n\trenderComponentIndexMarkdown,\n} from \"../views/markdown.js\";\nimport type {\n\tComponentDocRequest,\n\tComponentIndexRequest,\n\tDdsDataSource,\n} from \"./types.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nlet cachedSource: Promise<DdsDataSource> | undefined;\n\nexport async function getDdsVersion(): Promise<string> {\n\t// In the bundled/installed version, the bundle is at dist/index.js\n\t// and package.json is at the package root, so we go up one level\n\tconst pkgPath = join(__dirname, \"../package.json\");\n\tconst pkgJson = JSON.parse(await readFile(pkgPath, \"utf-8\"));\n\treturn pkgJson.version;\n}\n\nexport async function buildComponentIndex(\n\treq: ComponentIndexRequest,\n): Promise<string> {\n\tconst source = await getSource();\n\treturn renderComponentIndexMarkdown(req, source);\n}\n\nexport async function getComponentDoc(\n\treq: ComponentDocRequest,\n): Promise<string> {\n\tconst source = await getSource();\n\treturn renderComponentDocMarkdown(req, source);\n}\n\nexport async function getSource(): Promise<DdsDataSource> {\n\tif (!cachedSource) {\n\t\tcachedSource = (async () => {\n\t\t\tconst docs = await loadStencilDocs();\n\t\t\tconst examples = await loadBundledExamples();\n\t\t\tconst foundations = await loadFoundationStories();\n\t\t\treturn {\n\t\t\t\tdocs,\n\t\t\t\texamples,\n\t\t\t\tfoundations,\n\t\t\t};\n\t\t})();\n\t}\n\n\treturn cachedSource;\n}\n", "import { readdir, readFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport type { ComponentInfo } from \"@infineon/dds-tooling\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport async function loadBundledExamples(): Promise<\n\tMap<string, ComponentInfo>\n> {\n\tconst examples = new Map<string, ComponentInfo>();\n\n\t// When bundled with esbuild, everything is in dist/index.js\n\t// Assets are at dist/assets/examples/\n\t// So from the bundle location, assets are at ./assets/examples\n\tconst examplesDir = join(__dirname, \"assets/examples\");\n\n\ttry {\n\t\tconst files = await readdir(examplesDir);\n\n\t\tfor (const file of files) {\n\t\t\tif (file.endsWith(\".json\")) {\n\t\t\t\tconst tag = file.replace(\".json\", \"\");\n\t\t\t\tconst filePath = join(examplesDir, file);\n\t\t\t\tconst json = await readFile(filePath, \"utf-8\");\n\t\t\t\tconst componentInfo = JSON.parse(json) as ComponentInfo;\n\t\t\t\texamples.set(tag, componentInfo);\n\t\t\t}\n\t\t}\n\t} catch (_error) {\n\t\t// Directory doesn't exist or can't be read - return empty map\n\t}\n\n\treturn examples;\n}\n", "import { readdir, readFile } from \"node:fs/promises\";\nimport { basename, dirname, join, relative } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\ninterface FoundationStory {\n\ttitle: string;\n\tcategory: string;\n\tcontent: string;\n}\n\nexport async function loadFoundationStories(): Promise<\n\tMap<string, FoundationStory>\n> {\n\tconst stories = new Map<string, FoundationStory>();\n\n\t// When bundled, stories are at dist/assets/foundations/\n\t// From the bundle location (dist/index.js), that's ./assets/foundations\n\tconst storiesBaseDir = join(__dirname, \"assets/foundations\");\n\n\ttry {\n\t\t// Load foundations\n\t\tconst foundationsDir = join(storiesBaseDir, \"foundations\");\n\t\tconst foundationFiles = await readdir(foundationsDir);\n\n\t\tfor (const file of foundationFiles) {\n\t\t\tif (file.endsWith(\".mdx\")) {\n\t\t\t\tconst slug = file.replace(\".mdx\", \"\").toLowerCase();\n\t\t\t\tconst content = await readFile(join(foundationsDir, file), \"utf-8\");\n\t\t\t\tconst title = file\n\t\t\t\t\t.replace(\".mdx\", \"\")\n\t\t\t\t\t.replace(/([A-Z])/g, \" $1\")\n\t\t\t\t\t.trim();\n\n\t\t\t\tstories.set(`foundations/${slug}`, {\n\t\t\t\t\ttitle,\n\t\t\t\t\tcategory: \"Foundations\",\n\t\t\t\t\tcontent: stripMDXImports(content),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Load setup and installation guides, including nested sections such as\n\t\t// framework-specific integration pages and FAQ entries.\n\t\tconst setupDir = join(storiesBaseDir, \"setup-and-installation\");\n\t\tawait loadNestedStories(stories, {\n\t\t\trootDir: setupDir,\n\t\t\tbaseDir: setupDir,\n\t\t\tslugPrefix: \"setup\",\n\t\t\tbaseCategory: \"Setup & Installation\",\n\t\t});\n\n\t\t// Load root-level stories\n\t\tconst rootFiles = await readdir(storiesBaseDir);\n\t\tfor (const file of rootFiles) {\n\t\t\tif (file.endsWith(\".mdx\")) {\n\t\t\t\tconst slug = file.replace(\".mdx\", \"\").toLowerCase();\n\t\t\t\tconst content = await readFile(join(storiesBaseDir, file), \"utf-8\");\n\t\t\t\tconst title = file.replace(\".mdx\", \"\");\n\n\t\t\t\tstories.set(slug, {\n\t\t\t\t\ttitle,\n\t\t\t\t\tcategory: \"General\",\n\t\t\t\t\tcontent: stripMDXImports(content),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (_error) {\n\t\t// Directory doesn't exist or can't be read - return empty map\n\t}\n\n\treturn stories;\n}\n\nasync function loadNestedStories(\n\tstories: Map<string, FoundationStory>,\n\toptions: {\n\t\trootDir: string;\n\t\tbaseDir: string;\n\t\tslugPrefix: string;\n\t\tbaseCategory: string;\n\t},\n): Promise<void> {\n\tconst entries = await readdir(options.baseDir, { withFileTypes: true });\n\n\tfor (const entry of entries) {\n\t\tconst entryPath = join(options.baseDir, entry.name);\n\n\t\tif (entry.isDirectory()) {\n\t\t\tawait loadNestedStories(stories, {\n\t\t\t\t...options,\n\t\t\t\tbaseDir: entryPath,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!entry.name.endsWith(\".mdx\")) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst relativeFromRoot = relative(options.rootDir, entryPath)\n\t\t\t.replace(/\\.mdx$/i, \"\")\n\t\t\t.replaceAll(\"\\\\\", \"/\");\n\t\tconst nestedDir = dirname(relativeFromRoot);\n\t\tconst content = await readFile(entryPath, \"utf-8\");\n\t\tconst title = formatStoryTitle(basename(entry.name, \".mdx\"));\n\n\t\tstories.set(`${options.slugPrefix}/${relativeFromRoot.toLowerCase()}`, {\n\t\t\ttitle,\n\t\t\tcategory:\n\t\t\t\tnestedDir === \".\"\n\t\t\t\t\t? options.baseCategory\n\t\t\t\t\t: `${options.baseCategory} / ${formatCategoryTitle(nestedDir)}`,\n\t\t\tcontent: stripMDXImports(content),\n\t\t});\n\t}\n}\n\nfunction formatStoryTitle(fileName: string): string {\n\treturn fileName.replace(/([A-Z])/g, \" $1\").trim();\n}\n\nfunction formatCategoryTitle(pathFragment: string): string {\n\treturn pathFragment\n\t\t.split(/[\\\\/]/)\n\t\t.map((part) =>\n\t\t\tpart\n\t\t\t\t.split(\"-\")\n\t\t\t\t.map((word) =>\n\t\t\t\t\tword ? word.charAt(0).toUpperCase() + word.slice(1) : word,\n\t\t\t\t)\n\t\t\t\t.join(\" \"),\n\t\t)\n\t\t.join(\" / \");\n}\n\nfunction stripMDXImports(content: string): string {\n\t// Remove MDX import statements and Meta tags for cleaner output\n\treturn content\n\t\t.split(\"\\n\")\n\t\t.filter((line) => !line.startsWith(\"import \"))\n\t\t.filter((line) => !line.includes(\"<Meta \"))\n\t\t.join(\"\\n\")\n\t\t.trim();\n}\n", "import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport type { StencilDocs, StencilDocsComponent } from \"../runtime/types.js\";\n\n// Raw JSON types from Stencil docs.json\ninterface RawStencilDocs {\n\tcomponents: RawStencilComponent[];\n}\n\ninterface RawStencilComponent {\n\ttag?: string;\n\tdocs?: string;\n\tprops?: RawProp[];\n\tevents?: RawEvent[];\n\tslots?: RawSlot[];\n\tstyles?: RawStyle[];\n\tparts?: RawPart[];\n}\n\ninterface RawProp {\n\tname?: string;\n\tattr?: string;\n\ttype?: string;\n\tdefault?: string | number | boolean;\n\tdocs?: string;\n}\n\ninterface RawEvent {\n\tevent?: string;\n\tdetail?: string;\n\tdocs?: string;\n}\n\ninterface RawSlot {\n\tname?: string;\n\tdocs?: string;\n}\n\ninterface RawStyle {\n\tname?: string;\n\tdocs?: string;\n}\n\ninterface RawPart {\n\tname?: string;\n\tdocs?: string;\n}\n\nexport async function loadStencilDocs(): Promise<StencilDocs | undefined> {\n\tconst docsJsonPath = await resolveDocsJsonPath();\n\tif (!docsJsonPath) return undefined;\n\n\tconst raw = await fs.readFile(docsJsonPath, \"utf8\");\n\tconst parsed = JSON.parse(raw) as unknown;\n\n\t// Stencil docs.json typically looks like { components: [...] }\n\tif (!parsed || typeof parsed !== \"object\") return undefined;\n\n\tconst docs = parsed as RawStencilDocs;\n\tif (!Array.isArray(docs.components)) return undefined;\n\n\tconst normalized: StencilDocsComponent[] = docs.components\n\t\t.map((c) => normalizeComponent(c))\n\t\t.filter((c): c is StencilDocsComponent => Boolean(c));\n\n\treturn { components: normalized };\n}\n\nasync function resolveDocsJsonPath(): Promise<string | undefined> {\n\t// Stencil outputs docs.json directly to packages/mcp/assets/docs.json\n\t// Then build copies it to dist/assets/docs.json\n\tconst bundledPath = resolveBundledDocsJsonPath();\n\ttry {\n\t\tawait fs.access(bundledPath);\n\t\treturn bundledPath;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nfunction resolveBundledDocsJsonPath(): string {\n\t// When bundled with esbuild, everything is in dist/index.js\n\t// and assets are in dist/assets/docs.json\n\t// So from the bundle location, assets are at ./assets/docs.json\n\tconst here = path.dirname(fileURLToPath(import.meta.url));\n\treturn path.resolve(here, \"assets\", \"docs.json\");\n}\n\nfunction normalizeComponent(\n\tc: RawStencilComponent,\n): StencilDocsComponent | undefined {\n\tconst tag = c?.tag;\n\tif (typeof tag !== \"string\" || !tag) return undefined;\n\n\treturn {\n\t\ttag,\n\t\tdocs: typeof c.docs === \"string\" ? c.docs.trim() : undefined,\n\t\tprops: Array.isArray(c.props)\n\t\t\t? c.props\n\t\t\t\t\t.map((p) => ({\n\t\t\t\t\t\tname: String(p.name ?? \"\"),\n\t\t\t\t\t\tattr: typeof p.attr === \"string\" && p.attr ? p.attr : undefined,\n\t\t\t\t\t\ttype: typeof p.type === \"string\" ? p.type : undefined,\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\ttypeof p.default === \"string\"\n\t\t\t\t\t\t\t\t? p.default\n\t\t\t\t\t\t\t\t: p.default != null\n\t\t\t\t\t\t\t\t\t? String(p.default)\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tdocs: typeof p.docs === \"string\" ? p.docs.trim() : undefined,\n\t\t\t\t\t}))\n\t\t\t\t\t.filter((p) => p.name)\n\t\t\t: undefined,\n\t\tevents: Array.isArray(c.events)\n\t\t\t? c.events\n\t\t\t\t\t.map((e) => ({\n\t\t\t\t\t\tevent: String(e.event ?? \"\"),\n\t\t\t\t\t\tdetail: typeof e.detail === \"string\" ? e.detail : undefined,\n\t\t\t\t\t\tdocs: typeof e.docs === \"string\" ? e.docs.trim() : undefined,\n\t\t\t\t\t}))\n\t\t\t\t\t.filter((e) => e.event)\n\t\t\t: undefined,\n\t\tslots: Array.isArray(c.slots)\n\t\t\t? c.slots.map((s) => ({\n\t\t\t\t\tname: typeof s.name === \"string\" ? s.name : undefined,\n\t\t\t\t\tdocs: typeof s.docs === \"string\" ? s.docs.trim() : undefined,\n\t\t\t\t}))\n\t\t\t: undefined,\n\t\tstyles: Array.isArray(c.styles)\n\t\t\t? c.styles\n\t\t\t\t\t.map((s) => ({\n\t\t\t\t\t\tname: String(s.name ?? \"\"),\n\t\t\t\t\t\tdocs: typeof s.docs === \"string\" ? s.docs.trim() : undefined,\n\t\t\t\t\t}))\n\t\t\t\t\t.filter((s) => s.name)\n\t\t\t: undefined,\n\t\tparts: Array.isArray(c.parts)\n\t\t\t? c.parts\n\t\t\t\t\t.map((p) => ({\n\t\t\t\t\t\tname: String(p.name ?? \"\"),\n\t\t\t\t\t\tdocs: typeof p.docs === \"string\" ? p.docs.trim() : undefined,\n\t\t\t\t\t}))\n\t\t\t\t\t.filter((p) => p.name)\n\t\t\t: undefined,\n\t};\n}\n", "/**\n * String utility functions for code generation\n */\n/**\n * Convert kebab-case to PascalCase\n * Example: ifx-switch -> IfxSwitch\n */\nexport function toPascalCase(str) {\n return str\n .split(\"-\")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\"\");\n}\n/**\n * Convert kebab-case to camelCase\n * Example: aria-level -> ariaLevel\n */\nexport function toCamelCase(str) {\n return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());\n}\n/**\n * Convert event name to React handler name\n * Example: ifxChange -> onIfxChange\n */\nexport function toReactEventName(eventName) {\n return `on${eventName.charAt(0).toUpperCase()}${eventName.slice(1)}`;\n}\n/**\n * Convert event name to handler function name\n * Example: ifxChange -> handleChange\n */\nexport function toHandlerFunctionName(eventName) {\n const withoutPrefix = eventName.replace(/^ifx/, \"\");\n return `handle${withoutPrefix.charAt(0).toUpperCase()}${withoutPrefix.slice(1)}`;\n}\n/**\n * Convert event name to Angular event name\n * Example: ifxChange -> ifxChange (Angular uses kebab-case in template)\n */\nexport function toAngularEventName(eventName) {\n // Angular event binding uses the event name as-is in camelCase\n return eventName;\n}\n/**\n * Escape HTML for display in code blocks\n */\nexport function escapeHTML(html) {\n return html\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#39;\");\n}\n/**\n * Add indentation to each line of text\n */\nexport function indent(text, indentStr, skipFirstLine = false) {\n const lines = text.split(\"\\n\");\n return lines\n .map((line, index) => {\n if (index === 0 && skipFirstLine)\n return line;\n if (line.trim() === \"\")\n return \"\";\n return indentStr + line;\n })\n .join(\"\\n\");\n}\n/**\n * Escape regex special characters\n */\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n/**\n * Format component title with story name if not default\n * Example: (\"Button\", \"Primary\") -> \"Button - Primary\"\n * Example: (\"Button\", \"Default\") -> \"Button\"\n */\nexport function formatTitle(title, component, storyName) {\n const baseTitle = title || component;\n // Don't add story name if it's \"Default\" or undefined\n if (!storyName || storyName === \"Default\") {\n return baseTitle;\n }\n return `${baseTitle} - ${storyName}`;\n}\n/**\n * Escape a string for safe embedding inside a JS template literal (backtick-delimited).\n * Escapes backslashes first, then backticks and dollar signs.\n */\nexport function escapeForTemplateLiteral(str) {\n return str.replace(/\\\\/g, \"\\\\\\\\\").replace(/`/g, \"\\\\`\").replace(/\\$/g, \"\\\\$\");\n}\n/**\n * Escape a string for safe embedding inside a single-quoted attribute/value.\n * Escapes backslashes first, then single quotes.\n */\nexport function escapeForSingleQuotedAttr(str) {\n return str.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\");\n}\n", "import { escapeForSingleQuotedAttr, escapeForTemplateLiteral, toAngularEventName, toCamelCase, toHandlerFunctionName, toPascalCase, } from \"../utils/string-utils.js\";\n/**\n * Formats components into Angular standalone component code\n */\nexport class AngularCodeFormatter {\n /**\n * Format component structure to Angular template HTML\n */\n formatComponent(component, options) {\n const { indent = \" \" } = options;\n const isFirstOfType = new Map();\n return this.structureToHTML(component.structure, component, indent, isFirstOfType);\n }\n /**\n * Format event handlers for Angular\n */\n formatEventHandlers(component, _options) {\n if (component.events.length === 0)\n return \"\";\n return component.events\n .map((event) => {\n const handlerName = toHandlerFunctionName(event.name);\n return ` protected ${handlerName}(event: CustomEvent) {\n console.log('${event.name}:', event);\n // Add your handler logic here\n }`;\n })\n .join(\"\\n\\n\");\n }\n /**\n * Format imports for Angular\n */\n formatImports(component) {\n const componentTags = this.collectComponentTags(component.structure);\n // Only import Infineon components (starting with ifx-), not native HTML elements\n const imports = Array.from(componentTags)\n .filter((tag) => tag.startsWith(\"ifx-\"))\n .map((tag) => toPascalCase(tag))\n .sort()\n .join(\", \");\n return `import { ${imports} } from '@infineon/infineon-design-system-angular/standalone';`;\n }\n /**\n * Generate complete Angular component TypeScript file content\n */\n formatComponentTypeScript(component) {\n const componentName = toPascalCase(component.component);\n const storyNameSuffix = component.storyName && component.storyName !== \"Default\"\n ? component.storyName.replace(/\\s+/g, \"\")\n : \"\";\n const componentClassName = `${componentName}${storyNameSuffix}Example`;\n const selectorSuffix = component.storyName && component.storyName !== \"Default\"\n ? `-${component.storyName.toLowerCase().replace(/\\s+/g, \"-\")}`\n : \"\";\n const componentSelector = `${component.component}-example${selectorSuffix}`;\n const imports = this.formatImports(component);\n const eventHandlers = this.formatEventHandlers(component, { indent: \" \" });\n const componentTags = this.collectComponentTags(component.structure);\n // Only import Infineon components (starting with ifx-), not native HTML elements\n const componentImports = Array.from(componentTags)\n .filter((tag) => tag.startsWith(\"ifx-\"))\n .map((tag) => toPascalCase(tag))\n .sort()\n .join(\", \");\n // Generate the code strings for display\n const html = this.structureToHTML(component.structure, component, \" \", new Map());\n const tsCode = this.generateTypeScriptCode(component, componentImports, eventHandlers);\n const htmlCode = this.escapeHtml(html);\n return `${imports}\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'app-${componentSelector}',\n imports: [ ${componentImports} ],\n templateUrl: './${componentSelector}.html',\n\tstyleUrl: './${componentSelector}.scss'\n})\nexport class ${componentClassName} {\n protected readonly tsCode = \\`${this.escapeBackticks(tsCode)}\\`;\n protected readonly htmlCode = \\`${this.escapeBackticks(htmlCode)}\\`;\n${eventHandlers ? `\\n${eventHandlers}\\n` : \"\"}}\n`;\n }\n /**\n * Generate complete Angular component template HTML file content\n */\n formatComponentTemplate(component) {\n const html = this.formatComponent(component, { indent: \" \" });\n const selectorSuffix = component.storyName && component.storyName !== \"Default\"\n ? `-${component.storyName.toLowerCase().replace(/\\s+/g, \"-\")}`\n : \"\";\n const componentSelector = `${component.component}-example${selectorSuffix}`;\n return `${html}\n\n<details class=\"code-details\">\n <summary>View Code</summary>\n <div class=\"code-blocks\">\n <h3>${componentSelector}.ts</h3>\n <pre><code class=\"language-typescript\" [innerHTML]=\"tsCode\"></code></pre>\n \n <h3>${componentSelector}.html</h3>\n <pre><code class=\"language-markup\" [innerHTML]=\"htmlCode\"></code></pre>\n </div>\n</details>\n`;\n }\n /**\n * Generate component SCSS file content\n */\n formatComponentStyles() {\n return `// Add component-specific styles here\n`;\n }\n /**\n * Generate TypeScript code for display\n */\n generateTypeScriptCode(component, componentImports, eventHandlers) {\n const imports = this.formatImports(component);\n const componentName = toPascalCase(component.component);\n const storyNameSuffix = component.storyName && component.storyName !== \"Default\"\n ? component.storyName.replace(/\\s+/g, \"\")\n : \"\";\n const componentClassName = `${componentName}${storyNameSuffix}Example`;\n const selectorSuffix = component.storyName && component.storyName !== \"Default\"\n ? `-${component.storyName.toLowerCase().replace(/\\s+/g, \"-\")}`\n : \"\";\n const componentSelector = `${component.component}-example${selectorSuffix}`;\n let tsCode = `${imports}\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'app-${componentSelector}',\n imports: [ ${componentImports} ],\n templateUrl: './${componentSelector}.html',\n\tstyleUrl: './${componentSelector}.scss'\n})\nexport class ${componentClassName} {`;\n if (eventHandlers) {\n tsCode += `\\n${eventHandlers}\\n`;\n }\n tsCode += `}`;\n return this.escapeHtml(tsCode);\n }\n /**\n * Escape backticks for template literal\n */\n escapeBackticks(str) {\n // First escape backslashes, then backticks and dollar signs.\n // This avoids introducing escape sequences that could break the surrounding\n // template literal when the input already contains backslashes.\n return escapeForTemplateLiteral(str);\n }\n /**\n * Escape HTML for display in code block\n */\n escapeHtml(html) {\n return html\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#039;\");\n }\n /**\n * Convert component structure to Angular template HTML\n */\n structureToHTML(struct, componentInfo, indent, isFirstOfType) {\n const tag = struct.tag;\n // Track if this is the first occurrence of this tag type (for events)\n const isFirst = !isFirstOfType.has(tag);\n if (isFirst) {\n isFirstOfType.set(tag, true);\n }\n // Convert attributes from the actual story DOM only\n const attrs = Object.entries(struct.attributes)\n .map(([key, value]) => this.toAngularAttribute(key, value, componentInfo, tag))\n .filter((attr) => attr !== null);\n // Check if this specific element type should have event handlers\n const shouldAddEvents = componentInfo.events.length > 0 &&\n (struct.children && struct.children.length > 0\n ? tag !== componentInfo.component\n : tag.includes(componentInfo.component));\n // Add event handlers for children elements only on first occurrence\n if (shouldAddEvents && isFirst) {\n componentInfo.events.forEach((event) => {\n const angularEventName = toAngularEventName(event.name);\n const handlerName = toHandlerFunctionName(event.name);\n attrs.push(`(${angularEventName})=\"${handlerName}($any($event))\"`);\n });\n }\n // Format opening tag with attributes\n const openTag = this.formatOpeningTag(tag, attrs, indent);\n // Handle children\n if (struct.children && struct.children.length > 0) {\n const childrenHTML = struct.children\n .map((child) => this.structureToHTML(child, componentInfo, `${indent} `, isFirstOfType))\n .join(\"\\n\");\n return `${openTag}>\\n${childrenHTML}\\n${indent}</${tag}>`;\n }\n // Handle text content\n if (struct.textContent) {\n // Don't add extra whitespace - Angular hydration is sensitive to exact text nodes\n // Normalize all whitespace to single spaces\n const trimmedText = struct.textContent.trim().replace(/\\s+/g, \" \");\n return `${openTag}>${trimmedText}</${tag}>`;\n }\n // Self-closing tag\n return `${openTag}></${tag}>`;\n }\n /**\n * Format opening tag with attributes\n */\n formatOpeningTag(tag, attrs, indent) {\n if (attrs.length === 0) {\n return `${indent}<${tag}`;\n }\n else if (attrs.length === 1) {\n return `${indent}<${tag} ${attrs[0]}`;\n }\n else {\n const attrsString = attrs.map((attr) => `${indent} ${attr}`).join(\"\\n\");\n return `${indent}<${tag}\\n${attrsString}`;\n }\n }\n /**\n * Convert attribute to Angular template syntax\n */\n toAngularAttribute(name, value, componentInfo, tag) {\n // Skip undefined values\n if (value === \"undefined\")\n return null;\n // Normalize Angular-style property binding syntax on custom elements: [prop]=\"...\"\n // We convert these into plain attributes so the web component receives string values reliably.\n let attrName = name;\n let attrValue = value;\n const isBracketBinding = attrName.startsWith(\"[\") && attrName.endsWith(\"]\");\n if (isBracketBinding) {\n attrName = attrName.slice(1, -1); // strip brackets\n // If value is quoted Angular expression like `'text'`, strip quotes\n const m = attrValue.match(/^['\"]([\\s\\S]*)['\"]$/);\n if (m)\n attrValue = m[1];\n }\n if (attrValue.startsWith(\"__JSON__\")) {\n attrValue = attrValue.replace(/^__JSON__/, \"\");\n }\n const isBooleanProp = this.isBooleanProp(attrName, tag, componentInfo);\n const bindingName = toCamelCase(attrName);\n // Boolean values\n if (attrValue === \"true\") {\n return isBooleanProp ? `[${bindingName}]=\"true\"` : `${attrName}=\"true\"`;\n }\n if (attrValue === \"false\") {\n return isBooleanProp ? `[${bindingName}]=\"false\"` : `${attrName}=\"false\"`;\n }\n if (attrValue === \"\") {\n return isBooleanProp ? `[${bindingName}]=\"true\"` : `${attrName}=\"\"`;\n }\n // Numeric values\n if (!Number.isNaN(Number(attrValue)) &&\n attrValue !== \"\" &&\n attrValue !== \"null\") {\n return `${attrName}=\"${attrValue}\"`;\n }\n // Null\n if (attrValue === \"null\")\n return null;\n // JSON arrays or objects (contain { or [ at start) - use property binding\n // Some DOM attributes coerce arrays/objects to \"[object Object]\"; prefer defaultArgs when available\n if (attrValue.startsWith(\"[\") ||\n attrValue.startsWith(\"{\") ||\n attrValue.includes(\"[object Object\")) {\n const camelName = toCamelCase(attrName);\n const original = componentInfo?.defaultArgs?.[camelName];\n let jsonString = attrValue;\n if (original !== undefined && typeof original === \"object\") {\n try {\n jsonString = JSON.stringify(original);\n }\n catch {\n // keep existing value if stringify fails\n }\n }\n const escapedValue = escapeForSingleQuotedAttr(jsonString);\n // Bind as string attribute (web components commonly parse JSON from attribute string)\n return `${attrName}='${escapedValue}'`;\n }\n // String values\n return `${attrName}=\"${attrValue}\"`;\n }\n isBooleanProp(name, tag, componentInfo) {\n const typeText = componentInfo.propTypes[tag]?.[name];\n return typeText === \"boolean\";\n }\n /**\n * Collect all unique component tags from structure (for imports)\n */\n collectComponentTags(struct, tags = new Set()) {\n tags.add(struct.tag);\n if (struct.children && struct.children.length > 0) {\n struct.children.forEach((child) => {\n this.collectComponentTags(child, tags);\n });\n }\n return tags;\n }\n}\n", "import { escapeHTML, formatTitle } from \"../utils/string-utils.js\";\n/**\n * Formats components into HTML/Web Component code\n */\nexport class HTMLCodeFormatter {\n /**\n * Format component structure to HTML (component only, no wrapping)\n */\n formatComponent(component, options) {\n const { indent = \"\" } = options;\n return this.structureToHTML(component.structure, indent);\n }\n /**\n * Format complete example section with component, title, and code preview\n * Used by example generators to create full example pages\n */\n formatFullExample(component, options) {\n const { indent = \" \" } = options;\n return `\n <!-- ${component.component.toUpperCase()} Example -->\n <section id=\"${component.component}-example\" class=\"component-example\">\n <h2>${formatTitle(component.title, component.component, component.storyName)}</h2>\n <div class=\"demo\">\n${this.structureToHTML(component.structure, indent)}\n </div>\n <details class=\"code-details\">\n <summary>View Code</summary>\n <pre><code class=\"language-markup\">${escapeHTML(this.structureToHTML(component.structure, \"\"))}</code></pre>\n </details>\n </section>\n`;\n }\n /**\n * Format event handlers for HTML\n */\n formatEventHandlers(component, _options) {\n if (component.events.length === 0)\n return \"\";\n const handlers = component.events\n .map((event) => {\n const elementSelector = `document.querySelector('#${component.component}-example ${component.component}')`;\n // Handle multi-line descriptions by prefixing each line with //\n const commentLines = event.description\n .split(\"\\n\")\n .map((line) => ` // ${line.trim()}`)\n .join(\"\\n\");\n return `${commentLines}\n ${elementSelector}?.addEventListener('${event.name}', (event) => {\n console.log('${event.name}:', event);\n // Add your custom handler logic here\n });`;\n })\n .join(\"\\n\\n\");\n return handlers;\n }\n /**\n * Format imports (not used for HTML/vanilla)\n */\n formatImports(_component) {\n return \"\";\n }\n /**\n * Convert component structure to HTML string\n */\n structureToHTML(struct, indent) {\n const attrs = this.attributesToString(struct.attributes);\n const openTag = `${indent}<${struct.tag}${attrs ? ` ${attrs}` : \"\"}>`;\n let content = \"\";\n if (struct.textContent) {\n content = struct.textContent;\n }\n if (struct.children && struct.children.length > 0) {\n const childHTML = struct.children\n .map((child) => this.structureToHTML(child, `${indent} `))\n .join(\"\\n\");\n content = `\\n${childHTML}\\n${indent}`;\n }\n const closeTag = `</${struct.tag}>`;\n return `${openTag}${content}${closeTag}`;\n }\n /**\n * Convert attributes object to HTML string\n */\n attributesToString(attrs) {\n return Object.entries(attrs)\n .filter(([_, value]) => value !== \"undefined\" && value !== \"null\") // Skip undefined/null values\n .map(([key, value]) => {\n if (value.startsWith(\"__JSON__\")) {\n const jsonValue = value.replace(/^__JSON__/, \"\");\n return `${key}='${jsonValue}'`;\n }\n // For JSON arrays/objects, use single quotes to wrap the attribute value\n if (value.startsWith(\"[\") || value.startsWith(\"{\")) {\n return `${key}='${value}'`;\n }\n // For regular strings, use double quotes\n return `${key}=\"${value}\"`;\n })\n .join(\" \");\n }\n}\n", "import { escapeForTemplateLiteral, toCamelCase, toHandlerFunctionName, toPascalCase, toReactEventName, } from \"../utils/string-utils.js\";\n/**\n * Formats components into React/JSX code\n */\nexport class ReactCodeFormatter {\n /**\n * Format component structure to React JSX\n */\n formatComponent(component, options) {\n const { indent = \" \" } = options;\n const isFirstOfType = new Map();\n return this.structureToJSX(component.structure, component, indent, isFirstOfType);\n }\n /**\n * Format event handlers for React\n */\n formatEventHandlers(component, _options) {\n if (component.events.length === 0)\n return \"\";\n return component.events\n .map((event) => {\n const handlerName = toHandlerFunctionName(event.name);\n return ` const ${handlerName} = (event: CustomEvent) => {\n console.log('${event.name}:', event);\n // Add your handler logic here\n };`;\n })\n .join(\"\\n\\n\");\n }\n /**\n * Format imports for React\n */\n formatImports(component) {\n const componentTags = this.collectComponentTags(component.structure);\n // Only import Infineon components (starting with ifx-), not native HTML elements\n const imports = Array.from(componentTags)\n .filter((tag) => tag.startsWith(\"ifx-\"))\n .map((tag) => toPascalCase(tag))\n .sort()\n .join(\", \");\n return `import { ${imports} } from '@infineon/infineon-design-system-react';`;\n }\n /**\n * Generate complete React component file content\n */\n formatComponentFile(component) {\n const componentName = toPascalCase(component.component);\n const storyNameSuffix = component.storyName && component.storyName !== \"Default\"\n ? component.storyName.replace(/\\s+/g, \"\")\n : \"\";\n const componentClassName = `${componentName}${storyNameSuffix}Example`;\n const imports = this.formatImports(component);\n const eventHandlers = this.formatEventHandlers(component, { indent: \" \" });\n const jsx = this.formatComponent(component, { indent: \" \" });\n // Generate the code string for display\n const codeForDisplay = this.generateCodeForDisplay(component, eventHandlers, jsx);\n // Escape for safe embedding in a template literal\n const escapedCodeForDisplay = escapeForTemplateLiteral(codeForDisplay);\n return `${imports}\n\nexport function ${componentClassName}() {\n${eventHandlers ? `${eventHandlers}\\n\\n` : \"\"} return (\n <>\n${jsx}\n <details className=\"code-details\">\n <summary>View Code</summary>\n <pre><code className=\"language-tsx\">{codeString}</code></pre>\n </details>\n </>\n );\n}\n\nconst codeString = \\`${escapedCodeForDisplay}\\`;\n`;\n }\n /**\n * Generate code string for display in the details section\n */\n generateCodeForDisplay(component, eventHandlers, jsx) {\n const componentName = toPascalCase(component.component);\n const imports = this.formatImports(component);\n // Build the display code without the details section\n let displayCode = `${imports}\n\nexport function ${componentName}Example() {`;\n if (eventHandlers) {\n displayCode += `\\n${eventHandlers}\\n`;\n }\n displayCode += `\\n return (\\n${jsx}\\n );\\n}`;\n return displayCode;\n }\n /**\n * Convert component structure to React JSX\n */\n structureToJSX(struct, componentInfo, indent, isFirstOfType) {\n // Use PascalCase for Infineon components (ifx-*), lowercase for native HTML\n const componentName = struct.tag.startsWith(\"ifx-\")\n ? toPascalCase(struct.tag)\n : struct.tag;\n // Track if this is the first occurrence of this tag type (for events)\n const isFirst = !isFirstOfType.has(struct.tag);\n if (isFirst) {\n isFirstOfType.set(struct.tag, true);\n }\n // Convert attributes to React props\n const propEntries = Object.entries(struct.attributes)\n .map(([key, value]) => {\n const propName = toCamelCase(key);\n const propValue = this.toReactPropValue(value, key);\n return propValue ? [propName, propValue] : null;\n })\n .filter(Boolean);\n // Add event handlers only to components that emit them (on first occurrence)\n const eventProps = [];\n if (isFirst && componentInfo.events.length > 0) {\n // Filter events to only those that belong to this specific component\n const relevantEvents = componentInfo.events.filter((event) => {\n // If sourceComponent is explicitly set, only attach to that component\n if (event.sourceComponent) {\n return event.sourceComponent === struct.tag;\n }\n // If no sourceComponent is set, attach to the main component\n return struct.tag === componentInfo.component;\n });\n relevantEvents.forEach((event) => {\n const reactEventName = toReactEventName(event.name);\n const handlerName = toHandlerFunctionName(event.name);\n eventProps.push([reactEventName, `{${handlerName}}`]);\n });\n }\n const allProps = [...propEntries, ...eventProps];\n // Format opening tag with props\n const openTag = this.formatOpeningTag(componentName, allProps, indent);\n // Handle children\n if (struct.children && struct.children.length > 0) {\n const childrenJSX = struct.children\n .map((child) => this.structureToJSX(child, componentInfo, `${indent} `, isFirstOfType))\n .join(\"\\n\");\n return `${openTag}>\\n${childrenJSX}\\n${indent}</${componentName}>`;\n }\n // Handle text content\n if (struct.textContent) {\n const trimmedText = struct.textContent.trim();\n return `${openTag}>\\n${indent} ${trimmedText}\\n${indent}</${componentName}>`;\n }\n // Self-closing tag\n return `${openTag} />`;\n }\n /**\n * Format opening tag with props\n */\n formatOpeningTag(componentName, props, indent) {\n if (props.length === 0) {\n return `${indent}<${componentName}`;\n }\n else if (props.length === 1) {\n const [name, value] = props[0];\n return `${indent}<${componentName} ${name}=${value}`;\n }\n else {\n const propsString = props\n .map(([name, value]) => `${indent} ${name}=${value}`)\n .join(\"\\n\");\n return `${indent}<${componentName}\\n${propsString}`;\n }\n }\n /**\n * Convert attribute value to React prop value\n */\n toReactPropValue(value, _attrName) {\n // Skip undefined values\n if (value === \"undefined\")\n return null;\n // Boolean values\n if (value === \"true\")\n return \"{true}\";\n if (value === \"false\")\n return \"{false}\";\n // Numeric values\n if (!Number.isNaN(Number(value)) && value !== \"\" && value !== \"null\") {\n return `{${value}}`;\n }\n // Null\n if (value === \"null\")\n return null;\n if (value.startsWith(\"__JSON__\")) {\n const jsonValue = value.replace(/^__JSON__/, \"\");\n return `{${jsonValue}}`;\n }\n // Try to detect if this is a JSON array or object string\n // These should be passed as JavaScript objects in React, not strings\n const trimmedValue = value.trim();\n if ((trimmedValue.startsWith(\"[\") && trimmedValue.endsWith(\"]\")) ||\n (trimmedValue.startsWith(\"{\") && trimmedValue.endsWith(\"}\"))) {\n try {\n // Validate it's proper JSON\n JSON.parse(value);\n // Return as a JavaScript expression literal (no JSON.parse)\n return `{${value}}`;\n }\n catch {\n // If not valid JSON, treat as string\n }\n }\n // String values - if contains quotes, use JSX expression with template literal\n if (value.includes('\"') || value.includes(\"'\")) {\n // Escape backslashes, backticks and dollar signs for template literals\n const escapedValue = escapeForTemplateLiteral(value);\n return `{\\`${escapedValue}\\`}`;\n }\n return `\"${value}\"`;\n }\n /**\n * Collect all unique component tags from structure (for imports)\n */\n collectComponentTags(struct, tags = new Set()) {\n tags.add(struct.tag);\n if (struct.children && struct.children.length > 0) {\n struct.children.forEach((child) => {\n this.collectComponentTags(child, tags);\n });\n }\n return tags;\n }\n}\n", "import { escapeForSingleQuotedAttr, escapeForTemplateLiteral, toHandlerFunctionName, } from \"../utils/string-utils.js\";\n/**\n * Formats components into Vue/SFC code\n */\nexport class VueCodeFormatter {\n /**\n * Format component structure to Vue template\n */\n formatComponent(component, options) {\n const { indent = \" \" } = options;\n const isFirstOfType = new Map();\n return this.structureToTemplate(component.structure, component, indent, isFirstOfType);\n }\n /**\n * Format event handlers for Vue\n */\n formatEventHandlers(component, _options) {\n if (component.events.length === 0)\n return \"\";\n return component.events\n .map((event) => {\n const handlerName = toHandlerFunctionName(event.name);\n return `const ${handlerName} = (event: CustomEvent) => {\n console.log('${event.name}:', event);\n // Add your handler logic here\n};`;\n })\n .join(\"\\n\\n\");\n }\n /**\n * Format imports for Vue\n */\n formatImports(_component) {\n // Vue wrapper uses component registration, not individual imports\n return \"\";\n }\n /**\n * Extract all unique Ifx component tags from the component structure\n */\n extractIfxComponents(structure) {\n const components = new Set();\n // Check if current tag is an Ifx component\n if (structure.tag.startsWith(\"ifx-\")) {\n // Convert kebab-case to PascalCase (e.g., 'ifx-accordion' -> 'IfxAccordion')\n const pascalCase = structure.tag\n .split(\"-\")\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(\"\");\n components.add(pascalCase);\n }\n // Recursively check children\n if (structure.children) {\n for (const child of structure.children) {\n const childComponents = this.extractIfxComponents(child);\n for (const comp of childComponents) {\n components.add(comp);\n }\n }\n }\n return components;\n }\n /**\n * Generate complete Vue SFC file content\n */\n formatComponentFile(component) {\n const eventHandlers = this.formatEventHandlers(component, { indent: \" \" });\n const template = this.formatComponent(component, { indent: \" \" });\n // Extract all Ifx components used in this example\n const ifxComponents = this.extractIfxComponents(component.structure);\n const componentImports = ifxComponents.size > 0\n ? `\\nimport { ${Array.from(ifxComponents).sort().join(\", \")} } from '@infineon/infineon-design-system-vue';`\n : \"\";\n // Generate the code string for display\n const codeForDisplay = this.generateCodeForDisplay(component, eventHandlers, template);\n const escapedCodeForDisplay = escapeForTemplateLiteral(codeForDisplay);\n const brokenScriptClosingTag = `\\${'</'}script>`;\n const brokenTemplateClosingTag = `\\${'</'}template>`;\n // Break up closing tags using template expressions to prevent Vue SFC parser issues\n // Replace </script> with ${'</'}script> and </template> with ${'</'}template>\n const codeWithBrokenTags = escapedCodeForDisplay\n .replace(/<\\/script>/g, brokenScriptClosingTag)\n .replace(/<\\/template>/g, brokenTemplateClosingTag);\n return `<script setup lang=\"ts\">\n${componentImports}\n\n${eventHandlers ? `${eventHandlers}\\n\\n` : \"\"}const codeString = \\`${codeWithBrokenTags}\\`;\n\n</script>\n\n<template>\n <div>\n${template}\n <details class=\"code-details\">\n <summary>View Code</summary>\n <pre><code class=\"language-markup\">{{ codeString }}</code></pre>\n </details>\n </div>\n</template>\n`;\n }\n /**\n * Generate code string for display in the details section\n */\n generateCodeForDisplay(_component, eventHandlers, template) {\n let displayCode = '<script setup lang=\"ts\">';\n if (eventHandlers) {\n displayCode += `\\n${eventHandlers}`;\n }\n displayCode += `\\n</script>\\n\\n<template>\\n <div>\\n${template}\\n </div>\\n</template>`;\n return displayCode;\n }\n /**\n * Convert component structure to Vue template\n */\n structureToTemplate(struct, componentInfo, indent, isFirstOfType) {\n const componentName = struct.tag;\n // Track if this is the first occurrence of this tag type (for events)\n const isFirst = !isFirstOfType.has(struct.tag);\n if (isFirst) {\n isFirstOfType.set(struct.tag, true);\n }\n // Convert attributes to Vue props (keep kebab-case for Vue)\n const propEntries = Object.entries(struct.attributes)\n .map(([key, value]) => {\n const propValue = this.toVuePropValue(value, key);\n if (!propValue)\n return null;\n // Check if propValue has the __BOOLEAN__ marker for boolean values\n if (propValue.startsWith(\"__BOOLEAN__\")) {\n // Remove the __BOOLEAN__ marker and get the boolean value\n const boolValue = propValue.replace(/^__BOOLEAN__/, \"\");\n // Use v-bind with the boolean value\n return [`:${key}`, `\"${boolValue}\"`];\n }\n // Check if propValue has the __VBIND__ marker for JSON objects/arrays\n if (propValue.startsWith(\"__VBIND__\")) {\n // Remove the __VBIND__ marker and extract the actual value (with quotes)\n const actualValue = propValue.replace(/^__VBIND__/, \"\");\n // Use v-bind with a JSON literal wrapped in single quotes\n return [`:${key}`, actualValue];\n }\n // Check if propValue has the __VBIND_NUMBER__ marker for numeric values\n if (propValue.startsWith(\"__VBIND_NUMBER__\")) {\n const numberValue = propValue.replace(/^__VBIND_NUMBER__/, \"\");\n return [`:${key}`, numberValue];\n }\n return [key, propValue];\n })\n .filter(Boolean);\n // Check if this specific element type should have event handlers\n const shouldAddEvents = componentInfo.events.length > 0 &&\n (struct.children && struct.children.length > 0\n ? struct.tag !== componentInfo.component\n : struct.tag.includes(componentInfo.component));\n // Add event handlers for children elements only on first occurrence\n const eventProps = [];\n if (shouldAddEvents && isFirst) {\n componentInfo.events.forEach((event) => {\n const handlerName = toHandlerFunctionName(event.name);\n eventProps.push([`@${event.name}`, `\"${handlerName}\"`]);\n });\n }\n const allProps = [...propEntries, ...eventProps];\n // Format opening tag with props\n const openTag = this.formatOpeningTag(componentName, allProps, indent);\n // Handle children\n if (struct.children && struct.children.length > 0) {\n const childrenTemplate = struct.children\n .map((child) => this.structureToTemplate(child, componentInfo, `${indent} `, isFirstOfType))\n .join(\"\\n\");\n return `${openTag}>\\n${childrenTemplate}\\n${indent}</${componentName}>`;\n }\n // Handle text content\n if (struct.textContent) {\n const trimmedText = struct.textContent.trim();\n return `${openTag}>\\n${indent} ${trimmedText}\\n${indent}</${componentName}>`;\n }\n // Self-closing tag\n return `${openTag} />`;\n }\n /**\n * Format opening tag with props\n */\n formatOpeningTag(componentName, props, indent) {\n if (props.length === 0) {\n return `${indent}<${componentName}`;\n }\n else if (props.length === 1) {\n const [name, value] = props[0];\n return `${indent}<${componentName} ${name}=${value}`;\n }\n else {\n const propsString = props\n .map(([name, value]) => `${indent} ${name}=${value}`)\n .join(\"\\n\");\n return `${indent}<${componentName}\\n${propsString}`;\n }\n }\n /**\n * Convert attribute value to Vue prop value\n */\n toVuePropValue(value, _attrName) {\n // Skip undefined values\n if (value === \"undefined\")\n return null;\n // Boolean values - use special marker for v-bind\n if (value === \"true\")\n return \"__BOOLEAN__true\";\n if (value === \"false\")\n return \"__BOOLEAN__false\";\n // Numeric values\n if (!Number.isNaN(Number(value)) && value !== \"\" && value !== \"null\") {\n return `__VBIND_NUMBER__${value}`;\n }\n // Null\n if (value === \"null\")\n return null;\n // JSON marker from parser (object/array values)\n if (value.startsWith(\"__JSON__\")) {\n const jsonValue = value.replace(/^__JSON__/, \"\");\n const escapedValue = escapeForSingleQuotedAttr(jsonValue);\n return `__VBIND__'${escapedValue}'`;\n }\n // String values - if contains double quotes, use single quotes for wrapper\n if (value.includes('\"')) {\n // Escape backslashes and single quotes in the value, then wrap in single quotes\n const escapedValue = escapeForSingleQuotedAttr(value);\n return `'${escapedValue}'`;\n }\n return `\"${value}\"`;\n }\n}\n", "import { render } from \"@lit-labs/ssr\";\nimport { collectResultSync } from \"@lit-labs/ssr/lib/render-result.js\";\nimport { cleanLitHTML, unwrapComponent } from \"./utils/html-utils.js\";\n/**\n * Renders a single story export to HTML string\n * Handles CSF2 (function exports) and CSF3 (object with render function)\n *\n * @param storyExport - The story export (function or object with render)\n * @param args - Arguments to pass to the story\n * @returns HTML string or null if rendering failed\n */\nexport function renderStoryToHTML(storyExport, args) {\n // Handle both CSF2 (function) and CSF3 (object with render) formats\n let result;\n if (typeof storyExport === \"function\") {\n // CSF2: Story is a function\n result = storyExport(args);\n }\n else if (storyExport &&\n typeof storyExport === \"object\" &&\n \"render\" in storyExport) {\n // CSF3: Story is an object with a render function\n // Merge story-specific args with default args\n const storyArgs = { ...args, ...(storyExport.args || {}) };\n result = storyExport.render(storyArgs);\n }\n else {\n return null;\n }\n if (!result) {\n return null;\n }\n let html;\n // Handle Lit TemplateResult\n if (result && typeof result === \"object\" && \"_$litType$\" in result) {\n const ssrResult = render(result);\n html = collectResultSync(ssrResult);\n html = cleanLitHTML(html);\n }\n // Handle string template\n else if (typeof result === \"string\") {\n html = result;\n }\n // Handle DOM element\n else if (result && typeof result === \"object\" && \"outerHTML\" in result) {\n html = result.outerHTML;\n }\n else {\n return null;\n }\n return html;\n}\n/**\n * Converts HTML string to DOM element and optionally unwraps it\n *\n * @param html - HTML string to parse\n * @param unwrap - Whether to unwrap wrapper divs\n * @returns DOM Element or null\n */\nexport function htmlToElement(html, unwrap = true) {\n const tempDiv = document.createElement(\"div\");\n tempDiv.innerHTML = html.trim();\n let element = tempDiv.firstElementChild;\n if (!element) {\n return null;\n }\n // Unwrap wrapper divs if requested\n if (unwrap) {\n element = unwrapComponent(element);\n }\n return element;\n}\n", "import { JSDOM } from \"jsdom\";\nlet isDomSetup = false;\n/**\n * Sets up a minimal jsdom environment for parsing stories\n * This only needs to be called once\n */\nexport function setupDOM() {\n if (isDomSetup)\n return;\n const dom = new JSDOM(\"<!DOCTYPE html><html><body></body></html>\", {\n url: \"http://localhost\",\n pretendToBeVisual: true,\n });\n global.document = dom.window.document;\n global.window = dom.window;\n global.HTMLElement = dom.window.HTMLElement;\n global.Element = dom.window.Element;\n // Mock querySelector/querySelectorAll to return safe objects\n const originalQuerySelector = dom.window.document.querySelector.bind(dom.window.document);\n const originalQuerySelectorAll = dom.window.document.querySelectorAll.bind(dom.window.document);\n const mockElement = dom.window.document.createElement(\"div\");\n const emptyNodeList = dom.window.document\n .createDocumentFragment()\n .querySelectorAll(\"*\");\n dom.window.document.querySelector = (selector) => {\n const element = originalQuerySelector(selector);\n return element ?? mockElement;\n };\n dom.window.document.querySelectorAll = (selector) => {\n const elements = originalQuerySelectorAll(selector);\n return elements.length > 0 ? elements : emptyNodeList;\n };\n // Stub out setTimeout to prevent async event listener attachments during SSR\n global.setTimeout = (() => 0);\n isDomSetup = true;\n}\n", "import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { htmlToElement, renderStoryToHTML } from \"./story-renderer.js\";\nimport { setupDOM } from \"./utils/dom-utils.js\";\n// Ensure DOM is set up before parsing stories\nsetupDOM();\nlet cemCache = null;\nfunction toKebabCase(value) {\n return value\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .replace(/\\s+/g, \"-\")\n .toLowerCase();\n}\nfunction findCemPath() {\n let current = process.cwd();\n for (let i = 0; i < 6; i += 1) {\n const candidate = path.join(current, \"packages\", \"components\", \"dist\", \"cem.json\");\n if (fs.existsSync(candidate))\n return candidate;\n const parent = path.dirname(current);\n if (parent === current)\n break;\n current = parent;\n }\n return null;\n}\nfunction loadCem() {\n if (cemCache)\n return cemCache;\n try {\n const cemPath = findCemPath();\n if (!cemPath)\n return null;\n const cem = JSON.parse(fs.readFileSync(cemPath, \"utf-8\"));\n const map = new Map();\n for (const module of cem.modules || []) {\n for (const decl of module.declarations || []) {\n if (!decl.customElement || !decl.tagName)\n continue;\n const allowed = new Set();\n const attributeTypes = new Map();\n for (const attr of decl.attributes || []) {\n // CEM attributes have a canonical kebab `name`\n const kebab = attr.name || (attr.fieldName ? toKebabCase(attr.fieldName) : \"\");\n if (!kebab)\n continue;\n allowed.add(kebab);\n if (attr.fieldName) {\n allowed.add(attr.fieldName);\n allowed.add(attr.fieldName.toLowerCase());\n }\n allowed.add(kebab.toLowerCase());\n if (attr.type?.text) {\n attributeTypes.set(kebab, attr.type.text);\n }\n }\n const events = (decl.events || []).map((ev) => ({\n name: ev.name || \"\",\n description: ev.description || \"\",\n sourceComponent: decl.tagName || null,\n }));\n map.set(decl.tagName, {\n allowedAttributes: allowed,\n attributeTypes,\n events,\n });\n }\n }\n cemCache = map;\n return cemCache;\n }\n catch {\n return null;\n }\n}\n/** Collect events from CEM for all ifx-* tags present in the component structure */\nfunction extractEventsFromCem(structure, cem) {\n const events = [];\n const visited = new Set();\n function walk(struct) {\n const { tag } = struct;\n if (!visited.has(tag) && tag.startsWith(\"ifx-\")) {\n visited.add(tag);\n const info = cem.get(tag);\n if (info)\n events.push(...info.events);\n }\n for (const child of struct.children)\n walk(child);\n }\n walk(structure);\n return events;\n}\n/** Build propTypes map (tag \u2192 kebab-attr-name \u2192 type text) for all tags in the structure */\nfunction buildPropTypesFromCem(structure, cem) {\n const result = {};\n function walk(struct) {\n const { tag } = struct;\n if (!(tag in result) && tag.startsWith(\"ifx-\")) {\n const info = cem.get(tag);\n if (info) {\n result[tag] = Object.fromEntries(info.attributeTypes);\n }\n }\n for (const child of struct.children)\n walk(child);\n }\n walk(structure);\n return result;\n}\n/**\n * Recursively parses a DOM element into a structured format\n */\nexport function parseElement(element) {\n if (!element) {\n throw new Error(\"parseElement received undefined or null element\");\n }\n if (!element.tagName) {\n throw new Error(`Element does not have a tagName property. Received: ${typeof element}, value: ${JSON.stringify(element)}`);\n }\n const structure = {\n tag: element.tagName.toLowerCase(),\n attributes: {},\n textContent: \"\",\n children: [],\n };\n // Get attributes\n Array.from(element.attributes).forEach((attr) => {\n // Remove literal newlines and excess whitespace from attribute values\n structure.attributes[attr.name] = attr.value.replace(/\\s+/g, \" \").trim();\n });\n // Get direct text content (not from children)\n const directText = Array.from(element.childNodes)\n .filter((node) => node.nodeType === 3) // Text nodes only\n .map((node) => node.textContent?.trim() || \"\")\n .filter((text) => text.length > 0)\n .join(\" \");\n if (directText) {\n structure.textContent = directText;\n }\n // Parse children recursively\n Array.from(element.children).forEach((child) => {\n structure.children.push(parseElement(child));\n });\n return structure;\n}\n/**\n * Renders a story module to HTML (for MCP server use case)\n * Returns array of rendered stories with their names\n */\nexport async function renderStoriesToHTML(storyModule, options = {}) {\n const renderedStories = [];\n // Get the default export (story metadata)\n const storyMeta = storyModule.default || {};\n const defaultArgs = storyMeta.args || {};\n // Get all exported stories (excluding 'default')\n const storyExports = Object.keys(storyModule).filter((key) => key !== \"default\");\n if (storyExports.length === 0) {\n return [];\n }\n // Fallback story names to prefer\n const fallbackNames = [\n \"Default\",\n \"Single\",\n \"Primary\",\n \"Basic\",\n \"Medium\",\n \"DefaultState\",\n ];\n // Select which stories to render\n const storiesToRender = new Set();\n if (options.preferredStories && options.preferredStories.length > 0) {\n // Use specified stories\n for (const name of options.preferredStories) {\n if (storyExports.includes(name)) {\n storiesToRender.add(name);\n }\n }\n }\n else if (!options.renderAll) {\n // Try to find at least one fallback story\n for (const fallbackName of fallbackNames) {\n if (storyExports.includes(fallbackName)) {\n storiesToRender.add(fallbackName);\n break; // Only use the first matching fallback\n }\n }\n }\n // If no stories selected and renderAll is true, render all\n if (storiesToRender.size === 0 && options.renderAll) {\n for (const name of storyExports) {\n storiesToRender.add(name);\n }\n }\n // If still no stories, use the fallback logic from example-generator\n if (storiesToRender.size === 0) {\n for (const fallbackName of fallbackNames) {\n if (storyExports.includes(fallbackName)) {\n storiesToRender.add(fallbackName);\n break;\n }\n }\n }\n // Render each selected story\n for (const storyName of storiesToRender) {\n const storyExport = storyModule[storyName];\n const html = renderStoryToHTML(storyExport, defaultArgs);\n if (html) {\n // Parse to element and unwrap if needed\n const element = htmlToElement(html, true);\n if (element) {\n renderedStories.push({ name: storyName, html: element.outerHTML });\n }\n else {\n renderedStories.push({ name: storyName, html });\n }\n }\n }\n return renderedStories;\n}\n/**\n * Extracts complete component information from a story module\n * Returns an array of ComponentInfo, one for each story variant\n * (for example-generator use case)\n */\nexport async function extractComponentInfo(storyPath, storyNames) {\n try {\n // Convert relative path to absolute path from current working directory\n // This ensures the path is correctly resolved regardless of where dds-tooling is located\n const absolutePath = resolve(process.cwd(), storyPath);\n const fileUrl = pathToFileURL(absolutePath).href;\n // Dynamic import of the story module using file URL\n const storyModule = await import(fileUrl);\n const metadata = storyModule.default || {};\n // Determine which stories to extract\n const storiesToExtract = [];\n if (storyNames && storyNames.length > 0) {\n // Extract all specified stories that exist\n for (const storyName of storyNames) {\n if (storyModule[storyName]) {\n storiesToExtract.push({\n name: storyName,\n export: storyModule[storyName],\n });\n }\n }\n if (storiesToExtract.length === 0) {\n throw new Error(`None of the specified stories [${storyNames.join(\", \")}] found in ${storyPath}`);\n }\n }\n else {\n // Fallback: Try multiple story exports\n const fallbackNames = [\n \"Default\",\n \"Single\",\n \"Primary\",\n \"Basic\",\n \"Medium\",\n \"DefaultState\",\n ];\n for (const name of fallbackNames) {\n if (storyModule[name]) {\n storiesToExtract.push({ name, export: storyModule[name] });\n break; // Only take the first one in fallback mode\n }\n }\n if (storiesToExtract.length === 0) {\n throw new Error(`No Default/Single/Primary/Basic/Medium/DefaultState export found in ${storyPath}`);\n }\n }\n // Extract info for each story\n const results = [];\n for (const story of storiesToExtract) {\n const StoryExport = story.export;\n const usedStoryName = story.name;\n // Merge metadata.args (defaults) with StoryExport.args (overrides)\n const args = {\n ...(metadata.args || {}),\n ...(StoryExport.args || {}),\n };\n // Use the shared rendering utility to handle CSF2/CSF3 and Lit SSR\n const html = renderStoryToHTML(StoryExport, args);\n if (!html) {\n throw new Error(`Failed to render story to HTML. Story path: ${storyPath}, Story: ${usedStoryName}`);\n }\n // Convert HTML to DOM element and unwrap wrapper divs if needed\n const resolvedElement = htmlToElement(html, true);\n if (!resolvedElement) {\n throw new Error(`Failed to parse HTML into DOM element. Story path: ${storyPath}, Story: ${usedStoryName}`);\n }\n // Parse the structure\n const structure = parseElement(resolvedElement);\n const cem = loadCem();\n const cemTagInfo = cem?.get(structure.tag);\n // Merge story args into attributes that are not already serialized as HTML attrs.\n // Only include args that exist in CEM (to exclude story-only controls like \"amountOfItems\").\n if (cemTagInfo) {\n Object.entries(args).forEach(([key, value]) => {\n if (value === undefined || value === null)\n return;\n if (typeof value === \"function\")\n return;\n const kebabKey = toKebabCase(key);\n if (!cemTagInfo.allowedAttributes.has(key) &&\n !cemTagInfo.allowedAttributes.has(kebabKey) &&\n !cemTagInfo.allowedAttributes.has(key.toLowerCase()) &&\n !cemTagInfo.allowedAttributes.has(kebabKey.toLowerCase())) {\n return;\n }\n if (key in structure.attributes || kebabKey in structure.attributes)\n return;\n let normalized = null;\n if (typeof value === \"string\") {\n normalized = value;\n }\n else if (typeof value === \"number\" || typeof value === \"boolean\") {\n normalized = String(value);\n }\n else if (Array.isArray(value) || typeof value === \"object\") {\n normalized = `__JSON__${JSON.stringify(value)}`;\n }\n if (normalized !== null) {\n structure.attributes[kebabKey] = normalized;\n }\n });\n }\n const events = cem ? extractEventsFromCem(structure, cem) : [];\n const propTypes = cem ? buildPropTypesFromCem(structure, cem) : {};\n const title = metadata.title?.replace(/^Components\\//, \"\") || metadata.title;\n results.push({\n component: metadata.component || structure.tag,\n title,\n storyName: usedStoryName,\n structure,\n events,\n defaultArgs: args,\n propTypes,\n });\n }\n return results;\n }\n catch (error) {\n throw new Error(`Failed to extract component info from ${storyPath}: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n", "import type { Framework } from \"../runtime/types.js\";\n\nexport function getFrameworkNotes(framework: Framework, tag: string): string {\n\tconst componentName = tagToComponentName(tag);\n\n\tswitch (framework) {\n\t\tcase \"react\":\n\t\t\treturn `### React\n\nImport the component:\n\\`\\`\\`tsx\nimport { ${componentName} } from '@infineon/infineon-design-system-react';\n\\`\\`\\`\n\nUsage:\n- Use **PascalCase** component names: \\`<${componentName}>\\` instead of \\`<${tag}>\\`\n- Use **camelCase** for props: \\`onClick\\`, \\`className\\`, etc. (aria-label stays the same)\n- Event handlers use \\`on\\` prefix: \\`onIfxChange\\`, \\`onIfxClose\\`, etc.\n- Boolean props don't need explicit value: \\`<${componentName} disabled />\\``;\n\n\t\tcase \"vue\":\n\t\t\treturn `### Vue\n\nImport and register the library:\n\n\\`\\`\\`ts\nimport { ComponentLibrary } from '@infineon/infineon-design-system-vue';\napp.use(ComponentLibrary);\n\\`\\`\\`\n\nUsage:\n- Use **kebab-case** in templates: \\`<${tag}>\\`\n- Event handlers use \\`@\\` syntax: \\`@ifx-change=\"handler\"\\`\n- v-model binding can be used where supported`;\n\n\t\tcase \"angular\":\n\t\t\treturn `### Angular\n\n**Module-based approach:**\n\\`\\`\\`ts\nimport { InfineonDesignSystemModule } from '@infineon/infineon-design-system-angular';\n// For ngModel support on form components:\nimport { BooleanValueAccessor, TextValueAccessor } from '@infineon/infineon-design-system-angular';\n\n@NgModule({\n imports: [InfineonDesignSystemModule, FormsModule],\n})\n\\`\\`\\`\n\n**Standalone approach:**\n\\`\\`\\`ts\nimport { ${componentName} } from '@infineon/infineon-design-system-angular/standalone';\n// For ngModel support on form components:\nimport { BooleanValueAccessor, TextValueAccessor } from '@infineon/infineon-design-system-angular/standalone';\n\\`\\`\\`\n\nUsage:\n- Use **kebab-case** in templates: \\`<${tag}>\\`\n- Event handlers use parentheses: \\`(ifxChange)=\"handler($event)\"\\`\n- Property binding uses square brackets: \\`[disabled]=\"isDisabled\"\\`\n- Two-way binding with \\`[(ngModel)]\\` requires importing the appropriate ValueAccessor`;\n\n\t\tcase \"html\":\n\t\t\treturn `### Vanilla HTML/JavaScript\n\nInclude via CDN:\n\\`\\`\\`html\n<script type=\"module\" src=\"https://unpkg.com/@infineon/infineon-design-system-stencil/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js\"></script>\n<link rel=\"stylesheet\" href=\"https://unpkg.com/@infineon/infineon-design-system-stencil/dist/infineon-design-system-stencil/infineon-design-system-stencil.css\">\n\\`\\`\\`\n\nOr install via npm:\n\\`\\`\\`bash\nnpm install @infineon/infineon-design-system-stencil\n\\`\\`\\`\n\nand import in your JavaScript:\n\\`\\`\\`js\nimport '@infineon/infineon-design-system-stencil/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js';\nimport '@infineon/infineon-design-system-stencil/dist/infineon-design-system-stencil/infineon-design-system-stencil.css';\n\\`\\`\\`\n\nUsage:\n- Use **kebab-case**: \\`<${tag}>\\`\n- Event listeners: \\`element.addEventListener('ifxChange', handler)\\`\n- Properties via JavaScript: \\`element.disabled = true\\``;\n\n\t\tdefault:\n\t\t\treturn \"\";\n\t}\n}\n\nfunction tagToComponentName(tag: string): string {\n\t// Convert ifx-button -> IfxButton, ifx-text-field -> IfxTextField\n\treturn tag\n\t\t.split(\"-\")\n\t\t.map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n\t\t.join(\"\");\n}\n\nexport function normalizeComponentName(input: string): string {\n\t// If already kebab-case (contains hyphens), return as-is\n\tif (input.includes(\"-\")) {\n\t\treturn input.toLowerCase();\n\t}\n\n\t// Convert PascalCase to kebab-case: IfxButton -> ifx-button\n\treturn input\n\t\t.replace(/([A-Z])/g, \"-$1\")\n\t\t.toLowerCase()\n\t\t.replace(/^-/, \"\"); // Remove leading hyphen\n}\n", "import {\n\tAngularCodeFormatter,\n\ttype ComponentInfo,\n\ttype FormatOptions,\n\tHTMLCodeFormatter,\n\tReactCodeFormatter,\n\tVueCodeFormatter,\n} from \"@infineon/dds-tooling\";\nimport type {\n\tComponentDocRequest,\n\tComponentIndexRequest,\n\tDdsDataSource,\n\tIncludeKey,\n\tStencilDocsComponent,\n} from \"../runtime/types.js\";\nimport { getFrameworkNotes } from \"./frameworkNotes.js\";\n\nexport function renderComponentIndexMarkdown(\n\treq: ComponentIndexRequest,\n\tsource: DdsDataSource,\n): string {\n\tconst tags = listAllTags(source);\n\n\tconst lines: string[] = [];\n\tlines.push(\"# DDS Components\");\n\tlines.push(\"\");\n\tlines.push(`- Version: ${req.version}`);\n\tlines.push(`- Framework: ${req.framework}`);\n\tlines.push(\"\");\n\n\tlines.push(\"| Tag | Notes |\");\n\tlines.push(\"|-----|-------|\");\n\tfor (const tag of tags) {\n\t\tlines.push(`| \\`${tag}\\` | |`);\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\nexport function renderComponentDocMarkdown(\n\treq: ComponentDocRequest,\n\tsource: DdsDataSource,\n): string {\n\tconst include = new Set<IncludeKey>(req.include);\n\tconst tag = req.component;\n\n\tconst doc = findComponent(source, tag);\n\tif (!doc) {\n\t\treturn [\n\t\t\t`# ${tag}`,\n\t\t\t\"\",\n\t\t\t`- Version: ${req.version}`,\n\t\t\t`- Framework: ${req.framework}`,\n\t\t\t\"\",\n\t\t\t`Component not found: \\`${tag}\\`.`,\n\t\t].join(\"\\n\");\n\t}\n\n\tconst lines: string[] = [];\n\tlines.push(`# ${tag}`);\n\tlines.push(\"\");\n\tlines.push(`- Version: ${req.version}`);\n\tlines.push(`- Framework: ${req.framework}`);\n\tlines.push(\"\");\n\n\tif (doc.description) {\n\t\tlines.push(doc.description);\n\t\tlines.push(\"\");\n\t}\n\n\tif (include.has(\"properties\") && doc.props.length) {\n\t\tlines.push(\"## Properties\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"| Property | Attribute | Type | Default | Description |\");\n\t\tlines.push(\"|----------|-----------|------|---------|-------------|\");\n\t\tfor (const p of doc.props) {\n\t\t\tlines.push(\n\t\t\t\t`| \\`${p.name}\\` | ${p.attr ? `\\`${p.attr}\\`` : \"\u2014\"} | ${p.type ? `\\`${p.type}\\`` : \"\u2014\"} | ${p.default ? `\\`${p.default}\\`` : \"\u2014\"} | ${escapePipes(p.docs ?? \"\")} |`,\n\t\t\t);\n\t\t}\n\t\tlines.push(\"\");\n\t}\n\n\tif (include.has(\"events\") && doc.events.length) {\n\t\tlines.push(\"## Events\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"| Event | Type | Description |\");\n\t\tlines.push(\"|-------|------|-------------|\");\n\t\tfor (const e of doc.events) {\n\t\t\tlines.push(\n\t\t\t\t`| \\`${e.name}\\` | ${e.type ? `\\`${e.type}\\`` : \"\u2014\"} | ${escapePipes(e.docs ?? \"\")} |`,\n\t\t\t);\n\t\t}\n\t\tlines.push(\"\");\n\t}\n\n\tif (include.has(\"slots\") && doc.slots.length) {\n\t\tlines.push(\"## Slots\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"| Name | Description |\");\n\t\tlines.push(\"|------|-------------|\");\n\t\tfor (const s of doc.slots) {\n\t\t\tlines.push(\n\t\t\t\t`| ${s.name ? `\\`${s.name}\\`` : \"\u2014\"} | ${escapePipes(s.docs ?? \"\")} |`,\n\t\t\t);\n\t\t}\n\t\tlines.push(\"\");\n\t}\n\n\tif (include.has(\"css\") && (doc.cssProps.length || doc.cssParts.length)) {\n\t\tif (doc.cssProps.length) {\n\t\t\tlines.push(\"## CSS Properties\");\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"| Name | Description |\");\n\t\t\tlines.push(\"|------|-------------|\");\n\t\t\tfor (const c of doc.cssProps) {\n\t\t\t\tlines.push(`| \\`${c.name}\\` | ${escapePipes(c.docs ?? \"\")} |`);\n\t\t\t}\n\t\t\tlines.push(\"\");\n\t\t}\n\n\t\tif (doc.cssParts.length) {\n\t\t\tlines.push(\"## CSS Parts\");\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"| Name | Description |\");\n\t\t\tlines.push(\"|------|-------------|\");\n\t\t\tfor (const p of doc.cssParts) {\n\t\t\t\tlines.push(`| \\`${p.name}\\` | ${escapePipes(p.docs ?? \"\")} |`);\n\t\t\t}\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\n\tif (include.has(\"examples\")) {\n\t\tconst componentInfo = source.examples?.get(tag);\n\t\tif (componentInfo) {\n\t\t\tlines.push(\"## Example\");\n\t\t\tlines.push(\"\");\n\n\t\t\t// Generate framework-specific code using dds-tooling formatters\n\t\t\tconst code = generateFrameworkCode(componentInfo, req.framework);\n\t\t\tconst language = getLanguageForFramework(req.framework);\n\n\t\t\tlines.push(`\\`\\`\\`${language}`);\n\t\t\tlines.push(code.trim());\n\t\t\tlines.push(\"```\");\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\n\t// Add framework-specific usage notes\n\tconst frameworkNotes = getFrameworkNotes(req.framework, tag);\n\tif (frameworkNotes) {\n\t\tlines.push(\"## Framework-Specific Usage\");\n\t\tlines.push(\"\");\n\t\tlines.push(frameworkNotes);\n\t\tlines.push(\"\");\n\t}\n\n\treturn lines.join(\"\\n\").trimEnd();\n}\n\nfunction listAllTags(source: DdsDataSource): string[] {\n\tconst tags = new Set<string>();\n\tfor (const c of source.docs?.components ?? []) tags.add(c.tag);\n\treturn Array.from(tags).sort();\n}\n\nfunction findComponent(\n\tsource: DdsDataSource,\n\ttag: string,\n):\n\t| {\n\t\t\tdescription?: string;\n\t\t\tprops: Array<{\n\t\t\t\tname: string;\n\t\t\t\tattr?: string;\n\t\t\t\ttype?: string;\n\t\t\t\tdefault?: string;\n\t\t\t\tdocs?: string;\n\t\t\t}>;\n\t\t\tevents: Array<{ name: string; type?: string; docs?: string }>;\n\t\t\tslots: Array<{ name?: string; docs?: string }>;\n\t\t\tcssProps: Array<{ name: string; docs?: string }>;\n\t\t\tcssParts: Array<{ name: string; docs?: string }>;\n\t }\n\t| undefined {\n\tconst fromDocs = source.docs?.components?.find((c) => c.tag === tag);\n\tif (fromDocs) return normalizeFromDocs(fromDocs);\n\treturn undefined;\n}\n\nfunction normalizeFromDocs(c: StencilDocsComponent) {\n\treturn {\n\t\tdescription: c.docs,\n\t\tprops: (c.props ?? []).map((p) => ({\n\t\t\tname: p.name,\n\t\t\tattr: p.attr,\n\t\t\ttype: p.type,\n\t\t\tdefault: p.default,\n\t\t\tdocs: p.docs,\n\t\t})),\n\t\tevents: (c.events ?? []).map((e) => ({\n\t\t\tname: e.event,\n\t\t\ttype: e.detail,\n\t\t\tdocs: e.docs,\n\t\t})),\n\t\tslots: c.slots ?? [],\n\t\tcssProps: c.styles ?? [],\n\t\tcssParts: c.parts ?? [],\n\t};\n}\n\nfunction escapePipes(s: string): string {\n\treturn s.replace(/\\\\/g, \"\\\\\\\\\").replace(/\\|/g, \"\\\\|\");\n}\n\nfunction generateFrameworkCode(\n\tcomponentInfo: ComponentInfo,\n\tframework: string,\n): string {\n\tconst formatOptions: FormatOptions = {\n\t\tindent: \" \",\n\t\tbaseIndent: \"\",\n\t};\n\n\tswitch (framework) {\n\t\tcase \"react\":\n\t\t\treturn new ReactCodeFormatter().formatComponent(\n\t\t\t\tcomponentInfo,\n\t\t\t\tformatOptions,\n\t\t\t);\n\t\tcase \"vue\":\n\t\t\treturn new VueCodeFormatter().formatComponent(\n\t\t\t\tcomponentInfo,\n\t\t\t\tformatOptions,\n\t\t\t);\n\t\tcase \"angular\":\n\t\t\treturn new AngularCodeFormatter().formatComponent(\n\t\t\t\tcomponentInfo,\n\t\t\t\tformatOptions,\n\t\t\t);\n\t\tdefault:\n\t\t\treturn new HTMLCodeFormatter().formatComponent(\n\t\t\t\tcomponentInfo,\n\t\t\t\tformatOptions,\n\t\t\t);\n\t}\n}\n\nfunction getLanguageForFramework(framework: string): string {\n\tswitch (framework) {\n\t\tcase \"react\":\n\t\t\treturn \"tsx\";\n\t\tcase \"vue\":\n\t\t\treturn \"vue\";\n\t\tcase \"angular\":\n\t\t\treturn \"typescript\";\n\t\tdefault:\n\t\t\treturn \"html\";\n\t}\n}\n"],
5
- "mappings": ";;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AAErC,SAAS,SAAS;;;ACHlB,SAAS,YAAY,WAAW,cAAc,qBAAqB;AACnE,SAAS,YAAY;AACrB,SAAS,uBAAuB;AAYhC,SAAS,yBAAiC;AACzC,SAAO,KAAK,QAAQ,IAAI,GAAG,SAAS;AACrC;AAEA,SAAS,gBAAyB;AAEjC,QAAM,2BAA2B;AAAA,IAChC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,SAAO,yBAAyB;AAAA,IAAK,CAAC,WACrC,WAAW,KAAK,QAAQ,IAAI,GAAG,MAAM,CAAC;AAAA,EACvC;AACD;AAEA,eAAe,YA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BAAkB,YAAY,IAAI,MAAM,YAAY,CAAC;AAE3D,UAAI,CAAC,iBAAiB;AACrB,eAAO;AAAA,UACN,SAAS;AAAA,YACR;AAAA,cACC,MAAM;AAAA,cACN,MAAM,qBAAqB,KAAK;AAAA,YACjC;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAEA,YAAM,KAAK;AAAA,QACV,KAAK,gBAAgB,KAAK;AAAA,QAC1B;AAAA,QACA,cAAc,gBAAgB,QAAQ;AAAA,QACtC;AAAA,QACA,gBAAgB;AAAA,MACjB,EAAE,KAAK,IAAI;AAEX,aAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,GAAG,CAAC,EAAE;AAAA,IAChD;AAAA,EACD;AAEA,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAC/B;AAGA,eAAe,OAAO;AACrB,QAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,QAAM,SAAS,MAAM,UAAU,IAAI;AAEnC,MAAI,WAAW,YAAY;AAC1B,UAAM,YAAY;AAAA,EACnB;AACD;AAEA,KAAK,EAAE,MAAM,CAAC,UAAU;AACvB,UAAQ,MAAM,UAAU,KAAK;AAC7B,UAAQ,KAAK,CAAC;AACf,CAAC;",
4
+ "sourcesContent": ["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\n\nimport { z } from \"zod\";\nimport { handleCli } from \"./cli/index.js\";\nimport {\n\tbuildComponentIndex,\n\tgetComponentDoc,\n\tgetDdsVersion,\n\tgetSource,\n} from \"./runtime/dds.js\";\nimport { normalizeComponentName } from \"./views/frameworkNotes.js\";\n\nconst FrameworkSchema = z.enum([\"html\", \"react\", \"vue\", \"angular\"]);\nconst IncludeSchema = z.enum([\n\t\"properties\",\n\t\"events\",\n\t\"slots\",\n\t\"css\",\n\t\"examples\",\n]);\n\nconst ListComponentsInputSchema = z\n\t.object({\n\t\tframework: FrameworkSchema.default(\"react\").describe(\n\t\t\t\"Target framework (defaults to React if unspecified)\",\n\t\t),\n\t})\n\t.strict();\n\nconst GetComponentInputSchema = z\n\t.object({\n\t\tcomponent: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.describe(\n\t\t\t\t'Component name (e.g. \"ifx-button\", \"ifx-text-field\"). If unsure, use infineon_list_components first.',\n\t\t\t),\n\t\tframework: FrameworkSchema.default(\"react\").describe(\n\t\t\t\"Framework (defaults to React)\",\n\t\t),\n\t\tinclude: z\n\t\t\t.array(IncludeSchema)\n\t\t\t.optional()\n\t\t\t.describe(\"Optional: Limit response sections (default: all)\"),\n\t})\n\t.strict();\n\nconst GetFoundationInputSchema = z\n\t.object({\n\t\tstory: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.describe(\n\t\t\t\t'Story slug, e.g. \"foundations/color\", \"setup/gettingstarted\", or \"setup/framework-integration/react\"',\n\t\t\t),\n\t})\n\t.strict();\n\nexport async function startServer() {\n\tconst server = new McpServer({\n\t\tname: \"infineon-design-system\",\n\t\tversion: \"1.0.0\",\n\t\tdescription:\n\t\t\t\"Infineon Design System (DDS) - Official component library and design foundations. Use these tools whenever implementing UI components (buttons, forms, inputs, cards, layouts) or styling in Infineon projects. Provides React, Vue, Angular, and HTML components with design tokens, spacing, colors, and typography guidelines.\",\n\t});\n\n\tserver.registerTool(\n\t\t\"infineon_list_components\",\n\t\t{\n\t\t\tdescription:\n\t\t\t\t'List all available Infineon Design System (DDS) components for a framework. **Use this when:**\\n- User asks \"what components are available?\"\\n- Starting a new feature and need to browse options\\n- User doesn\\'t know the exact component name\\n- Need to show component catalog\\n\\nReturns: Markdown table with component names and descriptions',\n\t\t\tinputSchema: ListComponentsInputSchema,\n\t\t},\n\t\tasync ({ framework }) => {\n\t\t\tconst version = await getDdsVersion();\n\t\t\tconst md = await buildComponentIndex({\n\t\t\t\tversion,\n\t\t\t\tframework,\n\t\t\t});\n\n\t\t\treturn { content: [{ type: \"text\", text: md }] };\n\t\t},\n\t);\n\n\tserver.registerTool(\n\t\t\"infineon_get_component_docs\",\n\t\t{\n\t\t\tdescription:\n\t\t\t\t\"Get comprehensive Infineon DDS component documentation including props, events, slots, styling, and code examples. **Primary tool for component implementation.**\\n\\n**Always use when:**\\n- User wants to add ANY UI element (button, input, dropdown, card, etc.)\\n- Questions about component properties or events\\n- Need usage examples or code snippets\\n- Styling/theming questions\\n\\n**This is the DEFAULT tool for component-related questions.**\",\n\t\t\tinputSchema: GetComponentInputSchema,\n\t\t},\n\t\tasync ({ component, framework, include }) => {\n\t\t\tconst version = await getDdsVersion();\n\t\t\tconst md = await getComponentDoc({\n\t\t\t\tversion,\n\t\t\t\tcomponent: normalizeComponentName(component),\n\t\t\t\tframework,\n\t\t\t\tinclude: include ?? [\n\t\t\t\t\t\"properties\",\n\t\t\t\t\t\"events\",\n\t\t\t\t\t\"slots\",\n\t\t\t\t\t\"css\",\n\t\t\t\t\t\"examples\",\n\t\t\t\t],\n\t\t\t});\n\n\t\t\treturn { content: [{ type: \"text\", text: md }] };\n\t\t},\n\t);\n\n\tserver.registerTool(\n\t\t\"infineon_list_foundations\",\n\t\t{\n\t\t\tdescription:\n\t\t\t\t\"List Infineon Design System foundations (colors, typography, spacing, icons, etc.) and setup guides. **Use when:**\\n- User asks about design tokens, colors, spacing\\n- Questions about setup/installation\\n- Need design system guidelines\\n- Typography or theming questions\",\n\t\t\tinputSchema: z.object({}),\n\t\t},\n\t\tasync () => {\n\t\t\tconst source = await getSource();\n\t\t\tconst foundations = source.foundations || new Map();\n\n\t\t\tconst categories = new Map<string, string[]>();\n\t\t\tfor (const [slug, story] of foundations) {\n\t\t\t\tif (!categories.has(story.category)) {\n\t\t\t\t\tcategories.set(story.category, []);\n\t\t\t\t}\n\t\t\t\tconst categoryArray = categories.get(story.category);\n\t\t\t\tif (categoryArray) {\n\t\t\t\t\tcategoryArray.push(`- **${slug}**: ${story.title}`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst lines: string[] = [\"# DDS Foundation Stories & Guides\", \"\"];\n\t\t\tfor (const [category, stories] of categories) {\n\t\t\t\tlines.push(`## ${category}`, \"\", ...stories, \"\");\n\t\t\t}\n\n\t\t\treturn { content: [{ type: \"text\", text: lines.join(\"\\n\") }] };\n\t\t},\n\t);\n\n\tserver.registerTool(\n\t\t\"infineon_get_foundation_docs\",\n\t\t{\n\t\t\tdescription:\n\t\t\t\t\"Get detailed documentation for design foundations (color palettes, spacing scale, typography) or setup guides. **Use for:**\\n- Color/spacing token questions\\n- Typography scale and font usage\\n- Getting started guides\\n- Framework-specific setup guides for React, Angular, Vue, and HTML\\n- Design principles and accessibility\\n\\nInput: story slug from infineon_list_foundations (e.g. 'foundations/color' or 'setup/framework-integration/react')\",\n\t\t\tinputSchema: GetFoundationInputSchema,\n\t\t},\n\t\tasync ({ story }) => {\n\t\t\tconst source = await getSource();\n\t\t\tconst foundations = source.foundations || new Map();\n\t\t\tconst foundationStory = foundations.get(story.toLowerCase());\n\n\t\t\tif (!foundationStory) {\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\ttext: `Foundation story \"${story}\" not found. Use infineon_list_foundations to see available stories.`,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst md = [\n\t\t\t\t`# ${foundationStory.title}`,\n\t\t\t\t\"\",\n\t\t\t\t`*Category: ${foundationStory.category}*`,\n\t\t\t\t\"\",\n\t\t\t\tfoundationStory.content,\n\t\t\t].join(\"\\n\");\n\n\t\t\treturn { content: [{ type: \"text\", text: md }] };\n\t\t},\n\t);\n\n\tconst transport = new StdioServerTransport();\n\tawait server.connect(transport);\n}\n\n// Handle CLI commands or start the server\nasync function main() {\n\tconst args = process.argv.slice(2);\n\tconst result = await handleCli(args);\n\n\tif (result === \"continue\") {\n\t\tawait startServer();\n\t}\n}\n\nmain().catch((error) => {\n\tconsole.error(\"Error:\", error);\n\tprocess.exit(1);\n});\n", "import { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { createInterface } from \"node:readline\";\n\ninterface McpConfig {\n\tservers?: {\n\t\t[key: string]: {\n\t\t\tcommand: string;\n\t\t\targs?: string[];\n\t\t\tenv?: Record<string, string>;\n\t\t};\n\t};\n}\n\nfunction getWorkspaceConfigPath(): string {\n\treturn join(process.cwd(), \".vscode\");\n}\n\nfunction isInWorkspace(): boolean {\n\t// Check if we're in a directory that looks like a workspace\n\tconst possibleWorkspaceMarkers = [\n\t\t\".git\",\n\t\t\".vscode\",\n\t\t\"package.json\",\n\t\t\"pnpm-workspace.yaml\",\n\t\t\"lerna.json\",\n\t];\n\n\treturn possibleWorkspaceMarkers.some((marker) =>\n\t\texistsSync(join(process.cwd(), marker)),\n\t);\n}\n\nasync function askQuestion(question: string): Promise<string> {\n\tconst rl = createInterface({\n\t\tinput: process.stdin,\n\t\toutput: process.stdout,\n\t});\n\n\treturn new Promise((resolve) => {\n\t\trl.question(question, (answer) => {\n\t\t\trl.close();\n\t\t\tresolve(answer.trim());\n\t\t});\n\t});\n}\n\nfunction getMcpCommand() {\n\t// Use npx --no to require local installation (doesn't auto-download)\n\t// This ensures the DDS version matches the MCP version\n\treturn {\n\t\tcommand: \"npx\",\n\t\targs: [\"--no\", \"@infineon/design-system-mcp\"],\n\t};\n}\n\nexport async function runSetup(): Promise<void> {\n\tconsole.log(\"\uD83D\uDE80 DDS MCP Setup\\n\");\n\tconsole.log(\n\t\t\"This will configure the DDS MCP server in VS Code for this workspace.\\n\",\n\t);\n\n\t// Check if in a workspace\n\tif (!isInWorkspace()) {\n\t\tconsole.error(\"\u274C Error: Not in a workspace directory.\");\n\t\tconsole.error(\n\t\t\t\" Please run this command from your project root (where package.json is located).\",\n\t\t);\n\t\tprocess.exit(1);\n\t}\n\n\tconst configDir = getWorkspaceConfigPath();\n\tconst mcpConfigPath = join(configDir, \"mcp.json\");\n\n\tconsole.log(`\uD83D\uDCC2 Configuration file: ${mcpConfigPath}`);\n\n\t// Ensure the config directory exists\n\tif (!existsSync(configDir)) {\n\t\tconsole.log(`Creating directory: ${configDir}`);\n\t\tmkdirSync(configDir, { recursive: true });\n\t}\n\n\t// Read existing config or create new one\n\tlet config: McpConfig = {};\n\n\tif (existsSync(mcpConfigPath)) {\n\t\tconsole.log(`\\nReading existing configuration...`);\n\t\ttry {\n\t\t\tconst content = readFileSync(mcpConfigPath, \"utf-8\");\n\t\t\tconfig = JSON.parse(content);\n\t\t} catch {\n\t\t\tconsole.error(\n\t\t\t\t\"\u26A0\uFE0F Warning: Could not parse existing mcp.json. Creating a backup.\",\n\t\t\t);\n\t\t\tconst backupPath = `${mcpConfigPath}.backup.${Date.now()}`;\n\t\t\twriteFileSync(backupPath, readFileSync(mcpConfigPath));\n\t\t\tconsole.log(` Backup saved to: ${backupPath}`);\n\t\t}\n\t}\n\n\t// Initialize servers if it doesn't exist\n\tif (!config.servers) {\n\t\tconfig.servers = {};\n\t}\n\n\t// Check if design-system is already configured\n\tif (config.servers[\"design-system\"]) {\n\t\tconst answer = await askQuestion(\n\t\t\t\"\\n\u26A0\uFE0F DDS MCP is already configured. Do you want to overwrite it? (y/N): \",\n\t\t);\n\t\tif (answer.toLowerCase() !== \"y\") {\n\t\t\tconsole.log(\"\\n\u2705 Setup cancelled. Existing configuration preserved.\");\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Check if locally installed\n\tconst localInstalled = existsSync(\n\t\tjoin(process.cwd(), \"node_modules\", \"@infineon\", \"design-system-mcp\"),\n\t);\n\n\t// Add DDS MCP configuration\n\tconst mcpCommand = getMcpCommand();\n\tconfig.servers[\"design-system\"] = {\n\t\tcommand: mcpCommand.command,\n\t\targs: mcpCommand.args,\n\t};\n\n\t// Write the updated config\n\tconsole.log(\"\\n\uD83D\uDCDD Writing configuration...\");\n\twriteFileSync(mcpConfigPath, JSON.stringify(config, null, 2), \"utf-8\");\n\n\tconsole.log(`\u2705 Configuration saved to: ${mcpConfigPath}`);\n\tconsole.log(\"\\n\uD83D\uDCCB Configuration added:\");\n\tconsole.log(\n\t\tJSON.stringify(\n\t\t\t{ servers: { \"design-system\": config.servers[\"design-system\"] } },\n\t\t\tnull,\n\t\t\t2,\n\t\t),\n\t);\n\n\tconsole.log(\"\\n\uD83C\uDF89 Setup complete!\");\n\tconsole.log(\"\\n\uD83D\uDCD6 Next steps:\");\n\n\tif (!localInstalled) {\n\t\tconsole.log(\" \u26A0\uFE0F Local installation not detected. Install the package:\");\n\t\tconsole.log(\" pnpm add -D @infineon/design-system-mcp\");\n\t\tconsole.log(\n\t\t\t\" \uD83D\uDCA1 Tip: Install the same version as your DDS package for compatibility\",\n\t\t);\n\t\tconsole.log(\"\");\n\t}\n\n\tconsole.log(\" 1. Restart VS Code or GitHub Copilot\");\n\tconsole.log(\n\t\t\" 2. The DDS MCP server should now be available to your AI assistant\",\n\t);\n\tconsole.log(\n\t\t\"\\n\uD83D\uDCA1 Tip: Commit .vscode/mcp.json and package.json to share this setup with your team\",\n\t);\n\tconsole.log(\n\t\t\"\\n\uD83D\uDCA1 Tip: You can test the tools using @mcp in GitHub Copilot Chat\",\n\t);\n\tconsole.log(' Example: \"@mcp infineon_list_components for react\"');\n\tconsole.log(' Or just ask: \"Add an Infineon button to my form\"');\n\tconsole.log();\n}\n", "import { runSetup } from \"./setup.js\";\n\n// Injected at build time by esbuild\ndeclare const __PACKAGE_VERSION__: string;\n\nfunction showHelp(): void {\n\tconsole.log(`Infineon Design System MCP Integration\n\nUsage:\n dds-mcp Start the MCP server (stdio mode)\n dds-mcp setup Configure the MCP server in your workspace\n dds-mcp --help, -h Show this help message\n dds-mcp --version, -v Show version information\n\nCommands:\n setup Configure .vscode/mcp.json for this workspace\n (Must be run from your project root)\n\nExamples:\n # Install in your project\n pnpm add -D @infineon/design-system-mcp\n \n # Run setup wizard\n dds-mcp setup\n \n # Start the MCP server (usually called automatically by VS Code)\n dds-mcp\n`);\n}\n\nfunction showVersion(): void {\n\tconsole.log(`dds-mcp version ${__PACKAGE_VERSION__}`);\n}\n\nexport async function handleCli(args: string[]): Promise<\"exit\" | \"continue\"> {\n\tconst command = args[0];\n\n\tswitch (command) {\n\t\tcase \"setup\":\n\t\t\tawait runSetup();\n\t\t\treturn \"exit\";\n\n\t\tcase \"--help\":\n\t\tcase \"-h\":\n\t\tcase \"help\":\n\t\t\tshowHelp();\n\t\t\treturn \"exit\";\n\n\t\tcase \"--version\":\n\t\tcase \"-v\":\n\t\tcase \"version\":\n\t\t\tshowVersion();\n\t\t\treturn \"exit\";\n\n\t\tcase undefined:\n\t\t\t// No command provided, start the server\n\t\t\treturn \"continue\";\n\n\t\tdefault:\n\t\t\tconsole.error(`Unknown command: ${command}`);\n\t\t\tconsole.error('Run \"dds-mcp --help\" for usage information');\n\t\t\tprocess.exit(1);\n\t}\n}\n", "import { readFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { loadBundledExamples } from \"../sources/examples.js\";\nimport { loadFoundationStories } from \"../sources/foundations.js\";\nimport { loadStencilDocs } from \"../sources/stencilDocs.js\";\nimport {\n\trenderComponentDocMarkdown,\n\trenderComponentIndexMarkdown,\n} from \"../views/markdown.js\";\nimport type {\n\tComponentDocRequest,\n\tComponentIndexRequest,\n\tDdsDataSource,\n} from \"./types.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nlet cachedSource: Promise<DdsDataSource> | undefined;\n\nexport async function getDdsVersion(): Promise<string> {\n\t// In the bundled/installed version, the bundle is at dist/index.js\n\t// and package.json is at the package root, so we go up one level\n\tconst pkgPath = join(__dirname, \"../package.json\");\n\tconst pkgJson = JSON.parse(await readFile(pkgPath, \"utf-8\"));\n\treturn pkgJson.version;\n}\n\nexport async function buildComponentIndex(\n\treq: ComponentIndexRequest,\n): Promise<string> {\n\tconst source = await getSource();\n\treturn renderComponentIndexMarkdown(req, source);\n}\n\nexport async function getComponentDoc(\n\treq: ComponentDocRequest,\n): Promise<string> {\n\tconst source = await getSource();\n\treturn renderComponentDocMarkdown(req, source);\n}\n\nexport async function getSource(): Promise<DdsDataSource> {\n\tif (!cachedSource) {\n\t\tcachedSource = (async () => {\n\t\t\tconst docs = await loadStencilDocs();\n\t\t\tconst examples = await loadBundledExamples();\n\t\t\tconst foundations = await loadFoundationStories();\n\t\t\treturn {\n\t\t\t\tdocs,\n\t\t\t\texamples,\n\t\t\t\tfoundations,\n\t\t\t};\n\t\t})();\n\t}\n\n\treturn cachedSource;\n}\n", "import { readdir, readFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport type { ComponentInfo } from \"@infineon/dds-tooling\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport async function loadBundledExamples(): Promise<\n\tMap<string, ComponentInfo>\n> {\n\tconst examples = new Map<string, ComponentInfo>();\n\n\t// When bundled with esbuild, everything is in dist/index.js\n\t// Assets are at dist/assets/examples/\n\t// So from the bundle location, assets are at ./assets/examples\n\tconst examplesDir = join(__dirname, \"assets/examples\");\n\n\ttry {\n\t\tconst files = await readdir(examplesDir);\n\n\t\tfor (const file of files) {\n\t\t\tif (file.endsWith(\".json\")) {\n\t\t\t\tconst tag = file.replace(\".json\", \"\");\n\t\t\t\tconst filePath = join(examplesDir, file);\n\t\t\t\tconst json = await readFile(filePath, \"utf-8\");\n\t\t\t\tconst componentInfo = JSON.parse(json) as ComponentInfo;\n\t\t\t\texamples.set(tag, componentInfo);\n\t\t\t}\n\t\t}\n\t} catch (_error) {\n\t\t// Directory doesn't exist or can't be read - return empty map\n\t}\n\n\treturn examples;\n}\n", "import { readdir, readFile } from \"node:fs/promises\";\nimport { basename, dirname, join, relative } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\ninterface FoundationStory {\n\ttitle: string;\n\tcategory: string;\n\tcontent: string;\n}\n\nexport async function loadFoundationStories(): Promise<\n\tMap<string, FoundationStory>\n> {\n\tconst stories = new Map<string, FoundationStory>();\n\n\t// When bundled, stories are at dist/assets/foundations/\n\t// From the bundle location (dist/index.js), that's ./assets/foundations\n\tconst storiesBaseDir = join(__dirname, \"assets/foundations\");\n\n\ttry {\n\t\t// Load foundations\n\t\tconst foundationsDir = join(storiesBaseDir, \"foundations\");\n\t\tconst foundationFiles = await readdir(foundationsDir);\n\n\t\tfor (const file of foundationFiles) {\n\t\t\tif (file.endsWith(\".mdx\")) {\n\t\t\t\tconst slug = file.replace(\".mdx\", \"\").toLowerCase();\n\t\t\t\tconst content = await readFile(join(foundationsDir, file), \"utf-8\");\n\t\t\t\tconst title = file\n\t\t\t\t\t.replace(\".mdx\", \"\")\n\t\t\t\t\t.replace(/([A-Z])/g, \" $1\")\n\t\t\t\t\t.trim();\n\n\t\t\t\tstories.set(`foundations/${slug}`, {\n\t\t\t\t\ttitle,\n\t\t\t\t\tcategory: \"Foundations\",\n\t\t\t\t\tcontent: stripMDXImports(content),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Load setup and installation guides, including nested sections such as\n\t\t// framework-specific integration pages and FAQ entries.\n\t\tconst setupDir = join(storiesBaseDir, \"setup-and-installation\");\n\t\tawait loadNestedStories(stories, {\n\t\t\trootDir: setupDir,\n\t\t\tbaseDir: setupDir,\n\t\t\tslugPrefix: \"setup\",\n\t\t\tbaseCategory: \"Setup & Installation\",\n\t\t});\n\n\t\t// Load root-level stories\n\t\tconst rootFiles = await readdir(storiesBaseDir);\n\t\tfor (const file of rootFiles) {\n\t\t\tif (file.endsWith(\".mdx\")) {\n\t\t\t\tconst slug = file.replace(\".mdx\", \"\").toLowerCase();\n\t\t\t\tconst content = await readFile(join(storiesBaseDir, file), \"utf-8\");\n\t\t\t\tconst title = file.replace(\".mdx\", \"\");\n\n\t\t\t\tstories.set(slug, {\n\t\t\t\t\ttitle,\n\t\t\t\t\tcategory: \"General\",\n\t\t\t\t\tcontent: stripMDXImports(content),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (_error) {\n\t\t// Directory doesn't exist or can't be read - return empty map\n\t}\n\n\treturn stories;\n}\n\nasync function loadNestedStories(\n\tstories: Map<string, FoundationStory>,\n\toptions: {\n\t\trootDir: string;\n\t\tbaseDir: string;\n\t\tslugPrefix: string;\n\t\tbaseCategory: string;\n\t},\n): Promise<void> {\n\tconst entries = await readdir(options.baseDir, { withFileTypes: true });\n\n\tfor (const entry of entries) {\n\t\tconst entryPath = join(options.baseDir, entry.name);\n\n\t\tif (entry.isDirectory()) {\n\t\t\tawait loadNestedStories(stories, {\n\t\t\t\t...options,\n\t\t\t\tbaseDir: entryPath,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!entry.name.endsWith(\".mdx\")) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst relativeFromRoot = relative(options.rootDir, entryPath)\n\t\t\t.replace(/\\.mdx$/i, \"\")\n\t\t\t.replaceAll(\"\\\\\", \"/\");\n\t\tconst nestedDir = dirname(relativeFromRoot);\n\t\tconst content = await readFile(entryPath, \"utf-8\");\n\t\tconst title = formatStoryTitle(basename(entry.name, \".mdx\"));\n\n\t\tstories.set(`${options.slugPrefix}/${relativeFromRoot.toLowerCase()}`, {\n\t\t\ttitle,\n\t\t\tcategory:\n\t\t\t\tnestedDir === \".\"\n\t\t\t\t\t? options.baseCategory\n\t\t\t\t\t: `${options.baseCategory} / ${formatCategoryTitle(nestedDir)}`,\n\t\t\tcontent: stripMDXImports(content),\n\t\t});\n\t}\n}\n\nfunction formatStoryTitle(fileName: string): string {\n\treturn fileName.replace(/([A-Z])/g, \" $1\").trim();\n}\n\nfunction formatCategoryTitle(pathFragment: string): string {\n\treturn pathFragment\n\t\t.split(/[\\\\/]/)\n\t\t.map((part) =>\n\t\t\tpart\n\t\t\t\t.split(\"-\")\n\t\t\t\t.map((word) =>\n\t\t\t\t\tword ? word.charAt(0).toUpperCase() + word.slice(1) : word,\n\t\t\t\t)\n\t\t\t\t.join(\" \"),\n\t\t)\n\t\t.join(\" / \");\n}\n\nfunction stripMDXImports(content: string): string {\n\t// Remove MDX import statements and Meta tags for cleaner output\n\treturn content\n\t\t.split(\"\\n\")\n\t\t.filter((line) => !line.startsWith(\"import \"))\n\t\t.filter((line) => !line.includes(\"<Meta \"))\n\t\t.join(\"\\n\")\n\t\t.trim();\n}\n", "import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport type { StencilDocs, StencilDocsComponent } from \"../runtime/types.js\";\n\n// Raw JSON types from Stencil docs.json\ninterface RawStencilDocs {\n\tcomponents: RawStencilComponent[];\n}\n\ninterface RawStencilComponent {\n\ttag?: string;\n\tdocs?: string;\n\tprops?: RawProp[];\n\tevents?: RawEvent[];\n\tslots?: RawSlot[];\n\tstyles?: RawStyle[];\n\tparts?: RawPart[];\n}\n\ninterface RawProp {\n\tname?: string;\n\tattr?: string;\n\ttype?: string;\n\tdefault?: string | number | boolean;\n\tdocs?: string;\n}\n\ninterface RawEvent {\n\tevent?: string;\n\tdetail?: string;\n\tdocs?: string;\n}\n\ninterface RawSlot {\n\tname?: string;\n\tdocs?: string;\n}\n\ninterface RawStyle {\n\tname?: string;\n\tdocs?: string;\n}\n\ninterface RawPart {\n\tname?: string;\n\tdocs?: string;\n}\n\nexport async function loadStencilDocs(): Promise<StencilDocs | undefined> {\n\tconst docsJsonPath = await resolveDocsJsonPath();\n\tif (!docsJsonPath) return undefined;\n\n\tconst raw = await fs.readFile(docsJsonPath, \"utf8\");\n\tconst parsed = JSON.parse(raw) as unknown;\n\n\t// Stencil docs.json typically looks like { components: [...] }\n\tif (!parsed || typeof parsed !== \"object\") return undefined;\n\n\tconst docs = parsed as RawStencilDocs;\n\tif (!Array.isArray(docs.components)) return undefined;\n\n\tconst normalized: StencilDocsComponent[] = docs.components\n\t\t.map((c) => normalizeComponent(c))\n\t\t.filter((c): c is StencilDocsComponent => Boolean(c));\n\n\treturn { components: normalized };\n}\n\nasync function resolveDocsJsonPath(): Promise<string | undefined> {\n\t// Stencil outputs docs.json directly to packages/mcp/assets/docs.json\n\t// Then build copies it to dist/assets/docs.json\n\tconst bundledPath = resolveBundledDocsJsonPath();\n\ttry {\n\t\tawait fs.access(bundledPath);\n\t\treturn bundledPath;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nfunction resolveBundledDocsJsonPath(): string {\n\t// When bundled with esbuild, everything is in dist/index.js\n\t// and assets are in dist/assets/docs.json\n\t// So from the bundle location, assets are at ./assets/docs.json\n\tconst here = path.dirname(fileURLToPath(import.meta.url));\n\treturn path.resolve(here, \"assets\", \"docs.json\");\n}\n\nfunction normalizeComponent(\n\tc: RawStencilComponent,\n): StencilDocsComponent | undefined {\n\tconst tag = c?.tag;\n\tif (typeof tag !== \"string\" || !tag) return undefined;\n\n\treturn {\n\t\ttag,\n\t\tdocs: typeof c.docs === \"string\" ? c.docs.trim() : undefined,\n\t\tprops: Array.isArray(c.props)\n\t\t\t? c.props\n\t\t\t\t\t.map((p) => ({\n\t\t\t\t\t\tname: String(p.name ?? \"\"),\n\t\t\t\t\t\tattr: typeof p.attr === \"string\" && p.attr ? p.attr : undefined,\n\t\t\t\t\t\ttype: typeof p.type === \"string\" ? p.type : undefined,\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\ttypeof p.default === \"string\"\n\t\t\t\t\t\t\t\t? p.default\n\t\t\t\t\t\t\t\t: p.default != null\n\t\t\t\t\t\t\t\t\t? String(p.default)\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tdocs: typeof p.docs === \"string\" ? p.docs.trim() : undefined,\n\t\t\t\t\t}))\n\t\t\t\t\t.filter((p) => p.name)\n\t\t\t: undefined,\n\t\tevents: Array.isArray(c.events)\n\t\t\t? c.events\n\t\t\t\t\t.map((e) => ({\n\t\t\t\t\t\tevent: String(e.event ?? \"\"),\n\t\t\t\t\t\tdetail: typeof e.detail === \"string\" ? e.detail : undefined,\n\t\t\t\t\t\tdocs: typeof e.docs === \"string\" ? e.docs.trim() : undefined,\n\t\t\t\t\t}))\n\t\t\t\t\t.filter((e) => e.event)\n\t\t\t: undefined,\n\t\tslots: Array.isArray(c.slots)\n\t\t\t? c.slots.map((s) => ({\n\t\t\t\t\tname: typeof s.name === \"string\" ? s.name : undefined,\n\t\t\t\t\tdocs: typeof s.docs === \"string\" ? s.docs.trim() : undefined,\n\t\t\t\t}))\n\t\t\t: undefined,\n\t\tstyles: Array.isArray(c.styles)\n\t\t\t? c.styles\n\t\t\t\t\t.map((s) => ({\n\t\t\t\t\t\tname: String(s.name ?? \"\"),\n\t\t\t\t\t\tdocs: typeof s.docs === \"string\" ? s.docs.trim() : undefined,\n\t\t\t\t\t}))\n\t\t\t\t\t.filter((s) => s.name)\n\t\t\t: undefined,\n\t\tparts: Array.isArray(c.parts)\n\t\t\t? c.parts\n\t\t\t\t\t.map((p) => ({\n\t\t\t\t\t\tname: String(p.name ?? \"\"),\n\t\t\t\t\t\tdocs: typeof p.docs === \"string\" ? p.docs.trim() : undefined,\n\t\t\t\t\t}))\n\t\t\t\t\t.filter((p) => p.name)\n\t\t\t: undefined,\n\t};\n}\n", "/**\n * String utility functions for code generation\n */\n/**\n * Convert kebab-case to PascalCase\n * Example: ifx-switch -> IfxSwitch\n */\nexport function toPascalCase(str) {\n return str\n .split(\"-\")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\"\");\n}\n/**\n * Convert kebab-case to camelCase\n * Example: aria-level -> ariaLevel\n */\nexport function toCamelCase(str) {\n return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());\n}\n/**\n * Convert event name to React handler name\n * Example: ifxChange -> onIfxChange\n */\nexport function toReactEventName(eventName) {\n return `on${eventName.charAt(0).toUpperCase()}${eventName.slice(1)}`;\n}\n/**\n * Convert event name to handler function name\n * Example: ifxChange -> handleChange\n */\nexport function toHandlerFunctionName(eventName) {\n const withoutPrefix = eventName.replace(/^ifx/, \"\");\n return `handle${withoutPrefix.charAt(0).toUpperCase()}${withoutPrefix.slice(1)}`;\n}\n/**\n * Convert event name to Angular event name\n * Example: ifxChange -> ifxChange (Angular uses kebab-case in template)\n */\nexport function toAngularEventName(eventName) {\n // Angular event binding uses the event name as-is in camelCase\n return eventName;\n}\n/**\n * Escape HTML for display in code blocks\n */\nexport function escapeHTML(html) {\n return html\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#39;\");\n}\n/**\n * Add indentation to each line of text\n */\nexport function indent(text, indentStr, skipFirstLine = false) {\n const lines = text.split(\"\\n\");\n return lines\n .map((line, index) => {\n if (index === 0 && skipFirstLine)\n return line;\n if (line.trim() === \"\")\n return \"\";\n return indentStr + line;\n })\n .join(\"\\n\");\n}\n/**\n * Escape regex special characters\n */\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n/**\n * Format component title with story name if not default\n * Example: (\"Button\", \"Primary\") -> \"Button - Primary\"\n * Example: (\"Button\", \"Default\") -> \"Button\"\n */\nexport function formatTitle(title, component, storyName) {\n const baseTitle = title || component;\n // Don't add story name if it's \"Default\" or undefined\n if (!storyName || storyName === \"Default\") {\n return baseTitle;\n }\n return `${baseTitle} - ${storyName}`;\n}\n/**\n * Escape a string for safe embedding inside a JS template literal (backtick-delimited).\n * Escapes backslashes first, then backticks and dollar signs.\n */\nexport function escapeForTemplateLiteral(str) {\n return str.replace(/\\\\/g, \"\\\\\\\\\").replace(/`/g, \"\\\\`\").replace(/\\$/g, \"\\\\$\");\n}\n/**\n * Escape a string for safe embedding inside a single-quoted attribute/value.\n * Escapes backslashes first, then single quotes.\n */\nexport function escapeForSingleQuotedAttr(str) {\n return str.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\");\n}\n", "import { escapeForSingleQuotedAttr, escapeForTemplateLiteral, toAngularEventName, toCamelCase, toHandlerFunctionName, toPascalCase, } from \"../utils/string-utils.js\";\n/**\n * Formats components into Angular standalone component code\n */\nexport class AngularCodeFormatter {\n /**\n * Format component structure to Angular template HTML\n */\n formatComponent(component, options) {\n const { indent = \" \" } = options;\n const isFirstOfType = new Map();\n return this.structureToHTML(component.structure, component, indent, isFirstOfType);\n }\n /**\n * Format event handlers for Angular\n */\n formatEventHandlers(component, _options) {\n if (component.events.length === 0)\n return \"\";\n return component.events\n .map((event) => {\n const handlerName = toHandlerFunctionName(event.name);\n return ` protected ${handlerName}(event: CustomEvent) {\n console.log('${event.name}:', event);\n // Add your handler logic here\n }`;\n })\n .join(\"\\n\\n\");\n }\n /**\n * Format imports for Angular\n */\n formatImports(component) {\n const componentTags = this.collectComponentTags(component.structure);\n // Only import Infineon components (starting with ifx-), not native HTML elements\n const imports = Array.from(componentTags)\n .filter((tag) => tag.startsWith(\"ifx-\"))\n .map((tag) => toPascalCase(tag))\n .sort()\n .join(\", \");\n return `import { ${imports} } from '@infineon/infineon-design-system-angular/standalone';`;\n }\n /**\n * Generate complete Angular component TypeScript file content\n */\n formatComponentTypeScript(component) {\n const componentName = toPascalCase(component.component);\n const storyNameSuffix = component.storyName && component.storyName !== \"Default\"\n ? component.storyName.replace(/\\s+/g, \"\")\n : \"\";\n const componentClassName = `${componentName}${storyNameSuffix}Example`;\n const selectorSuffix = component.storyName && component.storyName !== \"Default\"\n ? `-${component.storyName.toLowerCase().replace(/\\s+/g, \"-\")}`\n : \"\";\n const componentSelector = `${component.component}-example${selectorSuffix}`;\n const imports = this.formatImports(component);\n const eventHandlers = this.formatEventHandlers(component, { indent: \" \" });\n const componentTags = this.collectComponentTags(component.structure);\n // Only import Infineon components (starting with ifx-), not native HTML elements\n const componentImports = Array.from(componentTags)\n .filter((tag) => tag.startsWith(\"ifx-\"))\n .map((tag) => toPascalCase(tag))\n .sort()\n .join(\", \");\n // Generate the code strings for display\n const html = this.structureToHTML(component.structure, component, \" \", new Map());\n const tsCode = this.generateTypeScriptCode(component, componentImports, eventHandlers);\n const htmlCode = this.escapeHtml(html);\n return `${imports}\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'app-${componentSelector}',\n imports: [ ${componentImports} ],\n templateUrl: './${componentSelector}.html',\n\tstyleUrl: './${componentSelector}.scss'\n})\nexport class ${componentClassName} {\n protected readonly tsCode = \\`${this.escapeBackticks(tsCode)}\\`;\n protected readonly htmlCode = \\`${this.escapeBackticks(htmlCode)}\\`;\n${eventHandlers ? `\\n${eventHandlers}\\n` : \"\"}}\n`;\n }\n /**\n * Generate complete Angular component template HTML file content\n */\n formatComponentTemplate(component) {\n const html = this.formatComponent(component, { indent: \" \" });\n const selectorSuffix = component.storyName && component.storyName !== \"Default\"\n ? `-${component.storyName.toLowerCase().replace(/\\s+/g, \"-\")}`\n : \"\";\n const componentSelector = `${component.component}-example${selectorSuffix}`;\n return `${html}\n\n<details class=\"code-details\">\n <summary>View Code</summary>\n <div class=\"code-blocks\">\n <h3>${componentSelector}.ts</h3>\n <pre><code class=\"language-typescript\" [innerHTML]=\"tsCode\"></code></pre>\n \n <h3>${componentSelector}.html</h3>\n <pre><code class=\"language-markup\" [innerHTML]=\"htmlCode\"></code></pre>\n </div>\n</details>\n`;\n }\n /**\n * Generate component SCSS file content\n */\n formatComponentStyles() {\n return `// Add component-specific styles here\n`;\n }\n /**\n * Generate TypeScript code for display\n */\n generateTypeScriptCode(component, componentImports, eventHandlers) {\n const imports = this.formatImports(component);\n const componentName = toPascalCase(component.component);\n const storyNameSuffix = component.storyName && component.storyName !== \"Default\"\n ? component.storyName.replace(/\\s+/g, \"\")\n : \"\";\n const componentClassName = `${componentName}${storyNameSuffix}Example`;\n const selectorSuffix = component.storyName && component.storyName !== \"Default\"\n ? `-${component.storyName.toLowerCase().replace(/\\s+/g, \"-\")}`\n : \"\";\n const componentSelector = `${component.component}-example${selectorSuffix}`;\n let tsCode = `${imports}\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'app-${componentSelector}',\n imports: [ ${componentImports} ],\n templateUrl: './${componentSelector}.html',\n\tstyleUrl: './${componentSelector}.scss'\n})\nexport class ${componentClassName} {`;\n if (eventHandlers) {\n tsCode += `\\n${eventHandlers}\\n`;\n }\n tsCode += `}`;\n return this.escapeHtml(tsCode);\n }\n /**\n * Escape backticks for template literal\n */\n escapeBackticks(str) {\n // First escape backslashes, then backticks and dollar signs.\n // This avoids introducing escape sequences that could break the surrounding\n // template literal when the input already contains backslashes.\n return escapeForTemplateLiteral(str);\n }\n /**\n * Escape HTML for display in code block\n */\n escapeHtml(html) {\n return html\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#039;\");\n }\n /**\n * Convert component structure to Angular template HTML\n */\n structureToHTML(struct, componentInfo, indent, isFirstOfType) {\n const tag = struct.tag;\n // Track if this is the first occurrence of this tag type (for events)\n const isFirst = !isFirstOfType.has(tag);\n if (isFirst) {\n isFirstOfType.set(tag, true);\n }\n // Convert attributes from the actual story DOM only\n const attrs = Object.entries(struct.attributes)\n .map(([key, value]) => this.toAngularAttribute(key, value, componentInfo, tag))\n .filter((attr) => attr !== null);\n if (isFirst && componentInfo.events.length > 0) {\n const relevantEvents = componentInfo.events.filter((event) => event.sourceComponent\n ? event.sourceComponent === tag\n : tag === componentInfo.component);\n relevantEvents.forEach((event) => {\n const angularEventName = toAngularEventName(event.name);\n const handlerName = toHandlerFunctionName(event.name);\n attrs.push(`(${angularEventName})=\"${handlerName}($any($event))\"`);\n });\n }\n // Format opening tag with attributes\n const openTag = this.formatOpeningTag(tag, attrs, indent);\n // Handle children\n if (struct.children && struct.children.length > 0) {\n const childrenHTML = struct.children\n .map((child) => this.structureToHTML(child, componentInfo, `${indent} `, isFirstOfType))\n .join(\"\\n\");\n return `${openTag}>\\n${childrenHTML}\\n${indent}</${tag}>`;\n }\n // Handle text content\n if (struct.textContent) {\n // Don't add extra whitespace - Angular hydration is sensitive to exact text nodes\n // Normalize all whitespace to single spaces\n const trimmedText = struct.textContent.trim().replace(/\\s+/g, \" \");\n return `${openTag}>${trimmedText}</${tag}>`;\n }\n // Self-closing tag\n return `${openTag}></${tag}>`;\n }\n /**\n * Format opening tag with attributes\n */\n formatOpeningTag(tag, attrs, indent) {\n if (attrs.length === 0) {\n return `${indent}<${tag}`;\n }\n else if (attrs.length === 1) {\n return `${indent}<${tag} ${attrs[0]}`;\n }\n else {\n const attrsString = attrs.map((attr) => `${indent} ${attr}`).join(\"\\n\");\n return `${indent}<${tag}\\n${attrsString}`;\n }\n }\n /**\n * Convert attribute to Angular template syntax\n */\n toAngularAttribute(name, value, componentInfo, tag) {\n // Skip undefined values\n if (value === \"undefined\")\n return null;\n // Normalize Angular-style property binding syntax on custom elements: [prop]=\"...\"\n // We convert these into plain attributes so the web component receives string values reliably.\n let attrName = name;\n let attrValue = value;\n const isBracketBinding = attrName.startsWith(\"[\") && attrName.endsWith(\"]\");\n if (isBracketBinding) {\n attrName = attrName.slice(1, -1); // strip brackets\n // If value is quoted Angular expression like `'text'`, strip quotes\n const m = attrValue.match(/^['\"]([\\s\\S]*)['\"]$/);\n if (m)\n attrValue = m[1];\n }\n if (attrValue.startsWith(\"__JSON__\")) {\n attrValue = attrValue.replace(/^__JSON__/, \"\");\n }\n const isBooleanProp = this.isBooleanProp(attrName, tag, componentInfo);\n const bindingName = toCamelCase(attrName);\n // Boolean values\n if (attrValue === \"true\") {\n return isBooleanProp ? `[${bindingName}]=\"true\"` : `${attrName}=\"true\"`;\n }\n if (attrValue === \"false\") {\n return isBooleanProp ? `[${bindingName}]=\"false\"` : `${attrName}=\"false\"`;\n }\n if (attrValue === \"\") {\n return isBooleanProp ? `[${bindingName}]=\"true\"` : `${attrName}=\"\"`;\n }\n // Numeric values\n if (!Number.isNaN(Number(attrValue)) &&\n attrValue !== \"\" &&\n attrValue !== \"null\") {\n return `${attrName}=\"${attrValue}\"`;\n }\n // Null\n if (attrValue === \"null\")\n return null;\n // JSON arrays or objects (contain { or [ at start) - use property binding\n // Some DOM attributes coerce arrays/objects to \"[object Object]\"; prefer defaultArgs when available\n if (attrValue.startsWith(\"[\") ||\n attrValue.startsWith(\"{\") ||\n attrValue.includes(\"[object Object\")) {\n const camelName = toCamelCase(attrName);\n const original = componentInfo?.defaultArgs?.[camelName];\n let jsonString = attrValue;\n if (original !== undefined && typeof original === \"object\") {\n try {\n jsonString = JSON.stringify(original);\n }\n catch {\n // keep existing value if stringify fails\n }\n }\n const escapedValue = escapeForSingleQuotedAttr(jsonString);\n // Bind as string attribute (web components commonly parse JSON from attribute string)\n return `${attrName}='${escapedValue}'`;\n }\n // String values\n return `${attrName}=\"${attrValue}\"`;\n }\n isBooleanProp(name, tag, componentInfo) {\n const typeText = componentInfo.propTypes[tag]?.[name];\n return typeText === \"boolean\";\n }\n /**\n * Collect all unique component tags from structure (for imports)\n */\n collectComponentTags(struct, tags = new Set()) {\n tags.add(struct.tag);\n if (struct.children && struct.children.length > 0) {\n struct.children.forEach((child) => {\n this.collectComponentTags(child, tags);\n });\n }\n return tags;\n }\n}\n", "import { escapeHTML, formatTitle } from \"../utils/string-utils.js\";\n/**\n * Formats components into HTML/Web Component code\n */\nexport class HTMLCodeFormatter {\n /**\n * Format component structure to HTML (component only, no wrapping)\n */\n formatComponent(component, options) {\n const { indent = \"\" } = options;\n return this.structureToHTML(component.structure, indent);\n }\n /**\n * Format complete example section with component, title, and code preview\n * Used by example generators to create full example pages\n */\n formatFullExample(component, options) {\n const { indent = \" \" } = options;\n return `\n <!-- ${component.component.toUpperCase()} Example -->\n <section id=\"${component.component}-example\" class=\"component-example\">\n <h2>${formatTitle(component.title, component.component, component.storyName)}</h2>\n <div class=\"demo\">\n${this.structureToHTML(component.structure, indent)}\n </div>\n <details class=\"code-details\">\n <summary>View Code</summary>\n <pre><code class=\"language-markup\">${escapeHTML(this.structureToHTML(component.structure, \"\"))}</code></pre>\n </details>\n </section>\n`;\n }\n /**\n * Format event handlers for HTML\n */\n formatEventHandlers(component, _options) {\n if (component.events.length === 0)\n return \"\";\n const handlers = component.events\n .map((event) => {\n const elementSelector = `document.querySelector('#${component.component}-example ${component.component}')`;\n // Handle multi-line descriptions by prefixing each line with //\n const commentLines = event.description\n .split(\"\\n\")\n .map((line) => ` // ${line.trim()}`)\n .join(\"\\n\");\n return `${commentLines}\n ${elementSelector}?.addEventListener('${event.name}', (event) => {\n console.log('${event.name}:', event);\n // Add your custom handler logic here\n });`;\n })\n .join(\"\\n\\n\");\n return handlers;\n }\n /**\n * Format imports (not used for HTML/vanilla)\n */\n formatImports(_component) {\n return \"\";\n }\n /**\n * Convert component structure to HTML string\n */\n structureToHTML(struct, indent) {\n const attrs = this.attributesToString(struct.attributes);\n const openTag = `${indent}<${struct.tag}${attrs ? ` ${attrs}` : \"\"}>`;\n let content = \"\";\n if (struct.textContent) {\n content = struct.textContent;\n }\n if (struct.children && struct.children.length > 0) {\n const childHTML = struct.children\n .map((child) => this.structureToHTML(child, `${indent} `))\n .join(\"\\n\");\n content = `\\n${childHTML}\\n${indent}`;\n }\n const closeTag = `</${struct.tag}>`;\n return `${openTag}${content}${closeTag}`;\n }\n /**\n * Convert attributes object to HTML string\n */\n attributesToString(attrs) {\n return Object.entries(attrs)\n .filter(([_, value]) => value !== \"undefined\" && value !== \"null\") // Skip undefined/null values\n .map(([key, value]) => {\n if (value.startsWith(\"__JSON__\")) {\n const jsonValue = value.replace(/^__JSON__/, \"\");\n return `${key}='${jsonValue}'`;\n }\n // For JSON arrays/objects, use single quotes to wrap the attribute value\n if (value.startsWith(\"[\") || value.startsWith(\"{\")) {\n return `${key}='${value}'`;\n }\n // For regular strings, use double quotes\n return `${key}=\"${value}\"`;\n })\n .join(\" \");\n }\n}\n", "import { escapeForTemplateLiteral, toCamelCase, toHandlerFunctionName, toPascalCase, toReactEventName, } from \"../utils/string-utils.js\";\n/**\n * Formats components into React/JSX code\n */\nexport class ReactCodeFormatter {\n /**\n * Format component structure to React JSX\n */\n formatComponent(component, options) {\n const { indent = \" \" } = options;\n const isFirstOfType = new Map();\n return this.structureToJSX(component.structure, component, indent, isFirstOfType);\n }\n /**\n * Format event handlers for React\n */\n formatEventHandlers(component, _options) {\n if (component.events.length === 0)\n return \"\";\n return component.events\n .map((event) => {\n const handlerName = toHandlerFunctionName(event.name);\n return ` const ${handlerName} = (event: CustomEvent) => {\n console.log('${event.name}:', event);\n // Add your handler logic here\n };`;\n })\n .join(\"\\n\\n\");\n }\n /**\n * Format imports for React\n */\n formatImports(component) {\n const componentTags = this.collectComponentTags(component.structure);\n // Only import Infineon components (starting with ifx-), not native HTML elements\n const imports = Array.from(componentTags)\n .filter((tag) => tag.startsWith(\"ifx-\"))\n .map((tag) => toPascalCase(tag))\n .sort()\n .join(\", \");\n return `import { ${imports} } from '@infineon/infineon-design-system-react';`;\n }\n /**\n * Generate complete React component file content\n */\n formatComponentFile(component) {\n const componentName = toPascalCase(component.component);\n const storyNameSuffix = component.storyName && component.storyName !== \"Default\"\n ? component.storyName.replace(/\\s+/g, \"\")\n : \"\";\n const componentClassName = `${componentName}${storyNameSuffix}Example`;\n const imports = this.formatImports(component);\n const eventHandlers = this.formatEventHandlers(component, { indent: \" \" });\n const jsx = this.formatComponent(component, { indent: \" \" });\n // Generate the code string for display\n const codeForDisplay = this.generateCodeForDisplay(component, eventHandlers, jsx);\n // Escape for safe embedding in a template literal\n const escapedCodeForDisplay = escapeForTemplateLiteral(codeForDisplay);\n return `${imports}\n\nexport function ${componentClassName}() {\n${eventHandlers ? `${eventHandlers}\\n\\n` : \"\"} return (\n <>\n${jsx}\n <details className=\"code-details\">\n <summary>View Code</summary>\n <pre><code className=\"language-tsx\">{codeString}</code></pre>\n </details>\n </>\n );\n}\n\nconst codeString = \\`${escapedCodeForDisplay}\\`;\n`;\n }\n /**\n * Generate code string for display in the details section\n */\n generateCodeForDisplay(component, eventHandlers, jsx) {\n const componentName = toPascalCase(component.component);\n const imports = this.formatImports(component);\n // Build the display code without the details section\n let displayCode = `${imports}\n\nexport function ${componentName}Example() {`;\n if (eventHandlers) {\n displayCode += `\\n${eventHandlers}\\n`;\n }\n displayCode += `\\n return (\\n${jsx}\\n );\\n}`;\n return displayCode;\n }\n /**\n * Convert component structure to React JSX\n */\n structureToJSX(struct, componentInfo, indent, isFirstOfType) {\n // Use PascalCase for Infineon components (ifx-*), lowercase for native HTML\n const componentName = struct.tag.startsWith(\"ifx-\")\n ? toPascalCase(struct.tag)\n : struct.tag;\n // Track if this is the first occurrence of this tag type (for events)\n const isFirst = !isFirstOfType.has(struct.tag);\n if (isFirst) {\n isFirstOfType.set(struct.tag, true);\n }\n // Convert attributes to React props\n const propEntries = Object.entries(struct.attributes)\n .map(([key, value]) => {\n const propName = toCamelCase(key);\n const propValue = this.toReactPropValue(value, key);\n return propValue ? [propName, propValue] : null;\n })\n .filter(Boolean);\n // Add event handlers only to components that emit them (on first occurrence)\n const eventProps = [];\n if (isFirst && componentInfo.events.length > 0) {\n // Filter events to only those that belong to this specific component\n const relevantEvents = componentInfo.events.filter((event) => {\n // If sourceComponent is explicitly set, only attach to that component\n if (event.sourceComponent) {\n return event.sourceComponent === struct.tag;\n }\n // If no sourceComponent is set, attach to the main component\n return struct.tag === componentInfo.component;\n });\n relevantEvents.forEach((event) => {\n const reactEventName = toReactEventName(event.name);\n const handlerName = toHandlerFunctionName(event.name);\n eventProps.push([reactEventName, `{${handlerName}}`]);\n });\n }\n const allProps = [...propEntries, ...eventProps];\n // Format opening tag with props\n const openTag = this.formatOpeningTag(componentName, allProps, indent);\n // Handle children\n if (struct.children && struct.children.length > 0) {\n const childrenJSX = struct.children\n .map((child) => this.structureToJSX(child, componentInfo, `${indent} `, isFirstOfType))\n .join(\"\\n\");\n return `${openTag}>\\n${childrenJSX}\\n${indent}</${componentName}>`;\n }\n // Handle text content\n if (struct.textContent) {\n const trimmedText = struct.textContent.trim();\n return `${openTag}>\\n${indent} ${trimmedText}\\n${indent}</${componentName}>`;\n }\n // Self-closing tag\n return `${openTag} />`;\n }\n /**\n * Format opening tag with props\n */\n formatOpeningTag(componentName, props, indent) {\n if (props.length === 0) {\n return `${indent}<${componentName}`;\n }\n else if (props.length === 1) {\n const [name, value] = props[0];\n return `${indent}<${componentName} ${name}=${value}`;\n }\n else {\n const propsString = props\n .map(([name, value]) => `${indent} ${name}=${value}`)\n .join(\"\\n\");\n return `${indent}<${componentName}\\n${propsString}`;\n }\n }\n /**\n * Convert attribute value to React prop value\n */\n toReactPropValue(value, _attrName) {\n // Skip undefined values\n if (value === \"undefined\")\n return null;\n // Boolean values\n if (value === \"true\")\n return \"{true}\";\n if (value === \"false\")\n return \"{false}\";\n // Numeric values\n if (!Number.isNaN(Number(value)) && value !== \"\" && value !== \"null\") {\n return `{${value}}`;\n }\n // Null\n if (value === \"null\")\n return null;\n if (value.startsWith(\"__JSON__\")) {\n const jsonValue = value.replace(/^__JSON__/, \"\");\n return `{${jsonValue}}`;\n }\n // Try to detect if this is a JSON array or object string\n // These should be passed as JavaScript objects in React, not strings\n const trimmedValue = value.trim();\n if ((trimmedValue.startsWith(\"[\") && trimmedValue.endsWith(\"]\")) ||\n (trimmedValue.startsWith(\"{\") && trimmedValue.endsWith(\"}\"))) {\n try {\n // Validate it's proper JSON\n JSON.parse(value);\n // Return as a JavaScript expression literal (no JSON.parse)\n return `{${value}}`;\n }\n catch {\n // If not valid JSON, treat as string\n }\n }\n // String values - if contains quotes, use JSX expression with template literal\n if (value.includes('\"') || value.includes(\"'\")) {\n // Escape backslashes, backticks and dollar signs for template literals\n const escapedValue = escapeForTemplateLiteral(value);\n return `{\\`${escapedValue}\\`}`;\n }\n return `\"${value}\"`;\n }\n /**\n * Collect all unique component tags from structure (for imports)\n */\n collectComponentTags(struct, tags = new Set()) {\n tags.add(struct.tag);\n if (struct.children && struct.children.length > 0) {\n struct.children.forEach((child) => {\n this.collectComponentTags(child, tags);\n });\n }\n return tags;\n }\n}\n", "import { escapeForSingleQuotedAttr, escapeForTemplateLiteral, toHandlerFunctionName, } from \"../utils/string-utils.js\";\n/**\n * Formats components into Vue/SFC code\n */\nexport class VueCodeFormatter {\n /**\n * Format component structure to Vue template\n */\n formatComponent(component, options) {\n const { indent = \" \" } = options;\n const isFirstOfType = new Map();\n return this.structureToTemplate(component.structure, component, indent, isFirstOfType);\n }\n /**\n * Format event handlers for Vue\n */\n formatEventHandlers(component, _options) {\n if (component.events.length === 0)\n return \"\";\n return component.events\n .map((event) => {\n const handlerName = toHandlerFunctionName(event.name);\n return `const ${handlerName} = (event: CustomEvent) => {\n console.log('${event.name}:', event);\n // Add your handler logic here\n};`;\n })\n .join(\"\\n\\n\");\n }\n /**\n * Format imports for Vue\n */\n formatImports(_component) {\n // Vue wrapper uses component registration, not individual imports\n return \"\";\n }\n /**\n * Extract all unique Ifx component tags from the component structure\n */\n extractIfxComponents(structure) {\n const components = new Set();\n // Check if current tag is an Ifx component\n if (structure.tag.startsWith(\"ifx-\")) {\n // Convert kebab-case to PascalCase (e.g., 'ifx-accordion' -> 'IfxAccordion')\n const pascalCase = structure.tag\n .split(\"-\")\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(\"\");\n components.add(pascalCase);\n }\n // Recursively check children\n if (structure.children) {\n for (const child of structure.children) {\n const childComponents = this.extractIfxComponents(child);\n for (const comp of childComponents) {\n components.add(comp);\n }\n }\n }\n return components;\n }\n /**\n * Generate complete Vue SFC file content\n */\n formatComponentFile(component) {\n const eventHandlers = this.formatEventHandlers(component, { indent: \" \" });\n const template = this.formatComponent(component, { indent: \" \" });\n // Extract all Ifx components used in this example\n const ifxComponents = this.extractIfxComponents(component.structure);\n const componentImports = ifxComponents.size > 0\n ? `\\nimport { ${Array.from(ifxComponents).sort().join(\", \")} } from '@infineon/infineon-design-system-vue';`\n : \"\";\n // Generate the code string for display\n const codeForDisplay = this.generateCodeForDisplay(component, eventHandlers, template);\n const escapedCodeForDisplay = escapeForTemplateLiteral(codeForDisplay);\n const brokenScriptClosingTag = `\\${'</'}script>`;\n const brokenTemplateClosingTag = `\\${'</'}template>`;\n // Break up closing tags using template expressions to prevent Vue SFC parser issues\n // Replace </script> with ${'</'}script> and </template> with ${'</'}template>\n const codeWithBrokenTags = escapedCodeForDisplay\n .replace(/<\\/script>/g, brokenScriptClosingTag)\n .replace(/<\\/template>/g, brokenTemplateClosingTag);\n return `<script setup lang=\"ts\">\n${componentImports}\n\n${eventHandlers ? `${eventHandlers}\\n\\n` : \"\"}const codeString = \\`${codeWithBrokenTags}\\`;\n\n</script>\n\n<template>\n <div>\n${template}\n <details class=\"code-details\">\n <summary>View Code</summary>\n <pre><code class=\"language-markup\">{{ codeString }}</code></pre>\n </details>\n </div>\n</template>\n`;\n }\n /**\n * Generate code string for display in the details section\n */\n generateCodeForDisplay(_component, eventHandlers, template) {\n let displayCode = '<script setup lang=\"ts\">';\n if (eventHandlers) {\n displayCode += `\\n${eventHandlers}`;\n }\n displayCode += `\\n</script>\\n\\n<template>\\n <div>\\n${template}\\n </div>\\n</template>`;\n return displayCode;\n }\n /**\n * Convert component structure to Vue template\n */\n structureToTemplate(struct, componentInfo, indent, isFirstOfType) {\n const componentName = struct.tag;\n // Track if this is the first occurrence of this tag type (for events)\n const isFirst = !isFirstOfType.has(struct.tag);\n if (isFirst) {\n isFirstOfType.set(struct.tag, true);\n }\n // Convert attributes to Vue props (keep kebab-case for Vue)\n const propEntries = Object.entries(struct.attributes)\n .map(([key, value]) => {\n const propValue = this.toVuePropValue(value, key);\n if (!propValue)\n return null;\n // Check if propValue has the __BOOLEAN__ marker for boolean values\n if (propValue.startsWith(\"__BOOLEAN__\")) {\n // Remove the __BOOLEAN__ marker and get the boolean value\n const boolValue = propValue.replace(/^__BOOLEAN__/, \"\");\n // Use v-bind with the boolean value\n return [`:${key}`, `\"${boolValue}\"`];\n }\n // Check if propValue has the __VBIND__ marker for JSON objects/arrays\n if (propValue.startsWith(\"__VBIND__\")) {\n // Remove the __VBIND__ marker and extract the actual value (with quotes)\n const actualValue = propValue.replace(/^__VBIND__/, \"\");\n // Use v-bind with a JSON literal wrapped in single quotes\n return [`:${key}`, actualValue];\n }\n // Check if propValue has the __VBIND_NUMBER__ marker for numeric values\n if (propValue.startsWith(\"__VBIND_NUMBER__\")) {\n const numberValue = propValue.replace(/^__VBIND_NUMBER__/, \"\");\n return [`:${key}`, numberValue];\n }\n return [key, propValue];\n })\n .filter(Boolean);\n const eventProps = [];\n if (isFirst && componentInfo.events.length > 0) {\n const relevantEvents = componentInfo.events.filter((event) => event.sourceComponent\n ? event.sourceComponent === struct.tag\n : struct.tag === componentInfo.component);\n relevantEvents.forEach((event) => {\n const handlerName = toHandlerFunctionName(event.name);\n eventProps.push([`@${event.name}`, `\"${handlerName}\"`]);\n });\n }\n const allProps = [...propEntries, ...eventProps];\n // Format opening tag with props\n const openTag = this.formatOpeningTag(componentName, allProps, indent);\n // Handle children\n if (struct.children && struct.children.length > 0) {\n const childrenTemplate = struct.children\n .map((child) => this.structureToTemplate(child, componentInfo, `${indent} `, isFirstOfType))\n .join(\"\\n\");\n return `${openTag}>\\n${childrenTemplate}\\n${indent}</${componentName}>`;\n }\n // Handle text content\n if (struct.textContent) {\n const trimmedText = struct.textContent.trim();\n return `${openTag}>\\n${indent} ${trimmedText}\\n${indent}</${componentName}>`;\n }\n // Self-closing tag\n return `${openTag} />`;\n }\n /**\n * Format opening tag with props\n */\n formatOpeningTag(componentName, props, indent) {\n if (props.length === 0) {\n return `${indent}<${componentName}`;\n }\n else if (props.length === 1) {\n const [name, value] = props[0];\n return `${indent}<${componentName} ${name}=${value}`;\n }\n else {\n const propsString = props\n .map(([name, value]) => `${indent} ${name}=${value}`)\n .join(\"\\n\");\n return `${indent}<${componentName}\\n${propsString}`;\n }\n }\n /**\n * Convert attribute value to Vue prop value\n */\n toVuePropValue(value, _attrName) {\n // Skip undefined values\n if (value === \"undefined\")\n return null;\n // Boolean values - use special marker for v-bind\n if (value === \"true\")\n return \"__BOOLEAN__true\";\n if (value === \"false\")\n return \"__BOOLEAN__false\";\n // Numeric values\n if (!Number.isNaN(Number(value)) && value !== \"\" && value !== \"null\") {\n return `__VBIND_NUMBER__${value}`;\n }\n // Null\n if (value === \"null\")\n return null;\n // JSON marker from parser (object/array values)\n if (value.startsWith(\"__JSON__\")) {\n const jsonValue = value.replace(/^__JSON__/, \"\");\n const escapedValue = escapeForSingleQuotedAttr(jsonValue);\n return `__VBIND__'${escapedValue}'`;\n }\n // String values - if contains double quotes, use single quotes for wrapper\n if (value.includes('\"')) {\n // Escape backslashes and single quotes in the value, then wrap in single quotes\n const escapedValue = escapeForSingleQuotedAttr(value);\n return `'${escapedValue}'`;\n }\n return `\"${value}\"`;\n }\n}\n", "import { render } from \"@lit-labs/ssr\";\nimport { collectResultSync } from \"@lit-labs/ssr/lib/render-result.js\";\nimport { cleanLitHTML, unwrapComponent } from \"./utils/html-utils.js\";\n/**\n * Renders a single story export to HTML string\n * Handles CSF2 (function exports) and CSF3 (object with render function)\n *\n * @param storyExport - The story export (function or object with render)\n * @param args - Arguments to pass to the story\n * @returns HTML string or null if rendering failed\n */\nexport function renderStoryToHTML(storyExport, args) {\n // Handle both CSF2 (function) and CSF3 (object with render) formats\n let result;\n if (typeof storyExport === \"function\") {\n // CSF2: Story is a function\n result = storyExport(args);\n }\n else if (storyExport &&\n typeof storyExport === \"object\" &&\n \"render\" in storyExport) {\n // CSF3: Story is an object with a render function\n // Merge story-specific args with default args\n const storyArgs = { ...args, ...(storyExport.args || {}) };\n result = storyExport.render(storyArgs);\n }\n else {\n return null;\n }\n if (!result) {\n return null;\n }\n let html;\n // Handle Lit TemplateResult\n if (result && typeof result === \"object\" && \"_$litType$\" in result) {\n const ssrResult = render(result);\n html = collectResultSync(ssrResult);\n html = cleanLitHTML(html);\n }\n // Handle string template\n else if (typeof result === \"string\") {\n html = result;\n }\n // Handle DOM element\n else if (result && typeof result === \"object\" && \"outerHTML\" in result) {\n html = result.outerHTML;\n }\n else {\n return null;\n }\n return html;\n}\n/**\n * Converts HTML string to DOM element and optionally unwraps it\n *\n * @param html - HTML string to parse\n * @param unwrap - Whether to unwrap wrapper divs\n * @returns DOM Element or null\n */\nexport function htmlToElement(html, unwrap = true) {\n const tempDiv = document.createElement(\"div\");\n tempDiv.innerHTML = html.trim();\n let element = tempDiv.firstElementChild;\n if (!element) {\n return null;\n }\n // Unwrap wrapper divs if requested\n if (unwrap) {\n element = unwrapComponent(element);\n }\n return element;\n}\n", "import { JSDOM } from \"jsdom\";\nlet isDomSetup = false;\n/**\n * Sets up a minimal jsdom environment for parsing stories\n * This only needs to be called once\n */\nexport function setupDOM() {\n if (isDomSetup)\n return;\n const dom = new JSDOM(\"<!DOCTYPE html><html><body></body></html>\", {\n url: \"http://localhost\",\n pretendToBeVisual: true,\n });\n global.document = dom.window.document;\n global.window = dom.window;\n global.HTMLElement = dom.window.HTMLElement;\n global.Element = dom.window.Element;\n // Mock querySelector/querySelectorAll to return safe objects\n const originalQuerySelector = dom.window.document.querySelector.bind(dom.window.document);\n const originalQuerySelectorAll = dom.window.document.querySelectorAll.bind(dom.window.document);\n const mockElement = dom.window.document.createElement(\"div\");\n const emptyNodeList = dom.window.document\n .createDocumentFragment()\n .querySelectorAll(\"*\");\n dom.window.document.querySelector = (selector) => {\n const element = originalQuerySelector(selector);\n return element ?? mockElement;\n };\n dom.window.document.querySelectorAll = (selector) => {\n const elements = originalQuerySelectorAll(selector);\n return elements.length > 0 ? elements : emptyNodeList;\n };\n // Stub out setTimeout to prevent async event listener attachments during SSR\n global.setTimeout = (() => 0);\n isDomSetup = true;\n}\n", "import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { htmlToElement, renderStoryToHTML } from \"./story-renderer.js\";\nimport { setupDOM } from \"./utils/dom-utils.js\";\n// Ensure DOM is set up before parsing stories\nsetupDOM();\nlet cemCache = null;\nfunction toKebabCase(value) {\n return value\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .replace(/\\s+/g, \"-\")\n .toLowerCase();\n}\nfunction findCemPath() {\n let current = process.cwd();\n for (let i = 0; i < 6; i += 1) {\n const candidate = path.join(current, \"packages\", \"components\", \"dist\", \"cem.json\");\n if (fs.existsSync(candidate))\n return candidate;\n const parent = path.dirname(current);\n if (parent === current)\n break;\n current = parent;\n }\n return null;\n}\nfunction loadCem() {\n if (cemCache)\n return cemCache;\n try {\n const cemPath = findCemPath();\n if (!cemPath)\n return null;\n const cem = JSON.parse(fs.readFileSync(cemPath, \"utf-8\"));\n const map = new Map();\n for (const module of cem.modules || []) {\n for (const decl of module.declarations || []) {\n if (!decl.customElement || !decl.tagName)\n continue;\n const allowed = new Set();\n const attributeTypes = new Map();\n for (const attr of decl.attributes || []) {\n // CEM attributes have a canonical kebab `name`\n const kebab = attr.name || (attr.fieldName ? toKebabCase(attr.fieldName) : \"\");\n if (!kebab)\n continue;\n allowed.add(kebab);\n if (attr.fieldName) {\n allowed.add(attr.fieldName);\n allowed.add(attr.fieldName.toLowerCase());\n }\n allowed.add(kebab.toLowerCase());\n if (attr.type?.text) {\n attributeTypes.set(kebab, attr.type.text);\n }\n }\n const events = (decl.events || []).map((ev) => ({\n name: ev.name || \"\",\n description: ev.description || \"\",\n sourceComponent: decl.tagName || null,\n }));\n map.set(decl.tagName, {\n allowedAttributes: allowed,\n attributeTypes,\n events,\n });\n }\n }\n cemCache = map;\n return cemCache;\n }\n catch {\n return null;\n }\n}\n/** Collect events from CEM for all ifx-* tags present in the component structure */\nfunction extractEventsFromCem(structure, cem) {\n const events = [];\n const visited = new Set();\n function walk(struct) {\n const { tag } = struct;\n if (!visited.has(tag) && tag.startsWith(\"ifx-\")) {\n visited.add(tag);\n const info = cem.get(tag);\n if (info)\n events.push(...info.events);\n }\n for (const child of struct.children)\n walk(child);\n }\n walk(structure);\n return events;\n}\n/** Build propTypes map (tag \u2192 kebab-attr-name \u2192 type text) for all tags in the structure */\nfunction buildPropTypesFromCem(structure, cem) {\n const result = {};\n function walk(struct) {\n const { tag } = struct;\n if (!(tag in result) && tag.startsWith(\"ifx-\")) {\n const info = cem.get(tag);\n if (info) {\n result[tag] = Object.fromEntries(info.attributeTypes);\n }\n }\n for (const child of struct.children)\n walk(child);\n }\n walk(structure);\n return result;\n}\n/**\n * Recursively parses a DOM element into a structured format\n */\nexport function parseElement(element) {\n if (!element) {\n throw new Error(\"parseElement received undefined or null element\");\n }\n if (!element.tagName) {\n throw new Error(`Element does not have a tagName property. Received: ${typeof element}, value: ${JSON.stringify(element)}`);\n }\n const structure = {\n tag: element.tagName.toLowerCase(),\n attributes: {},\n textContent: \"\",\n children: [],\n };\n // Get attributes\n Array.from(element.attributes).forEach((attr) => {\n // Remove literal newlines and excess whitespace from attribute values\n structure.attributes[attr.name] = attr.value.replace(/\\s+/g, \" \").trim();\n });\n // Get direct text content (not from children)\n const directText = Array.from(element.childNodes)\n .filter((node) => node.nodeType === 3) // Text nodes only\n .map((node) => node.textContent?.trim() || \"\")\n .filter((text) => text.length > 0)\n .join(\" \");\n if (directText) {\n structure.textContent = directText;\n }\n // Parse children recursively\n Array.from(element.children).forEach((child) => {\n structure.children.push(parseElement(child));\n });\n return structure;\n}\n/**\n * Renders a story module to HTML (for MCP server use case)\n * Returns array of rendered stories with their names\n */\nexport async function renderStoriesToHTML(storyModule, options = {}) {\n const renderedStories = [];\n // Get the default export (story metadata)\n const storyMeta = storyModule.default || {};\n const defaultArgs = storyMeta.args || {};\n // Get all exported stories (excluding 'default')\n const storyExports = Object.keys(storyModule).filter((key) => key !== \"default\");\n if (storyExports.length === 0) {\n return [];\n }\n // Fallback story names to prefer\n const fallbackNames = [\n \"Default\",\n \"Single\",\n \"Primary\",\n \"Basic\",\n \"Medium\",\n \"DefaultState\",\n ];\n // Select which stories to render\n const storiesToRender = new Set();\n if (options.preferredStories && options.preferredStories.length > 0) {\n // Use specified stories\n for (const name of options.preferredStories) {\n if (storyExports.includes(name)) {\n storiesToRender.add(name);\n }\n }\n }\n else if (!options.renderAll) {\n // Try to find at least one fallback story\n for (const fallbackName of fallbackNames) {\n if (storyExports.includes(fallbackName)) {\n storiesToRender.add(fallbackName);\n break; // Only use the first matching fallback\n }\n }\n }\n // If no stories selected and renderAll is true, render all\n if (storiesToRender.size === 0 && options.renderAll) {\n for (const name of storyExports) {\n storiesToRender.add(name);\n }\n }\n // If still no stories, use the fallback logic from example-generator\n if (storiesToRender.size === 0) {\n for (const fallbackName of fallbackNames) {\n if (storyExports.includes(fallbackName)) {\n storiesToRender.add(fallbackName);\n break;\n }\n }\n }\n // Render each selected story\n for (const storyName of storiesToRender) {\n const storyExport = storyModule[storyName];\n const html = renderStoryToHTML(storyExport, defaultArgs);\n if (html) {\n // Parse to element and unwrap if needed\n const element = htmlToElement(html, true);\n if (element) {\n renderedStories.push({ name: storyName, html: element.outerHTML });\n }\n else {\n renderedStories.push({ name: storyName, html });\n }\n }\n }\n return renderedStories;\n}\n/**\n * Extracts complete component information from a story module\n * Returns an array of ComponentInfo, one for each story variant\n * (for example-generator use case)\n */\nexport async function extractComponentInfo(storyPath, storyNames) {\n try {\n // Convert relative path to absolute path from current working directory\n // This ensures the path is correctly resolved regardless of where dds-tooling is located\n const absolutePath = resolve(process.cwd(), storyPath);\n const fileUrl = pathToFileURL(absolutePath).href;\n // Dynamic import of the story module using file URL\n const storyModule = await import(fileUrl);\n const metadata = storyModule.default || {};\n // Determine which stories to extract\n const storiesToExtract = [];\n if (storyNames && storyNames.length > 0) {\n // Extract all specified stories that exist\n for (const storyName of storyNames) {\n if (storyModule[storyName]) {\n storiesToExtract.push({\n name: storyName,\n export: storyModule[storyName],\n });\n }\n }\n if (storiesToExtract.length === 0) {\n throw new Error(`None of the specified stories [${storyNames.join(\", \")}] found in ${storyPath}`);\n }\n }\n else {\n // Fallback: Try multiple story exports\n const fallbackNames = [\n \"Default\",\n \"Single\",\n \"Primary\",\n \"Basic\",\n \"Medium\",\n \"DefaultState\",\n ];\n for (const name of fallbackNames) {\n if (storyModule[name]) {\n storiesToExtract.push({ name, export: storyModule[name] });\n break; // Only take the first one in fallback mode\n }\n }\n if (storiesToExtract.length === 0) {\n throw new Error(`No Default/Single/Primary/Basic/Medium/DefaultState export found in ${storyPath}`);\n }\n }\n // Extract info for each story\n const results = [];\n for (const story of storiesToExtract) {\n const StoryExport = story.export;\n const usedStoryName = story.name;\n // Merge metadata.args (defaults) with StoryExport.args (overrides)\n const args = {\n ...(metadata.args || {}),\n ...(StoryExport.args || {}),\n };\n // Use the shared rendering utility to handle CSF2/CSF3 and Lit SSR\n const html = renderStoryToHTML(StoryExport, args);\n if (!html) {\n throw new Error(`Failed to render story to HTML. Story path: ${storyPath}, Story: ${usedStoryName}`);\n }\n // Convert HTML to DOM element and unwrap wrapper divs if needed\n const resolvedElement = htmlToElement(html, true);\n if (!resolvedElement) {\n throw new Error(`Failed to parse HTML into DOM element. Story path: ${storyPath}, Story: ${usedStoryName}`);\n }\n // Parse the structure\n const structure = parseElement(resolvedElement);\n const cem = loadCem();\n const cemTagInfo = cem?.get(structure.tag);\n // Merge story args into attributes that are not already serialized as HTML attrs.\n // Only include args that exist in CEM (to exclude story-only controls like \"amountOfItems\").\n if (cemTagInfo) {\n Object.entries(args).forEach(([key, value]) => {\n if (value === undefined || value === null)\n return;\n if (typeof value === \"function\")\n return;\n const kebabKey = toKebabCase(key);\n if (!cemTagInfo.allowedAttributes.has(key) &&\n !cemTagInfo.allowedAttributes.has(kebabKey) &&\n !cemTagInfo.allowedAttributes.has(key.toLowerCase()) &&\n !cemTagInfo.allowedAttributes.has(kebabKey.toLowerCase())) {\n return;\n }\n if (key in structure.attributes || kebabKey in structure.attributes)\n return;\n let normalized = null;\n if (typeof value === \"string\") {\n normalized = value;\n }\n else if (typeof value === \"number\" || typeof value === \"boolean\") {\n normalized = String(value);\n }\n else if (Array.isArray(value) || typeof value === \"object\") {\n normalized = `__JSON__${JSON.stringify(value)}`;\n }\n if (normalized !== null) {\n structure.attributes[kebabKey] = normalized;\n }\n });\n }\n const events = cem ? extractEventsFromCem(structure, cem) : [];\n const propTypes = cem ? buildPropTypesFromCem(structure, cem) : {};\n const title = metadata.title?.replace(/^Components\\//, \"\") || metadata.title;\n results.push({\n component: metadata.component || structure.tag,\n title,\n storyName: usedStoryName,\n structure,\n events,\n defaultArgs: args,\n propTypes,\n });\n }\n return results;\n }\n catch (error) {\n throw new Error(`Failed to extract component info from ${storyPath}: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n", "import type { Framework } from \"../runtime/types.js\";\n\nexport function getFrameworkNotes(framework: Framework, tag: string): string {\n\tconst componentName = tagToComponentName(tag);\n\n\tswitch (framework) {\n\t\tcase \"react\":\n\t\t\treturn `### React\n\nImport the component:\n\\`\\`\\`tsx\nimport { ${componentName} } from '@infineon/infineon-design-system-react';\n\\`\\`\\`\n\nUsage:\n- Use **PascalCase** component names: \\`<${componentName}>\\` instead of \\`<${tag}>\\`\n- Use **camelCase** for props: \\`onClick\\`, \\`className\\`, etc. (aria-label stays the same)\n- Event handlers use \\`on\\` prefix: \\`onIfxChange\\`, \\`onIfxClose\\`, etc.\n- Boolean props don't need explicit value: \\`<${componentName} disabled />\\``;\n\n\t\tcase \"vue\":\n\t\t\treturn `### Vue\n\nImport and register the library:\n\n\\`\\`\\`ts\nimport { ComponentLibrary } from '@infineon/infineon-design-system-vue';\napp.use(ComponentLibrary);\n\\`\\`\\`\n\nUsage:\n- Use **kebab-case** in templates: \\`<${tag}>\\`\n- Event handlers use \\`@\\` syntax: \\`@ifx-change=\"handler\"\\`\n- v-model binding can be used where supported`;\n\n\t\tcase \"angular\":\n\t\t\treturn `### Angular\n\n**Module-based approach:**\n\\`\\`\\`ts\nimport { InfineonDesignSystemModule } from '@infineon/infineon-design-system-angular';\n// For ngModel support on form components:\nimport { BooleanValueAccessor, TextValueAccessor } from '@infineon/infineon-design-system-angular';\n\n@NgModule({\n imports: [InfineonDesignSystemModule, FormsModule],\n})\n\\`\\`\\`\n\n**Standalone approach:**\n\\`\\`\\`ts\nimport { ${componentName} } from '@infineon/infineon-design-system-angular/standalone';\n// For ngModel support on form components:\nimport { BooleanValueAccessor, TextValueAccessor } from '@infineon/infineon-design-system-angular/standalone';\n\\`\\`\\`\n\nUsage:\n- Use **kebab-case** in templates: \\`<${tag}>\\`\n- Event handlers use parentheses: \\`(ifxChange)=\"handler($event)\"\\`\n- Property binding uses square brackets: \\`[disabled]=\"isDisabled\"\\`\n- Two-way binding with \\`[(ngModel)]\\` requires importing the appropriate ValueAccessor`;\n\n\t\tcase \"html\":\n\t\t\treturn `### Vanilla HTML/JavaScript\n\nInclude via CDN:\n\\`\\`\\`html\n<script type=\"module\" src=\"https://unpkg.com/@infineon/infineon-design-system-stencil/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js\"></script>\n<link rel=\"stylesheet\" href=\"https://unpkg.com/@infineon/infineon-design-system-stencil/dist/infineon-design-system-stencil/infineon-design-system-stencil.css\">\n\\`\\`\\`\n\nOr install via npm:\n\\`\\`\\`bash\nnpm install @infineon/infineon-design-system-stencil\n\\`\\`\\`\n\nand import in your JavaScript:\n\\`\\`\\`js\nimport '@infineon/infineon-design-system-stencil/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js';\nimport '@infineon/infineon-design-system-stencil/dist/infineon-design-system-stencil/infineon-design-system-stencil.css';\n\\`\\`\\`\n\nUsage:\n- Use **kebab-case**: \\`<${tag}>\\`\n- Event listeners: \\`element.addEventListener('ifxChange', handler)\\`\n- Properties via JavaScript: \\`element.disabled = true\\``;\n\n\t\tdefault:\n\t\t\treturn \"\";\n\t}\n}\n\nfunction tagToComponentName(tag: string): string {\n\t// Convert ifx-button -> IfxButton, ifx-text-field -> IfxTextField\n\treturn tag\n\t\t.split(\"-\")\n\t\t.map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n\t\t.join(\"\");\n}\n\nexport function normalizeComponentName(input: string): string {\n\t// If already kebab-case (contains hyphens), return as-is\n\tif (input.includes(\"-\")) {\n\t\treturn input.toLowerCase();\n\t}\n\n\t// Convert PascalCase to kebab-case: IfxButton -> ifx-button\n\treturn input\n\t\t.replace(/([A-Z])/g, \"-$1\")\n\t\t.toLowerCase()\n\t\t.replace(/^-/, \"\"); // Remove leading hyphen\n}\n", "import {\n\tAngularCodeFormatter,\n\ttype ComponentInfo,\n\ttype FormatOptions,\n\tHTMLCodeFormatter,\n\tReactCodeFormatter,\n\tVueCodeFormatter,\n} from \"@infineon/dds-tooling\";\nimport type {\n\tComponentDocRequest,\n\tComponentIndexRequest,\n\tDdsDataSource,\n\tIncludeKey,\n\tStencilDocsComponent,\n} from \"../runtime/types.js\";\nimport { getFrameworkNotes } from \"./frameworkNotes.js\";\n\nexport function renderComponentIndexMarkdown(\n\treq: ComponentIndexRequest,\n\tsource: DdsDataSource,\n): string {\n\tconst tags = listAllTags(source);\n\n\tconst lines: string[] = [];\n\tlines.push(\"# DDS Components\");\n\tlines.push(\"\");\n\tlines.push(`- Version: ${req.version}`);\n\tlines.push(`- Framework: ${req.framework}`);\n\tlines.push(\"\");\n\n\tlines.push(\"| Tag | Notes |\");\n\tlines.push(\"|-----|-------|\");\n\tfor (const tag of tags) {\n\t\tlines.push(`| \\`${tag}\\` | |`);\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\nexport function renderComponentDocMarkdown(\n\treq: ComponentDocRequest,\n\tsource: DdsDataSource,\n): string {\n\tconst include = new Set<IncludeKey>(req.include);\n\tconst tag = req.component;\n\n\tconst doc = findComponent(source, tag);\n\tif (!doc) {\n\t\treturn [\n\t\t\t`# ${tag}`,\n\t\t\t\"\",\n\t\t\t`- Version: ${req.version}`,\n\t\t\t`- Framework: ${req.framework}`,\n\t\t\t\"\",\n\t\t\t`Component not found: \\`${tag}\\`.`,\n\t\t].join(\"\\n\");\n\t}\n\n\tconst lines: string[] = [];\n\tlines.push(`# ${tag}`);\n\tlines.push(\"\");\n\tlines.push(`- Version: ${req.version}`);\n\tlines.push(`- Framework: ${req.framework}`);\n\tlines.push(\"\");\n\n\tif (doc.description) {\n\t\tlines.push(doc.description);\n\t\tlines.push(\"\");\n\t}\n\n\tif (include.has(\"properties\") && doc.props.length) {\n\t\tlines.push(\"## Properties\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"| Property | Attribute | Type | Default | Description |\");\n\t\tlines.push(\"|----------|-----------|------|---------|-------------|\");\n\t\tfor (const p of doc.props) {\n\t\t\tlines.push(\n\t\t\t\t`| \\`${p.name}\\` | ${p.attr ? `\\`${p.attr}\\`` : \"\u2014\"} | ${p.type ? `\\`${p.type}\\`` : \"\u2014\"} | ${p.default ? `\\`${p.default}\\`` : \"\u2014\"} | ${escapePipes(p.docs ?? \"\")} |`,\n\t\t\t);\n\t\t}\n\t\tlines.push(\"\");\n\t}\n\n\tif (include.has(\"events\") && doc.events.length) {\n\t\tlines.push(\"## Events\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"| Event | Type | Description |\");\n\t\tlines.push(\"|-------|------|-------------|\");\n\t\tfor (const e of doc.events) {\n\t\t\tlines.push(\n\t\t\t\t`| \\`${e.name}\\` | ${e.type ? `\\`${e.type}\\`` : \"\u2014\"} | ${escapePipes(e.docs ?? \"\")} |`,\n\t\t\t);\n\t\t}\n\t\tlines.push(\"\");\n\t}\n\n\tif (include.has(\"slots\") && doc.slots.length) {\n\t\tlines.push(\"## Slots\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"| Name | Description |\");\n\t\tlines.push(\"|------|-------------|\");\n\t\tfor (const s of doc.slots) {\n\t\t\tlines.push(\n\t\t\t\t`| ${s.name ? `\\`${s.name}\\`` : \"\u2014\"} | ${escapePipes(s.docs ?? \"\")} |`,\n\t\t\t);\n\t\t}\n\t\tlines.push(\"\");\n\t}\n\n\tif (include.has(\"css\") && (doc.cssProps.length || doc.cssParts.length)) {\n\t\tif (doc.cssProps.length) {\n\t\t\tlines.push(\"## CSS Properties\");\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"| Name | Description |\");\n\t\t\tlines.push(\"|------|-------------|\");\n\t\t\tfor (const c of doc.cssProps) {\n\t\t\t\tlines.push(`| \\`${c.name}\\` | ${escapePipes(c.docs ?? \"\")} |`);\n\t\t\t}\n\t\t\tlines.push(\"\");\n\t\t}\n\n\t\tif (doc.cssParts.length) {\n\t\t\tlines.push(\"## CSS Parts\");\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"| Name | Description |\");\n\t\t\tlines.push(\"|------|-------------|\");\n\t\t\tfor (const p of doc.cssParts) {\n\t\t\t\tlines.push(`| \\`${p.name}\\` | ${escapePipes(p.docs ?? \"\")} |`);\n\t\t\t}\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\n\tif (include.has(\"examples\")) {\n\t\tconst componentInfo = source.examples?.get(tag);\n\t\tif (componentInfo) {\n\t\t\tlines.push(\"## Example\");\n\t\t\tlines.push(\"\");\n\n\t\t\t// Generate framework-specific code using dds-tooling formatters\n\t\t\tconst code = generateFrameworkCode(componentInfo, req.framework);\n\t\t\tconst language = getLanguageForFramework(req.framework);\n\n\t\t\tlines.push(`\\`\\`\\`${language}`);\n\t\t\tlines.push(code.trim());\n\t\t\tlines.push(\"```\");\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\n\t// Add framework-specific usage notes\n\tconst frameworkNotes = getFrameworkNotes(req.framework, tag);\n\tif (frameworkNotes) {\n\t\tlines.push(\"## Framework-Specific Usage\");\n\t\tlines.push(\"\");\n\t\tlines.push(frameworkNotes);\n\t\tlines.push(\"\");\n\t}\n\n\treturn lines.join(\"\\n\").trimEnd();\n}\n\nfunction listAllTags(source: DdsDataSource): string[] {\n\tconst tags = new Set<string>();\n\tfor (const c of source.docs?.components ?? []) tags.add(c.tag);\n\treturn Array.from(tags).sort();\n}\n\nfunction findComponent(\n\tsource: DdsDataSource,\n\ttag: string,\n):\n\t| {\n\t\t\tdescription?: string;\n\t\t\tprops: Array<{\n\t\t\t\tname: string;\n\t\t\t\tattr?: string;\n\t\t\t\ttype?: string;\n\t\t\t\tdefault?: string;\n\t\t\t\tdocs?: string;\n\t\t\t}>;\n\t\t\tevents: Array<{ name: string; type?: string; docs?: string }>;\n\t\t\tslots: Array<{ name?: string; docs?: string }>;\n\t\t\tcssProps: Array<{ name: string; docs?: string }>;\n\t\t\tcssParts: Array<{ name: string; docs?: string }>;\n\t }\n\t| undefined {\n\tconst fromDocs = source.docs?.components?.find((c) => c.tag === tag);\n\tif (fromDocs) return normalizeFromDocs(fromDocs);\n\treturn undefined;\n}\n\nfunction normalizeFromDocs(c: StencilDocsComponent) {\n\treturn {\n\t\tdescription: c.docs,\n\t\tprops: (c.props ?? []).map((p) => ({\n\t\t\tname: p.name,\n\t\t\tattr: p.attr,\n\t\t\ttype: p.type,\n\t\t\tdefault: p.default,\n\t\t\tdocs: p.docs,\n\t\t})),\n\t\tevents: (c.events ?? []).map((e) => ({\n\t\t\tname: e.event,\n\t\t\ttype: e.detail,\n\t\t\tdocs: e.docs,\n\t\t})),\n\t\tslots: c.slots ?? [],\n\t\tcssProps: c.styles ?? [],\n\t\tcssParts: c.parts ?? [],\n\t};\n}\n\nfunction escapePipes(s: string): string {\n\treturn s.replace(/\\\\/g, \"\\\\\\\\\").replace(/\\|/g, \"\\\\|\");\n}\n\nfunction generateFrameworkCode(\n\tcomponentInfo: ComponentInfo,\n\tframework: string,\n): string {\n\tconst formatOptions: FormatOptions = {\n\t\tindent: \" \",\n\t\tbaseIndent: \"\",\n\t};\n\n\tswitch (framework) {\n\t\tcase \"react\":\n\t\t\treturn new ReactCodeFormatter().formatComponent(\n\t\t\t\tcomponentInfo,\n\t\t\t\tformatOptions,\n\t\t\t);\n\t\tcase \"vue\":\n\t\t\treturn new VueCodeFormatter().formatComponent(\n\t\t\t\tcomponentInfo,\n\t\t\t\tformatOptions,\n\t\t\t);\n\t\tcase \"angular\":\n\t\t\treturn new AngularCodeFormatter().formatComponent(\n\t\t\t\tcomponentInfo,\n\t\t\t\tformatOptions,\n\t\t\t);\n\t\tdefault:\n\t\t\treturn new HTMLCodeFormatter().formatComponent(\n\t\t\t\tcomponentInfo,\n\t\t\t\tformatOptions,\n\t\t\t);\n\t}\n}\n\nfunction getLanguageForFramework(framework: string): string {\n\tswitch (framework) {\n\t\tcase \"react\":\n\t\t\treturn \"tsx\";\n\t\tcase \"vue\":\n\t\t\treturn \"vue\";\n\t\tcase \"angular\":\n\t\t\treturn \"typescript\";\n\t\tdefault:\n\t\t\treturn \"html\";\n\t}\n}\n"],
5
+ "mappings": ";;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AAErC,SAAS,SAAS;;;ACHlB,SAAS,YAAY,WAAW,cAAc,qBAAqB;AACnE,SAAS,YAAY;AACrB,SAAS,uBAAuB;AAYhC,SAAS,yBAAiC;AACzC,SAAO,KAAK,QAAQ,IAAI,GAAG,SAAS;AACrC;AAEA,SAAS,gBAAyB;AAEjC,QAAM,2BAA2B;AAAA,IAChC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,SAAO,yBAAyB;AAAA,IAAK,CAAC,WACrC,WAAW,KAAK,QAAQ,IAAI,GAAG,MAAM,CAAC;AAAA,EACvC;AACD;AAEA,eAAe,YAAY,UAAmC;AAC7D,QAAM,KAAK,gBAAgB;AAAA,IAC1B,OAAO,QAAQ;AAAA,IACf,QAAQ,QAAQ;AAAA,EACjB,CAAC;AAED,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC/B,OAAG,SAAS,UAAU,CAAC,WAAW;AACjC,SAAG,MAAM;AACT,cAAQ,OAAO,KAAK,CAAC;AAAA,IACtB,CAAC;AAAA,EACF,CAAC;AACF;AAEA,SAAS,gBAAgB;AAGxB,SAAO;AAAA,IACN,SAAS;AAAA,IACT,MAAM,CAAC,QAAQ,6BAA6B;AAAA,EAC7C;AACD;AAEA,eAAsB,WAA0B;AAC/C,UAAQ,IAAI,2BAAoB;AAChC,UAAQ;AAAA,IACP;AAAA,EACD;AAGA,MAAI,CAAC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AAO,QAAQ,SAAS;AAC/B;AAGA,eAAe,OAAO;AACrB,QAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,QAAM,SAAS,MAAM,UAAU,IAAI;AAEnC,MAAI,WAAW,YAAY;AAC1B,UAAM,YAAY;AAAA,EACnB;AACD;AAEA,KAAK,EAAE,MAAM,CAAC,UAAU;AACvB,UAAQ,MAAM,UAAU,KAAK;AAC7B,UAAQ,KAAK,CAAC;AACf,CAAC;",
6
6
  "names": ["readFile", "dirname", "join", "fileURLToPath", "join", "readdir", "readFile", "dirname", "join", "fileURLToPath", "__dirname", "fileURLToPath", "indent", "indent", "indent", "indent", "fileURLToPath", "__dirname", "dirname", "join", "readFile"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infineon/design-system-mcp",
3
- "version": "41.10.0",
3
+ "version": "41.11.0",
4
4
  "type": "module",
5
5
  "description": "MCP server for the Infineon Design System (DDS)",
6
6
  "repository": {
@@ -37,16 +37,16 @@
37
37
  "zod": "^3.23.8"
38
38
  },
39
39
  "devDependencies": {
40
- "@infineon/dds-tooling": "41.10.0",
40
+ "@infineon/dds-tooling": "41.11.0",
41
41
  "@types/node": "^20.19.33",
42
42
  "esbuild": "^0.27.4",
43
43
  "typescript": "^5.4.5"
44
44
  },
45
45
  "peerDependencies": {
46
- "@infineon/infineon-design-system-angular": "41.10.0",
47
- "@infineon/infineon-design-system-react": "41.10.0",
48
- "@infineon/infineon-design-system-stencil": "41.10.0",
49
- "@infineon/infineon-design-system-vue": "41.10.0"
46
+ "@infineon/infineon-design-system-angular": "41.11.0",
47
+ "@infineon/infineon-design-system-react": "41.11.0",
48
+ "@infineon/infineon-design-system-stencil": "41.11.0",
49
+ "@infineon/infineon-design-system-vue": "41.11.0"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@infineon/infineon-design-system-stencil": {
@@ -128,5 +128,5 @@
128
128
  }
129
129
  },
130
130
  "license": "MIT",
131
- "gitHead": "4df25da1cb9b5909b76dd3fbd4f34e025e8936c8"
131
+ "gitHead": "b56db754eaf4d75c7fd4c408ccfbbf486433c73a"
132
132
  }