@dannote/figma-use 0.4.0 → 0.5.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.
- package/CHANGELOG.md +50 -0
- package/README.md +217 -366
- package/SKILL.md +56 -0
- package/bin/figma-use.js +4 -1
- package/dist/cli/index.js +381 -62
- package/dist/proxy/index.js +8 -1
- package/package.json +1 -1
- package/packages/plugin/dist/main.js +52 -10
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.5.0] - 2026-01-18
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **`render --examples`** — full API reference for JSX rendering
|
|
15
|
+
- Main CLI help now mentions JSX rendering and points to `render --examples`
|
|
16
|
+
- **`defineComponent` for reusable components**
|
|
17
|
+
```tsx
|
|
18
|
+
const Button = defineComponent('Button',
|
|
19
|
+
<Frame style={{ padding: 12, backgroundColor: '#3B82F6' }}>
|
|
20
|
+
<Text style={{ color: '#FFF' }}>Click me</Text>
|
|
21
|
+
</Frame>
|
|
22
|
+
)
|
|
23
|
+
// First usage creates Component, subsequent create Instances
|
|
24
|
+
<Button />
|
|
25
|
+
<Button />
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- **`defineComponentSet` for component variants**
|
|
29
|
+
```tsx
|
|
30
|
+
const Button = defineComponentSet('Button', {
|
|
31
|
+
variant: ['Primary', 'Secondary'] as const,
|
|
32
|
+
size: ['Small', 'Large'] as const,
|
|
33
|
+
}, ({ variant, size }) => (
|
|
34
|
+
<Frame style={{
|
|
35
|
+
padding: size === 'Large' ? 16 : 8,
|
|
36
|
+
backgroundColor: variant === 'Primary' ? '#3B82F6' : '#E5E7EB'
|
|
37
|
+
}}>
|
|
38
|
+
<Text>{variant} {size}</Text>
|
|
39
|
+
</Frame>
|
|
40
|
+
))
|
|
41
|
+
// Creates ComponentSet with all variant combinations
|
|
42
|
+
<Button variant="Primary" size="Large" />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- Proper auto-sizing support (`hug contents`) for frames with `flexDirection`
|
|
46
|
+
- ComponentSet creates real Figma ComponentSet with `isStateGroup=true`
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
|
|
50
|
+
- Auto-layout sizing mode now correctly set to FIXED when explicit dimensions provided
|
|
51
|
+
- TEXT nodes render with correct height (lineHeight encoding fix)
|
|
52
|
+
- Alignment fields use correct names (stackPrimaryAlignItems, not stackJustify)
|
|
53
|
+
|
|
54
|
+
### Technical Notes
|
|
55
|
+
|
|
56
|
+
ComponentSet instances are created via Plugin API instead of multiplayer because
|
|
57
|
+
Figma reassigns GUIDs on receive, breaking symbolData.symbolID references within
|
|
58
|
+
the same batch. See `component-set.tsx` for detailed explanation.
|
|
59
|
+
|
|
10
60
|
## [0.4.0] - 2026-01-18
|
|
11
61
|
|
|
12
62
|
### Added
|