( node: FrameNode | InstanceNode | ComponentNode | ComponentSetNode, settings: TailwindSettings, )
| 170 | }; |
| 171 | |
| 172 | const tailwindFrame = async ( |
| 173 | node: FrameNode | InstanceNode | ComponentNode | ComponentSetNode, |
| 174 | settings: TailwindSettings, |
| 175 | ): Promise<string> => { |
| 176 | // Check if this is an instance and should be rendered as a Twig component |
| 177 | if (node.type === "INSTANCE" && isTwigComponentNode(node)) { |
| 178 | return tailwindTwigComponentInstance(node, settings); |
| 179 | } |
| 180 | |
| 181 | const childrenStr = await tailwindWidgetGenerator(node.children, settings); |
| 182 | |
| 183 | const clipsContentClass = |
| 184 | node.clipsContent && "children" in node && node.children.length > 0 |
| 185 | ? "overflow-hidden" |
| 186 | : ""; |
| 187 | let layoutProps = ""; |
| 188 | |
| 189 | if (node.layoutMode !== "NONE") { |
| 190 | layoutProps = tailwindAutoLayoutProps(node, node); |
| 191 | } |
| 192 | |
| 193 | // Combine classes properly, ensuring no extra spaces |
| 194 | const combinedProps = [layoutProps, clipsContentClass] |
| 195 | .filter(Boolean) |
| 196 | .join(" "); |
| 197 | |
| 198 | return tailwindContainer(node, childrenStr, combinedProps, settings); |
| 199 | }; |
| 200 | |
| 201 | |
| 202 | // Helper function to generate Twig component syntax for component instances |
no test coverage detected