MCPcopy Index your code
hub / github.com/bernaferrari/FigmaToCode / htmlWidgetGenerator

Function htmlWidgetGenerator

packages/backend/src/html/htmlMain.ts:376–386  ·  view source on GitHub ↗
(
  sceneNode: ReadonlyArray<SceneNode>,
  settings: HTMLSettings,
)

Source from the content-addressed store, hash-verified

374};
375
376const htmlWidgetGenerator = async (
377 sceneNode: ReadonlyArray<SceneNode>,
378 settings: HTMLSettings,
379): Promise<string> => {
380 // filter non visible nodes. This is necessary at this step because conversion already happened.
381 const promiseOfConvertedCode = getVisibleNodes(sceneNode).map(
382 convertNode(settings),
383 );
384 const code = (await Promise.all(promiseOfConvertedCode)).join("");
385 return code;
386};
387
388const convertNode = (settings: HTMLSettings) => async (node: SceneNode) => {
389 if (settings.embedVectors && (node as any).canBeFlattened) {

Callers 4

htmlMainFunction · 0.85
htmlGroupFunction · 0.85
htmlFrameFunction · 0.85
htmlSectionFunction · 0.85

Calls 2

getVisibleNodesFunction · 0.90
convertNodeFunction · 0.70

Tested by

no test coverage detected