fix: paramètres create_text (text/textAlign), template Penpot corrigé
This commit is contained in:
@@ -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**
|
||||
|
||||
Reference in New Issue
Block a user