MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / createTextNode

Function createTextNode

packages/extension/tests/utils/variable-output.test.ts:26–50  ·  view source on GitHub ↗
(overrides: Record<string, unknown> = {})

Source from the content-addressed store, hash-verified

24}
25
26function createTextNode(overrides: Record<string, unknown> = {}): TextNode {
27 return {
28 id: 'text-node',
29 type: 'TEXT',
30 visible: true,
31 characters: 'Hello world',
32 boundVariables: {
33 width: { id: 'size-card' },
34 height: { id: 'size-tall' }
35 },
36 fills: [
37 {
38 type: 'SOLID',
39 visible: true,
40 color: { r: 1, g: 0, b: 0 },
41 opacity: 1,
42 boundVariables: { color: { id: 'color-brand' } }
43 }
44 ],
45 getRangeBoundVariable: vi.fn((_start: number, _end: number, field: VariableBindableTextField) =>
46 field === 'fontFamily' ? { id: 'font-body' } : figma.mixed
47 ),
48 ...overrides
49 } as unknown as TextNode
50}
51
52function setupFigma({
53 variableById = {},

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected