fix: paramètres create_text (text/textAlign), template Penpot corrigé

This commit is contained in:
Nox
2026-02-28 14:19:26 +00:00
parent e38b484496
commit 59cad6735a
3 changed files with 162 additions and 241 deletions
+12 -3
View File
@@ -135,16 +135,25 @@
**5. `list_teams` retourne du texte** ("Found 1 teams"), pas du JSON
**6. Workflow création fichier** :
**6. `create_text` — paramètres corrects** :
- `text` (PAS `content`) → le contenu du texte
- `textAlign` (PAS `align`) → "left", "center", "right", "justify"
- `fontWeight` → string "100""900" ou "bold"
- `fillColor` → couleur HEX
- ⚠️ `parentId` **NON SUPPORTÉ** pour create_text — les textes vont toujours au root frame
- Width/height auto-calculés (text.length × fontSize × 0.6) — ne pas les spécifier
**7. Workflow création fichier** :
```
get_profile → defaultProjectId
create_file { projectId, name } → fileId
list_pages { fileId } → pageId (array[0].id)
create_frame { fileId, pageId, name, x, y, width, height, fillColor } → frameId
create_rectangle/text { fileId, pageId, parentId: frameId, ... }
create_rectangle { fileId, pageId, parentId: frameId, ... } ← parentId OK pour rect
create_text { fileId, pageId, text, x, y, textAlign, ... } ← PAS de parentId
```
**7. Coordonnées shapes dans un frame** : absolues (pas relatives au frame)
**8. Coordonnées** : absolues sur la page. Les textes se placent dans le root frame automatiquement. Pour un poster : mettre frame à (0,0) et textes aux bonnes coords absolues.
### Pour générer une image finale
- `export_shape` non dispo → utiliser **HTML/CSS → Playwright screenshot**